Uploaded image for project: 'OpenAM Agents'
  1. OpenAM Agents
  2. AMAGENTS-690

Invalid URL Regular Expression not working

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 5.0.0.0
    • Fix Version/s: None
    • Component/s: Web Agents
    • Labels:
    • Environment:
      Apache 2.4 on debian + latest webagent snapshot (in docker)

      Description

      The property com.forgerock.agents.agent.invalid.url.regex is not working (is being ignored) in web agents 5.
      See docs:
      https://backstage.forgerock.com/docs/openam-web-policy-agents/4.1/web-pa-guide#configure-web-policy-agent

      The following tests are failing because of it:

      TestAgentResourceAccess.invalidUrlRegex ( "*", 403 )
      TestAgentResourceAccess.invalidUrlRegex ( "~", 403 )
      

      A regexp for invalid requests is being setup - see OpenAm->Application->Agents->webagent->Application->Advanced->Custom Properties (screenshot attached). Anything matching this invalid regexp should return 403, but we get either the resource or a 404 if the resource does not exit.

      In the tests, the invalid regexp is "=^((?!(|\\\*)).)$", but trying to match either "" or "" gets ignored (can be reproduced manually).

      Steps to reproduce

      1. Add an invalid url regexp going to the agent in openam ( OpenAm->Application->Agents->webagent->Application->Advanced->Custom Properties ) and add something like:

      com.forgerock.agents.agent.invalid.url.regex=^((?!(~|\*)).)*$
      

      2. Try to access something that should match that regexp, for example:
      http://<agent_domain>:<agent_port>/index.html*

      3. Verify that, even though adding the "*" at the end should make it match the invalid URL expression, a 404 comes back instead of a 403.

        Attachments

          Activity

            People

            Assignee:
            rich.riley Rich Riley [X] (Inactive)
            Reporter:
            pilar.gomez Pilar Gomez [X] (Inactive)
            QA Assignee:
            Richard Hruza Richard Hruza
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: