There is no reference in service.xml for metrics. I'll try and setup a test with the current release but the group I'm working with is using the Hortonworks distribution which is still on 0.12.
Thanks Shawn Weeks ________________________________ From: Sandeep Moré <[email protected]> Sent: Tuesday, May 22, 2018 8:51:41 AM To: [email protected] Subject: Re: Knox Rule Pattern is Matching HTML Tags Beyond the Pattern This appears to be a bug, Knox should not be rewriting this part, just to confirm, does the rule "YARNUI/yarn/outbound/metrics" have any references in service.xml ? Can you try with the latest Knox and see if it works and file a JIRA if this is still an issue. On Mon, May 21, 2018 at 7:26 PM, Shawn Weeks <[email protected]> wrote: > Just pasting in log now as attaching didn't work. > > > 2018-05-21 18:22:01,616 DEBUG hadoop.gateway > (GatewayFilter.java:doFilter(116)) > - Received request: GET /yarn/cluster/cluster > 2018-05-21 18:22:01,617 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: https://mgt1.example.org:8443/gateway/default/yarn/cluster/ > cluster, direction: IN via implicit rule: YARNUI/yarn/inbound/cluster to > URL: http://mgt2.example.org:8088/cluster/cluster > 2018-05-21 18:22:01,617 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: https://mgt1.example.org/gateway/default/yarn/cluster/ > app/application_1526937386763_0008, direction: IN via implicit rule: > YARNUI/yarn/inbound/cluster to URL: http://mgt2.example.org:8088/ > cluster/app/application_1526937386763_0008 > 2018-05-21 18:22:01,617 DEBUG hadoop.gateway > (DefaultDispatch.java:executeOutboundRequest(121)) > - Dispatch request: GET http://mgt2.example.org:8088/ > cluster/cluster?doAs=sweeks > 2018-05-21 18:22:01,624 DEBUG hadoop.gateway > (DefaultDispatch.java:executeOutboundRequest(134)) > - Dispatch response status: 200 > 2018-05-21 18:22:01,624 DEBUG hadoop.gateway (DefaultDispatch.java: > getInboundResponseContentType(203)) - Using explicit character set UTF-8 > for entity of type text/html > 2018-05-21 18:22:01,624 DEBUG hadoop.gateway (DefaultDispatch.java: > getInboundResponseContentType(211)) - Inbound response entity content > type: text/html; charset=utf-8 > 2018-05-21 18:22:01,625 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /static/yarn.css, direction: OUT via implicit rule: > YARNUI/yarn/outbound/static to URL: https://mgt1.example.org:443/ > gateway/default/yarn/static/yarn.css > 2018-05-21 18:22:01,625 DEBUG hadoop.gateway > (HtmlUrlRewriteFilterReader.java:filterValueString(59)) > - Failed to parse value as URL: > #layout { height: 100%; } > #layout thead td { height: 3em; } > #layout #navcell { width: 11em; padding: 0 1em; } > #layout td.content { padding-top: 0 } > #layout tbody { vertical-align: top; } > #layout tfoot td { height: 4em; } > > 2018-05-21 18:22:01,625 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /static/jquery/themes-1.9.1/base/jquery-ui.css, direction: > OUT via implicit rule: YARNUI/yarn/outbound/static to URL: > https://mgt1.example.org:443/gateway/default/yarn/static/ > jquery/themes-1.9.1/base/jquery-ui.css > 2018-05-21 18:22:01,625 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /static/dt-1.9.4/css/jui-dt.css, direction: OUT via > implicit rule: YARNUI/yarn/outbound/static to URL: > https://mgt1.example.org:443/gateway/default/yarn/static/ > dt-1.9.4/css/jui-dt.css > 2018-05-21 18:22:01,626 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /static/jquery/jquery-1.8.2.min.js, direction: OUT via > implicit rule: YARNUI/yarn/outbound/static to URL: > https://mgt1.example.org:443/gateway/default/yarn/static/ > jquery/jquery-1.8.2.min.js > 2018-05-21 18:22:01,626 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /static/jquery/jquery-ui-1.9.1.custom.min.js, direction: > OUT via implicit rule: YARNUI/yarn/outbound/static to URL: > https://mgt1.example.org:443/gateway/default/yarn/static/ > jquery/jquery-ui-1.9.1.custom.min.js > 2018-05-21 18:22:01,626 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /static/dt-1.9.4/js/jquery.dataTables.min.js, direction: > OUT via implicit rule: YARNUI/yarn/outbound/static to URL: > https://mgt1.example.org:443/gateway/default/yarn/static/ > dt-1.9.4/js/jquery.dataTables.min.js > 2018-05-21 18:22:01,626 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /static/yarn.dt.plugins.js, direction: OUT via implicit > rule: YARNUI/yarn/outbound/static to URL: https://mgt1.example.org:443/ > gateway/default/yarn/static/yarn.dt.plugins.js > 2018-05-21 18:22:01,626 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /static/dt-sorting/natural.js, direction: OUT via implicit > rule: YARNUI/yarn/outbound/static to URL: https://mgt1.example.org:443/ > gateway/default/yarn/static/dt-sorting/natural.js > 2018-05-21 18:22:01,626 DEBUG hadoop.gateway > (HtmlUrlRewriteFilterReader.java:filterValueString(59)) > - Failed to parse value as URL: > #jsnotice { padding: 0.2em; text-align: center; } > .ui-progressbar { height: 1em; min-width: 5em } > > 2018-05-21 18:22:01,627 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /static/hadoop-st.png, direction: OUT via implicit rule: > YARNUI/yarn/outbound/static to URL: https://mgt1.example.org:443/ > gateway/default/yarn/static/hadoop-st.png > 2018-05-21 18:22:01,627 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /cluster/cluster, direction: OUT via implicit rule: > YARNUI/yarn/outbound/cluster to URL: https://mgt1.example.org:443/ > gateway/default/yarn/cluster/cluster > 2018-05-21 18:22:01,627 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /cluster/nodes, direction: OUT via implicit rule: > YARNUI/yarn/outbound/cluster to URL: https://mgt1.example.org:443/ > gateway/default/yarn/cluster/nodes > 2018-05-21 18:22:01,627 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /cluster/nodelabels, direction: OUT via implicit rule: > YARNUI/yarn/outbound/cluster to URL: https://mgt1.example.org:443/ > gateway/default/yarn/cluster/nodelabels > 2018-05-21 18:22:01,627 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /cluster/apps, direction: OUT via implicit rule: > YARNUI/yarn/outbound/cluster to URL: https://mgt1.example.org:443/ > gateway/default/yarn/cluster/apps > 2018-05-21 18:22:01,627 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /cluster/apps/NEW, direction: OUT via implicit rule: > YARNUI/yarn/outbound/cluster to URL: https://mgt1.example.org:443/ > gateway/default/yarn/cluster/apps/NEW > 2018-05-21 18:22:01,628 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /cluster/apps/NEW_SAVING, direction: OUT via implicit rule: > YARNUI/yarn/outbound/cluster to URL: https://mgt1.example.org:443/ > gateway/default/yarn/cluster/apps/NEW_SAVING > 2018-05-21 18:22:01,628 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /cluster/apps/SUBMITTED, direction: OUT via implicit rule: > YARNUI/yarn/outbound/cluster to URL: https://mgt1.example.org:443/ > gateway/default/yarn/cluster/apps/SUBMITTED > 2018-05-21 18:22:01,628 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /cluster/apps/ACCEPTED, direction: OUT via implicit rule: > YARNUI/yarn/outbound/cluster to URL: https://mgt1.example.org:443/ > gateway/default/yarn/cluster/apps/ACCEPTED > 2018-05-21 18:22:01,628 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /cluster/apps/RUNNING, direction: OUT via implicit rule: > YARNUI/yarn/outbound/cluster to URL: https://mgt1.example.org:443/ > gateway/default/yarn/cluster/apps/RUNNING > 2018-05-21 18:22:01,628 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /cluster/apps/FINISHED, direction: OUT via implicit rule: > YARNUI/yarn/outbound/cluster to URL: https://mgt1.example.org:443/ > gateway/default/yarn/cluster/apps/FINISHED > 2018-05-21 18:22:01,628 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /cluster/apps/FAILED, direction: OUT via implicit rule: > YARNUI/yarn/outbound/cluster to URL: https://mgt1.example.org:443/ > gateway/default/yarn/cluster/apps/FAILED > 2018-05-21 18:22:01,628 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /cluster/apps/KILLED, direction: OUT via implicit rule: > YARNUI/yarn/outbound/cluster to URL: https://mgt1.example.org:443/ > gateway/default/yarn/cluster/apps/KILLED > 2018-05-21 18:22:01,629 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(166)) > - Rewrote URL: /cluster/scheduler, direction: OUT via explicit rule: > YARNUI/yarn/outbound/scheduler to URL: https://mgt1.example.org:443/ > gateway/default/yarn/cluster/scheduler > 2018-05-21 18:22:01,629 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /conf, direction: OUT via implicit rule: > YARNUI/yarn/outbound/conf to URL: https://mgt1.example.org:443/ > gateway/default/yarn/conf > 2018-05-21 18:22:01,629 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /logs, direction: OUT via implicit rule: > YARNUI/yarn/outbound/logs to URL: https://mgt1.example.org:443/ > gateway/default/yarn/logs > 2018-05-21 18:22:01,629 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /stacks, direction: OUT via implicit rule: > YARNUI/yarn/outbound/stacks to URL: https://mgt1.example.org:443/ > gateway/default/yarn/stacks > 2018-05-21 18:22:01,629 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /jmx?qry=Hadoop:*, direction: OUT via implicit rule: > YARNUI/yarn/outbound/jmx to URL: https://mgt1.example.org:443/ > gateway/default/yarn/jmx?qry=Hadoop%3A* > 2018-05-21 18:22:01,629 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /cluster/errors-and-warnings, direction: OUT via implicit > rule: YARNUI/yarn/outbound/cluster to URL: https://mgt1.example.org:443/ > gateway/default/yarn/cluster/errors-and-warnings > 2018-05-21 18:22:01,629 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: metrics, direction: OUT via implicit rule: > YARNUI/yarn/outbound/metrics to URL: https://mgt1.example.org:443/ > gateway/default/yarn/metrics > 2018-05-21 18:22:01,630 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /cluster/nodes, direction: OUT via implicit rule: > YARNUI/yarn/outbound/cluster to URL: https://mgt1.example.org:443/ > gateway/default/yarn/cluster/nodes > 2018-05-21 18:22:01,630 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /cluster/nodes/decommissioned, direction: OUT via implicit > rule: YARNUI/yarn/outbound/cluster to URL: https://mgt1.example.org:443/ > gateway/default/yarn/cluster/nodes/decommissioned > 2018-05-21 18:22:01,630 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /cluster/nodes/lost, direction: OUT via implicit rule: > YARNUI/yarn/outbound/cluster to URL: https://mgt1.example.org:443/ > gateway/default/yarn/cluster/nodes/lost > 2018-05-21 18:22:01,630 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /cluster/nodes/unhealthy, direction: OUT via implicit rule: > YARNUI/yarn/outbound/cluster to URL: https://mgt1.example.org:443/ > gateway/default/yarn/cluster/nodes/unhealthy > 2018-05-21 18:22:01,631 DEBUG hadoop.gateway > (UrlRewriteProcessor.java:rewrite(164)) > - Rewrote URL: /cluster/nodes/rebooted, direction: OUT via implicit rule: > YARNUI/yarn/outbound/cluster to URL: https://mgt1.example.org:443/ > gateway/default/yarn/cluster/nodes/rebooted > > > > ________________________________ > From: Shawn Weeks <[email protected]> > Sent: Monday, May 21, 2018 6:24:45 PM > To: [email protected] > Subject: Re: Knox Rule Pattern is Matching HTML Tags Beyond the Pattern > > > Hopefully the attachment doesn't get eaten. You can see where it matched a > url filter on metrics. > > > Thanks > > Shawn Weeks > > ________________________________ > From: Sandeep Moré <[email protected]> > Sent: Monday, May 21, 2018 6:19:53 PM > To: [email protected] > Subject: Re: Knox Rule Pattern is Matching HTML Tags Beyond the Pattern > > Can you share Debug logs for this rewrite ? > this might tell us a bit more about what pattern Knox is seeing. This > should not be happening, especially given that this rule is not hooked up > to html content filter. > > > On Mon, May 21, 2018 at 6:48 PM, Shawn Weeks <[email protected]> > wrote: > > > The organization I work for needs Knox to be able to proxy the Yarn UI so > > I've been piecing together the existing patches for this and making > > additional corrections to get it all working. During that I noticed > > something and I'm not sure how to resolve it. Considering the following > > rule. > > > > > > <rule dir="OUT" name="YARNUI/yarn/outbound/metrics" pattern="/metrics"> > > <rewrite template="{$frontend[url]}/yarn/metrics"/> > > </rule> > > > > > > I'd expect this to only rewrite things that started with '/metrics' > > however it's also rewriting things like this '<div > class="metrics"></div>' > > into '<div class="https://knox_host:8433/gateway/default/yarn/metrics"> > </div>'. > > I've taking a cursory look in Jira but I don't see this mentioned as an > > existing bug. > > > > > > Generally I've gotten everything working and am just trying to clean up > > all the css weirdness this introduces. > > > > > > Thanks > > > > Shawn Weeks > > >
