Skip to content

Conversation

@chrisberkhout
Copy link
Contributor

@chrisberkhout chrisberkhout commented Jun 12, 2023

What does this PR do?

Fixes the ForgeRock integration's IDM Activity revision field to be keyword rather than integer type, and asserts a hit_count in the corresponding system test. The wrong field type was causing events to be dropped.

I also updated the example values used for the revision field to match the current format shown in ForgeRock's documentation.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.

Related issues

@chrisberkhout chrisberkhout requested a review from a team as a code owner June 12, 2023 15:10
@elasticmachine
Copy link

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@elasticmachine
Copy link

elasticmachine commented Jun 12, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-06-12T15:12:39.774+0000

  • Duration: 20 min 59 sec

Test stats 🧪

Test Results
Failed 0
Passed 56
Skipped 0
Total 56

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@elasticmachine
Copy link

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (11/11) 💚
Files 100.0% (11/11) 💚 6.25
Classes 100.0% (11/11) 💚 6.25
Methods 100.0% (101/101) 💚 14.079
Lines 96.489% (962/997) 👍 10.564
Conditionals 100.0% (0/0) 💚
@@ -1,6 +1,6 @@
{"payload":{"_id":"a9a32d9e-7029-45e6-b581-eafb5d502273-259113","changedFields":[],"eventName":"activity","level":"INFO","message":"","objectId":"internal/role/8713dd4e-3f4a-480d-9172-3a70a2dea73f","operation":"PATCH","passwordChanged":false,"revision":"6e415003-2c2e-46a1-9546-8eaa4e5f68d8-2451","runAs":"d7cd65bf-743c-4753-a78f-a20daae7e3bf","source":"audit","status":"SUCCESS","timestamp":"2022-11-01T17:55:08.523Z","topic":"activity","transactionId":"1667325297350-5f3959fa550528a7ef3d-23359/0","userId":"d7cd65bf-743c-4753-a78f-a20daae7e3bf"},"timestamp":"2022-11-01T17:55:08.527382286Z","type":"application/json","source":"idm-activity"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the original value was a UUIDv4, but now it's an integer as a string. Did we get the value of this wrong initially?

@kgeller, any thoughts on this (since you originally wrote this)?

Copy link
Contributor

@kgeller kgeller Jun 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I built this all off of a live test environment that they granted us access to. I just verified again with the API and data from last week still shows that field as a UUID4.

response body
{ "result": [ { "payload": { "_id": "16ec1ce4-f3a6-4517-b28f-24b2430fa113-83532", "after": { "_id": "c544037c-307c-4a5c-bf2b-9019f201b3b0", "_rev": "032ed9ed-6ede-4e3e-aeed-01e77f95d457-2114", "createDate": "2023-06-07T21:25:12.485378Z", "lastChanged": { "date": "2023-06-07T21:25:12.485447Z" }, "loginCount": 2 }, "before": { "_id": "c544037c-307c-4a5c-bf2b-9019f201b3b0", "_rev": "d91720e2-5b0e-4d55-a23b-c3dae4aa1a80-4964", "createDate": "2023-06-07T21:25:12.485378Z", "lastChanged": { "date": "2023-06-07T21:25:12.485447Z" }, "loginCount": 1 }, "changedFields": [], "eventName": "activity", "level": "INFO", "message": "", "objectId": "managed/alpha_usermeta/c544037c-307c-4a5c-bf2b-9019f201b3b0", "operation": "PATCH", "passwordChanged": false, "revision": "032ed9ed-6ede-4e3e-aeed-01e77f95d457-2114", "runAs": "idm-provisioning", "source": "audit", "status": "SUCCESS", "timestamp": "2023-06-08T17:32:25.620Z", "topic": "activity", "transactionId": "1686245545450-c3fb58dad88412fcb665-17563/0/0", "userId": "idm-provisioning" }, "timestamp": "2023-06-08T17:32:25.624676218Z", "type": "application/json", "source": "idm-activity" } ], "resultCount": 1, "pagedResultsCookie": null, "totalPagedResultsPolicy": "NONE", "totalPagedResults": -1, "remainingPagedResults": -1 } 
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for checking. It's interesting that the live test environment doesn't match their documentation.

The UUID-like values do look like UUIDv4 but with an additional integer component appended.

I don't have a strong opinion about whether we should match the test environment (UUIDv4+integer string) or the documentation (32-bit hex string), but I do think we should index it as a keyword field rather than trying to decode.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed!

@chrisberkhout chrisberkhout merged commit e9cfea7 into main Jun 14, 2023
@chrisberkhout chrisberkhout deleted the forgerock-idm-activity-revision-fix branch June 14, 2023 14:28
@elasticmachine
Copy link

Package forgerock - 1.3.1 containing this change is available at https://epr.elastic.co/search?package=forgerock

sodhikirti07 pushed a commit that referenced this pull request Jun 15, 2023
* Fix forgerock IDM Activity revision field format.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes a bug issue Integration:forgerock ForgeRock

5 participants