-
Notifications
You must be signed in to change notification settings - Fork 5k
Add file-based authentication support for CEL and HTTP JSON inputs #47507
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
base: main
Are you sure you want to change the base?
Conversation
🤖 GitHub commentsJust comment with:
|
|
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
🔍 Preview links for changed docs |
|
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
…sed auth provider
colleenmcginnis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Starting with v9.0, there is no longer a new documentation set published with every minor release. Instead, the same page stays valid over time and shows version-related evolutions. You can read more in Write cumulative documentation.
Based on the lack of backport labels, I'm assuming you're targeting 9.3.0 for this change, but feel free to adjust my suggestion if my assumption is incorrect!
|
|
||
| * Basic | ||
| * Digest | ||
| * File |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * File | |
| * {applies_to}`stack: ga 9.3.0` File |
| * Basic Authentication | ||
| * Digest Authentication {applies_to}`stack: ga 8.12.0` | ||
| * OAuth2 | ||
| * file-based headers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * file-based headers | |
| * file-based headers {applies_to}`stack: ga 9.3.0` |
| When set to `true`, Digest Authentication challenges are not reused. | ||
|
|
||
|
|
||
| ### `auth.file.enabled` [_auth_file_enabled] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ### `auth.file.enabled` [_auth_file_enabled] | |
| ### `auth.file.enabled` [_auth_file_enabled] | |
| ```{applies_to} | |
| stack: ga 9.3.0 | |
| ``` |
| :::: | ||
|
|
||
|
|
||
| ### `auth.file.path` [_auth_file_path] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ### `auth.file.path` [_auth_file_path] | |
| ### `auth.file.path` [_auth_file_path] | |
| ```{applies_to} | |
| stack: ga 9.3.0 | |
| ``` |
| The path to the file containing the authentication value. The file contents are trimmed before use. This field is required when file auth is enabled. | ||
|
|
||
|
|
||
| ### `auth.file.header` [_auth_file_header] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ### `auth.file.header` [_auth_file_header] | |
| ### `auth.file.header` [_auth_file_header] | |
| ```{applies_to} | |
| stack: ga 9.3.0 | |
| ``` |
| The password to use. | ||
|
|
||
|
|
||
| ### `auth.file.enabled` [_auth_file_enabled_2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ### `auth.file.enabled` [_auth_file_enabled_2] | |
| ### `auth.file.enabled` [_auth_file_enabled_2] | |
| ```{applies_to} | |
| stack: ga 9.3.0 | |
| ``` |
| :::: | ||
|
|
||
|
|
||
| ### `auth.file.path` [_auth_file_path_2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ### `auth.file.path` [_auth_file_path_2] | |
| ### `auth.file.path` [_auth_file_path_2] | |
| ```{applies_to} | |
| stack: ga 9.3.0 | |
| ``` |
| The path to the file that contains the authentication value. The file contents are trimmed before use. This field is required when file auth is enabled. | ||
|
|
||
|
|
||
| ### `auth.file.header` [_auth_file_header_2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ### `auth.file.header` [_auth_file_header_2] | |
| ### `auth.file.header` [_auth_file_header_2] | |
| ```{applies_to} | |
| stack: ga 9.3.0 | |
| ``` |
| The request header that receives the value loaded from `path`. Defaults to `Authorization` when omitted or empty. | ||
|
|
||
|
|
||
| ### `auth.file.prefix` [_auth_file_prefix_2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ### `auth.file.prefix` [_auth_file_prefix_2] | |
| ### `auth.file.prefix` [_auth_file_prefix_2] | |
| ```{applies_to} | |
| stack: ga 9.3.0 | |
| ``` |
| An optional prefix that is prepended to the trimmed value from `path` before it is sent on the request header. This is commonly used for tokens that require a leading value such as `Bearer `. | ||
|
|
||
|
|
||
| ### `auth.file.refresh_interval` [_auth_file_refresh_interval_2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ### `auth.file.refresh_interval` [_auth_file_refresh_interval_2] | |
| ### `auth.file.refresh_interval` [_auth_file_refresh_interval_2] | |
| ```{applies_to} | |
| stack: ga 9.3.0 | |
| ``` |
I'll defer to the maintaners on which release this should go into, as I'm not sure what the policy is on adding minor new functionality. From my perspective, I'd like it as soon as possible and 9.3.0 still looks to be quite far out 😁. I've submitted 21356c6 to fix the linting errors that were newly introduced by this code, the rest of the errors appear to be pre-existing issues. |
Proposed commit message
feat(filebeat): add file auth support for CEL and HTTP JSON inputs
Note
The code is mostly duplicated between httpjson and CELinputs. I considered putting it in a shared location that each could reference, but I didn't see a clear pattern on how to do that. As it isn't much code I've implemented it in each input at the moment.
Checklist
stresstest.shscript to run them under stress conditions and race detector to verify their stability../changelog/fragmentsusing the changelog tool.Disruptive User Impact
None. Existing configurations continue to work; the new file auth mechanism is opt-in.
Author's Checklist
How to test this PR locally
/etc/elastic/gh_token_test) containing an invalid secretRelated issues
Use cases
Filebeat reads short-lived (JWT, OAuth, etc.) tokens projected to disk by an external secret manager and refreshes them without restarting the input.
Note
GitHub Copilot was used to generate some code for this PR.