Uploaded image for project: 'Apache Knox'
  1. Apache Knox
  2. KNOX-1577

Knox automatically derived dispatch whitelist doesn't seem to actually match the knox domain

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.1.0
    • 1.2.0
    • Server
    • None

    Description

      When the dispatch whitelist is not explicitly configured, Knox attempts to derive this whitelist based on the domain of the knox host. We can see this in the logs as follows:

      2018-11-08 20:57:34,173 INFO knox.gateway (WhitelistUtils.java:getDispatchWhitelist(63)) - Applying a derived dispatch whitelist because none is configured in gateway-site: ^/.*$;^https?://(.+\.honeypot\.hortonworks\.site):[0-9]+/?.*$
      

      However, login via knox sso with this configuration is not possible. Upon closer inspection (with a regex editor) we see there are 4 unescaped forward slashes which cause the knox hostname (or hostname of another host on the same domain as knox) to not match the auto-configured whitelist.

      (Thanks Vipin Rathor helping find this)

      Escaping the forward slashes and explicitly configuring the whitelist with following example values seems to solve the problem, and allow login via knox sso.

       <param>
       <name>knoxsso.redirect.whitelist.regex</name>
       <value>^https?:\/\/(.*\.honeypot\.hortonworks\.site|localhost|127\.0\.0\.1|0:0:0:0:0:0:0:1|::1):[0-9].*$</value>
       </param>
      

      If escaping the / as I did above is the correct workaround for this solution, should we configure the automatically derived whitelists to do this also?

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            pzampino Philip Zampino
            thekat Kat Petre
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment