Skip to content

[Draft] x-pack/filebeat/input/{cel,httpjson}: fix handling of ADC metadata server credentials#44351

Closed
navnit-elastic wants to merge 2 commits intoelastic:mainfrom
navnit-elastic:44349-cel_httpjson
Closed

[Draft] x-pack/filebeat/input/{cel,httpjson}: fix handling of ADC metadata server credentials#44351
navnit-elastic wants to merge 2 commits intoelastic:mainfrom
navnit-elastic:44349-cel_httpjson

Conversation

@navnit-elastic
Copy link
Contributor

@navnit-elastic navnit-elastic commented May 16, 2025

Proposed commit message

x-pack/filebeat/input/{cel,httpjson}: fix handling of ADC (Application Default Credentials) 
metadata server credentials

HTTPJSON and CEL input do not handle ADC metadata server credentials correctly.
Currently they expects a JSON key in ADC which is not present when Filebeat is running
on Google Cloud Platform, as described in Google's SDK[1].

[1] https://pkg.go.dev/golang.org/x/oauth2/google#Credentials

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Disruptive User Impact

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

@navnit-elastic navnit-elastic self-assigned this May 16, 2025
@navnit-elastic navnit-elastic added Filebeat Filebeat bugfix Team:Security-Service Integrations Security Service Integrations Team labels May 16, 2025
@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels May 16, 2025
@github-actions
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@mergify
Copy link
Contributor

mergify bot commented May 16, 2025

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @navnit-elastic? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.
@navnit-elastic navnit-elastic added the backport-8.x Automated backport to the 8.x branch with mergify label May 20, 2025
@ShourieG
Copy link
Contributor

@navnit-elastic, we should always split PR's for different inputs even if the change is relatively similar. We can cross reference the PR's but we should not club together.

return nil, fmt.Errorf("oauth2 client: error loading credentials: %w", err)
var creds *google.Credentials
var err error
if o.GoogleCredentialsJSON != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

We also need to check for empty string here. If it's empty then move to ADC flow

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it

@mergify
Copy link
Contributor

mergify bot commented May 20, 2025

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b 44349-cel_httpjson upstream/44349-cel_httpjson
git merge upstream/main
git push upstream 44349-cel_httpjson
@navnit-elastic
Copy link
Contributor Author

@navnit-elastic, we should always split PR's for different inputs even if the change is relatively similar. We can cross reference the PR's but we should not club together.

Agreed, I'll split this into two PRs.

@navnit-elastic
Copy link
Contributor Author

navnit-elastic commented Jun 3, 2025

Both PRs for CEL and HTTPJSON have been merged, so I am closing this PR.
HTTPJSON: #44436
CEL: #44571

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-8.x Automated backport to the 8.x branch with mergify bugfix Filebeat Filebeat Team:Security-Service Integrations Security Service Integrations Team

2 participants