-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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] Add OAuth support to the httpjson input #18415
Comments
Pinging @elastic/siem (Team:SIEM) |
To start with, implementing the client credentials flow seems to be a nice choice, since it is the one allowing server-to-server authorization with no client intervention. For this the config needs to be extended with something like: filebeat.inputs:
- type: httpjson
interval: 10s
oauth2:
token_url: http://localhost:8282/access/token/request
client_id: dummy-client-id
client_secret: dummy-client-secret
url: http://localhost:8282/foobar There are some providers, that we might want to handle but do not offer support for this flow, like Gsuite, which instead of the - type: httpjson
interval: 10s
oauth2:
google:
credentials_file: /path/to/file
url: http://localhost:8282/foobar or - type: httpjson
interval: 10s
oauth2:
provider: google
credentials_file: /path/to/file
url: http://localhost:8282/foobar And do different checks based on the provider. An example of how google auth works with the credentials file can be found in the googlepubsub input Other specific provider we might want to support is AzureAD, for example. Also allowing for an optional filebeat.inputs:
- type: httpjson
interval: 10s
oauth2:
token_url: http://localhost:8282/access/token/request
client_id: dummy-client-id
client_secret: dummy-client-secret
scopes:
- scope1
- scope2
url: http://localhost:8282/foobar Is there any other consideration you think might be good for the initial implementation? cc @P1llus |
I think this sounds nice, I think the second choice looked the best personally:
If we are planning to use the provider list from the oauth2 lib (don't know if this is updated?), then we might be able to add the tokenURL for the user and all they would need is minimum provider, client-id, secret and URL. From what we saw, when authentication as an app towards AzureAD we could not define scope, as it was defined when generating the ID and secret. Maybe scope should be optional and if tokenurl is not set we should try to retrieve based on provider? |
That is a good point, there are many providers that seem not super relevant for our use case though. Maybe doing a specific list of the ones supported would be good enough? I can think of
That sounds good 👍 |
* Filebeat HTTPJSON input initial changes to support oauth2 client_credentials * [Filebeat][httpjson] Add EndpointParams option to oauth config * Add provider specific settings to oauth httpjson * Change config as suggested and add config tests * Add checks for invalid json in google validation * Add documentation and azure.resource * Add oauth2 test and update changelog * Address docs and change new test case into table tests * Check if oauth2 is enabled in config.Validate and add test Closes #18415
…18892) * Filebeat HTTPJSON input initial changes to support oauth2 client_credentials * [Filebeat][httpjson] Add EndpointParams option to oauth config * Add provider specific settings to oauth httpjson * Change config as suggested and add config tests * Add checks for invalid json in google validation * Add documentation and azure.resource * Add oauth2 test and update changelog * Address docs and change new test case into table tests * Check if oauth2 is enabled in config.Validate and add test Closes elastic#18415 (cherry picked from commit b6cd17c)
…19122) * Filebeat HTTPJSON input initial changes to support oauth2 client_credentials * [Filebeat][httpjson] Add EndpointParams option to oauth config * Add provider specific settings to oauth httpjson * Change config as suggested and add config tests * Add checks for invalid json in google validation * Add documentation and azure.resource * Add oauth2 test and update changelog * Address docs and change new test case into table tests * Check if oauth2 is enabled in config.Validate and add test Closes #18415 (cherry picked from commit b6cd17c)
…18892) * Filebeat HTTPJSON input initial changes to support oauth2 client_credentials * [Filebeat][httpjson] Add EndpointParams option to oauth config * Add provider specific settings to oauth httpjson * Change config as suggested and add config tests * Add checks for invalid json in google validation * Add documentation and azure.resource * Add oauth2 test and update changelog * Address docs and change new test case into table tests * Check if oauth2 is enabled in config.Validate and add test Closes elastic#18415
As user of the Filebeat httpjson input, I would like to be able to pull data from a REST API that requires authentication via OAuth.
An example would be collecting logs from GSuite. For that an OAuth token is required.
The text was updated successfully, but these errors were encountered: