elastic / detection-rules

https://www.elastic.co/guide/en/security/current/detection-engine-overview.html
Other
1.92k stars 492 forks source link

[New Rule] Okta Public Client App OAuth Token Request with Client Credentials #4074

Closed terrancedejesus closed 3 weeks ago

terrancedejesus commented 3 weeks ago

…lient credentials

Pull Request

Issue link(s):

Summary - What I changed

Adds a new rule for the first occurrence of an Okta public client app requested an OAuth token with client credentials from an unrecognized source.

Custom applications meant to interact with Okta's API can be registered in the admin console, where Oauth granting types can be specified. In this instance, a custom client application suspiciousApp was created and does not require DPoP, therefore tokens can be obtained by simply providing the client key and secret in any request to /oauth2/default/v1/token endpoint. Adversaries may gain access to these credentials via environment variables or other various discovery methods and then attempt to obtain an access token with unauthorized OAuth scopes.

Potential false-positives: Could occur from devs or testing where the incorrect scope was requested, however, repeat activity would not fire due to the new terms rule focusing on source ip (if someone uses a proxy during dev though, this would fire for sure). If this happens often, we could change the new terms field to the actual client application ID, indicating the first time this application had such as error because of compromised secrets

How To Test

Screenshot 2024-09-11 at 1 08 09 PM

Checklist

Contributor checklist

protectionsmachine commented 3 weeks ago

Rule: New - Guidelines

These guidelines serve as a reminder set of considerations when proposing a new rule.

Documentation and Context

Rule Metadata Checks

New BBR Rules

Testing and Validation

terrancedejesus commented 3 weeks ago

@elastic/trade-admins - Can someone approve please.