Skip to content

[okta]: Handle invalid values in client.ipAddress#3010

Merged
r00tu53r merged 4 commits intoelastic:mainfrom
r00tu53r:fix/validate-okta-client-ip
Apr 7, 2022
Merged

[okta]: Handle invalid values in client.ipAddress#3010
r00tu53r merged 4 commits intoelastic:mainfrom
r00tu53r:fix/validate-okta-client-ip

Conversation

@r00tu53r
Copy link
Contributor

@r00tu53r r00tu53r commented Apr 6, 2022

What does this PR do?

  • Modifies the ingest pipeline to handle invalid values in client.ipAddress field.
  • Update pipeline and system tests

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.

How to test this PR locally

Pipeline test

elastic-package test pipeline -v

System test

elastic-package test system -v

Related issues

@r00tu53r r00tu53r added bug Something isn't working, use only for issues Team:Security-External Integrations Integration:okta Okta labels Apr 6, 2022
@r00tu53r r00tu53r requested a review from a team as a code owner April 6, 2022 09:22
@r00tu53r r00tu53r self-assigned this Apr 6, 2022
@elasticmachine
Copy link

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

@r00tu53r r00tu53r changed the title Handle invalid values in client.ipAddress [okta]: Handle invalid values in client.ipAddress Apr 6, 2022
Link:
- '<http://{{ hostname }}:{{ env "PORT" }}/api/v1/logs?after=2>; rel="next"'
- '<https://{{ hostname }}:{{ env "PORT" }}/api/v1/logs?after=1>; rel="self"'
body: "[\n { \n \"actor\": {\n \"alternateId\": \"xxxxxx@elastic.co\",\n \"detailEntry\": null,\n \"displayName\": \"xxxxxx\",\n \"id\": \"00u1abvz4pYqdM8ms4x6\",\n \"type\": \"User\"\n },\n \"authenticationContext\": {\n \"authenticationProvider\": null,\n \"authenticationStep\": 0,\n \"credentialProvider\": null,\n \"credentialType\": null,\n \"externalSessionId\": \"102bZDNFfWaQSyEZQuDgWt-uQ\",\n \"interface\": null,\n \"issuer\": null\n },\n \"client\": {\n \"device\": \"Computer\",\n \"geographicalContext\": {\n \"city\": \"Dublin\",\n \"country\": \"United States\",\n \"geolocation\": {\n \"lat\": 37.7201,\n \"lon\": -121.919\n },\n \"postalCode\": \"94568\",\n \"state\": \"California\"\n },\n \"id\": null,\n \"ipAddress\": \"null\",\n \"userAgent\": {\n \"browser\": \"FIREFOX\",\n \"os\": \"Mac OS X\",\n \"rawUserAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:72.0) Gecko/20100101 Firefox/72.0\"\n },\n \"zone\": \"null\"\n },\n \"debugContext\": {\n \"debugData\": {\n \"deviceFingerprint\": \"541daf91d15bef64a7e08c946fd9a9d0\",\n \"requestId\": \"XkcAsWb8WjwDP76xh@1v8wAABp0\",\n \"requestUri\": \"/api/v1/authn\",\n \"threatSuspected\": \"false\",\n \"url\": \"/api/v1/authn?\"\n }\n },\n \"displayMessage\": \"Evaluation of sign-on policy\",\n \"eventType\": \"policy.evaluate_sign_on\",\n \"legacyEventType\": null,\n \"outcome\": {\n \"reason\": \"Sign-on policy evaluation resulted in ALLOW\",\n \"result\": \"ALLOW\"\n },\n \"published\": \"2020-02-14T20:18:57.762Z\",\n \"request\": {\n \"ipChain\": [\n {\n \"geographicalContext\": {\n \"city\": \"Dublin\",\n \"country\": \"United States\",\n \"geolocation\": {\n \"lat\": 37.7201,\n \"lon\": -121.919\n },\n \"postalCode\": \"94568\",\n \"state\": \"California\"\n },\n \"ip\": \"108.255.197.247\",\n \"source\": null,\n \"version\": \"V4\"\n }\n ]\n },\n \"securityContext\": {\n \"asNumber\": null,\n \"asOrg\": null,\n \"domain\": null,\n \"isProxy\": null,\n \"isp\": null\n },\n \"severity\": \"INFO\",\n \"target\": [\n {\n \"alternateId\": \"unknown\",\n \"detailEntry\": {\n \"policyType\": \"OktaSignOn\"\n },\n \"displayName\": \"Default Policy\",\n \"id\": \"00p1abvweGGDW10Ur4x6\",\n \"type\": \"PolicyEntity\"\n },\n {\n \"alternateId\": \"00p1abvweGGDW10Ur4x6\",\n \"detailEntry\": null,\n \"displayName\": \"Default Rule\",\n \"id\": \"0pr1abvwfqGFI4n064x6\",\n \"type\": \"PolicyRule\"\n }\n ],\n \"transaction\": {\n \"detail\": {},\n \"id\": \"XkcAsWb8WjwDP76xh@1v8wAABp0\",\n \"type\": \"WEB\"\n },\n \"uuid\": \"3af594f9-4f67-11ea-abd3-1f5d113f2546\",\n \"version\": \"0\"\n }\n]"
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe this would be better with a quoted block?

body: |
  [
      { ...

"session"
],
"id": "faf7398a-4f77-11ea-97fb-5925e98228bd",
"ingested": "2022-04-06T08:41:54.467956900Z",
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove event.ingested?

@elasticmachine
Copy link

elasticmachine commented Apr 6, 2022

💚 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: 2022-04-07T02:48:04.119+0000

  • Duration: 13 min 45 sec

Test stats 🧪

Test Results
Failed 0
Passed 12
Skipped 0
Total 12

🤖 GitHub comments

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

  • /test : Re-trigger the build.

@r00tu53r r00tu53r requested a review from efd6 April 7, 2022 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working, use only for issues Integration:okta Okta

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[okta] validate okta.client.ip as IP address

3 participants