Uploaded image for project: 'OpenAM'
  1. OpenAM
  2. OPENAM-12321

DeviceID showing extra info incorrectly in audit logs

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.5.1
    • Fix Version/s: 6.0.0, 5.5.2
    • Component/s: audit logging
    • Labels:
    • Sprint:
      Yew - Team Tesla 2018.18
    • Needs backport:
      Yes
    • Needs QA verification:
      No
    • Functional tests:
      Yes
    • Are the reproduction steps defined?:
      Yes and I used the same an in the description

      Description

      Bug description

      The audit logs were not being generated properly. It has been fixed as part of the work done for auth trees audit logs ( AME-15025 - not merged at the time of opening this bug, but close to go on PR).

      How to reproduce the issue

      Setup a chain with DeviceId and check the logs

      Expected behaviour

      DeviceId json entry is generated properly

      Current behaviour

      The json object is being parsed in an incorrect way (we can see things like object, pointer, isNotNull... See output bellow)

            "deviceId": {
                "object": {
                  "screen": {
                    "screenWidth": 1920,
                    "screenHeight": 1200,
                    "screenColourDepth": 24
                  },
                  "timezone": {},
                  "plugins": {
                    "installedPlugins": "internal-nacl-plugin;widevinecdmadapter.plugin;"
                  },
                  "fonts": {
                    "installedFonts": "cursive;monospace;serif;sans-serif;fantasy;default;Arial;Arial Black;Arial Narrow;Arial Rounded MT Bold;Comic Sans MS;Courier;Courier New;Georgia;Impact;Papyrus;Tahoma;Times;Times New Roman;Trebuchet MS;Verdana;"
                  },
                  "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36",
                  "appName": "Netscape",
                  "appCodeName": "Mozilla",
                  "appVersion": "5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36",
                  "platform": "MacIntel",
                  "product": "Gecko",
                  "productSub": "20030107",
                  "vendor": "Google Inc.",
                  "language": "en-GB",
                  "geolocation": {}
                },
                "pointer": {
                  "empty": true,
                  "value": "/"
                },
                "null": false,
                "string": false,
                "map": true,
                "number": false,
                "boolean": false,
                "collection": false,
                "notNull": true,
                "list": false
              }
      

      Work around

      Code analysis

      Fixed in AuthenticationAuditEntry.java . We needed to unwrap the json using .toObject() for it to be parsed correctly, as shown bellow

      org.forgerock.$className.java
          public void addInfoAsJson(EntriesInfoFieldKey key, String value) {
              this.entryInfo.put(key.toString(), asJson(value).getObject());
          }
      
          /**
           * Add an info value as JSON.
           *
           * @param key The info entry key.
           * @param jsonValue The value of the info entry as Json.
           */
          public void addInfoAsJson(EntriesInfoFieldKey key, JsonValue jsonValue) {
              this.entryInfo.put(key.toString(), jsonValue.getObject());
          }
      

        Attachments

          Activity

            People

            • Assignee:
              pilar.gomez Pilar Gomez [X] (Inactive)
              Reporter:
              pilar.gomez Pilar Gomez [X] (Inactive)
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: