[ https://issues.apache.org/jira/browse/KNOX-2898?focusedWorklogId=864677&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-864677 ]
ASF GitHub Bot logged work on KNOX-2898: ---------------------------------------- Author: ASF GitHub Bot Created on: 09/Jun/23 11:43 Start Date: 09/Jun/23 11:43 Worklog Time Spent: 10m Work Description: moresandeep commented on PR #756: URL: https://github.com/apache/knox/pull/756#issuecomment-1584443781 > @moresandeep If you omit the `hadoop-jwt` completely you can still bypass the authentication, I thought that was the goal to bypass the autnetication. However if your token expires you'll be redirected to the login page when accessing an unauthenticated path, such as /favicon. > > In other filters such as `HadoopAuthFilter` we check the unauthenticated path first and do an early return if the path is there. I see, that makes sense. Thanks ! Issue Time Tracking ------------------- Worklog Id: (was: 864677) Remaining Estimate: 0h Time Spent: 10m > Reconsider the usage of sso.unauthenticated.path.list > ----------------------------------------------------- > > Key: KNOX-2898 > URL: https://issues.apache.org/jira/browse/KNOX-2898 > Project: Apache Knox > Issue Type: Task > Reporter: Attila Magyar > Assignee: Attila Magyar > Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > We have a property for URLs which are bypassed by the authentication. E.g.: > /favicon.ico can be accessed through knox without authentication. > <param> > <name>sso.unauthenticated.path.list</name> > <value>/favicon.ico;test;unsafepath</value> > </param> > This works and gives HTTP 200 with the content of the icon. > $ curl -kv https://localhost:8443/gateway/cdp-proxy/favicon.ico > However if a hadoop-jwt is specificed but it is invalid (either it's expired > or malformed) > $ curl --cookie "hadoop-jwt=invalid" -kv > https://c3235-node4.coelab.cloudera.com:8443/gateway/cdp-proxy/favicon.ico > Then the user is going to be redirected with the login page, because the > unauthenticated path list is only checked there are no sso cookies. > if (ssoCookies.isEmpty()) { // <= we're checking only ssoCookies is empty > /* check for unauthenticated paths to bypass */ > if (requestHasUnauthenticatedPath(request)) { > /* This path is configured as an unauthenticated path let the request > through */ > final Subject sub = new Subject(); > sub.getPrincipals().add(new PrimaryPrincipal("anonymous")); > LOGGER.unauthenticatedPathBypass(req.getRequestURI(), > unAuthenticatedPaths.toString()); > continueWithEstablishedSecurityContext(sub, req, res, chain); > } > We might need to move this check out do it regardless if there are sso > cookies or not. -- This message was sent by Atlassian Jira (v8.20.10#820010)