Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Filebeat][Okta] Parse additonal debug data risk field for Okta module #30961

Closed
ynirk opened this issue Mar 22, 2022 · 7 comments · Fixed by #31676
Closed

[Filebeat][Okta] Parse additonal debug data risk field for Okta module #30961

ynirk opened this issue Mar 22, 2022 · 7 comments · Fixed by #31676
Assignees

Comments

@ynirk
Copy link

ynirk commented Mar 22, 2022

Describe the enhancement:

This request is similar to #25689

Okta enrich their system log events with a risk score ref in debugContext.debugData.risk but it's not parsed by filebeat and it would be valuable.

Exemple of values extracted from event.original:

"risk":"{reasons=Suspicious rate of requests, level=HIGH}"
"risk":"{level=HIGH}"

In addition to parse debugContext.debugData.risk field, other information might be valuable in debugData and it could be a flattened field

Describe a specific use case for the enhancement or feature:

A security analyst would need the risk score parsed in order to build a detection from it.

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Mar 22, 2022
@elasticmachine
Copy link
Collaborator

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

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Mar 23, 2022
@efd6 efd6 self-assigned this May 9, 2022
@efd6
Copy link
Contributor

efd6 commented May 9, 2022

@ynirk Are you able to provide a few redacted example log lines from event.original to include in tests?

Also, to follow up "other information might be valuable in debugData and it could be a flattened field", would you like to see a okta.debug_context.debug_data.flattened field?

@ynirk
Copy link
Author

ynirk commented May 11, 2022

We've made additional tests on this data and it's a bit more messy than expected:
Interesting data can be put in a separate field depending on the configuration: If you don't configure rules to specifically evaluate the risk level of sign-in requests, the results of the risk and behavior evaluation are added to the DebugContext in the System Log in a separate LogOnlySecurityData field ref

This is what we've done in our tests:

  • create a flattened field from okta.debug_context.debug_data
  • apply the ingest json processor on logOnlySecurityData

So if possible we'd like to have

  • okta.debug_context.debug_data.flattened field
  • with logOnlySecurityData parsed as json in it
  • a separate okta.debug_context.debug_data.risk.level field based either on debugContext.debugData.risk.level or debugContext.debugData.logOnlySecurityData.risk.level (depending which one is present)

Does it make sense? Do you need more information or context ?
Here are 2 redacted event.original (one with logOnlySecurityData and one without it)

okta_risk.txt

@efd6
Copy link
Contributor

efd6 commented May 17, 2022

Thanks. I'll see how far I get and may get back to you with more questions.

@efd6
Copy link
Contributor

efd6 commented May 17, 2022

@ynirk I've made a sketch of this for the okta integration first (elastic/integrations#3362), since it's easier to work there. Would you take a look to confirm that it is what you were looking for, once that's done, I'll port over to filebeat.

Note that instead of making ...risk.level, I have pulled back one level and made that ...risk_level.

@ynirk
Copy link
Author

ynirk commented May 18, 2022

@efd6 I made some comments there. I did not realize Okta format is also not consistent depending on risk field location - it's a bit painfull

@efd6
Copy link
Contributor

efd6 commented May 18, 2022

I did not realize Okta format is also not consistent depending on risk field location - it's a bit painfull

Yes, that's why I pulled it out into okta.debug_context.debug_data.risk_level as a consistent format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants