[aws] Enable Identity Federation for the Amazon Inspector data stream - #20439
Closed
seanrathier wants to merge 3 commits into
Closed
[aws] Enable Identity Federation for the Amazon Inspector data stream#20439seanrathier wants to merge 3 commits into
seanrathier wants to merge 3 commits into
Conversation
Migrate the Inspector HTTPJSON template from hand-rolled SigV4 signing to the input's auth.aws configuration. The template previously built the Authorization header in Go template expressions — twice, because the body changes between pagination pages — and never set X-Amz-Security-Token, which silently broke temporary credentials. With auth.aws the input signs every request (including re-signed pagination pages) at the transport layer. - Add the full auth.aws block including the use_cloud_connectors hook driven by supports_identity_federation (same pattern as GuardDuty) - Remove the manual X-Amz-Date and Authorization transforms and the pagination re-signing steps - Remove the hide_in_var_group_options gate from the inspector policy template, making Identity Federation selectable on the agentless path - Fixes session-token auth and adds Role ARN / shared-credential support, none of which the hand-rolled signing handled Part of elastic/ingest-dev#8802. The paired cloudbeat PR mirrors the stream's single API call (inspector2:ListFindings) into the static fallback template. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3 tasks
Contributor
✅ Elastic Docs Style Checker (Vale)No issues found on modified lines! The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale. |
Contributor
|
✅ All changelog entries have the correct PR link. |
💚 Build Succeeded
History
|
9 tasks
Contributor
Author
|
Superseded by #20527 which combines config, inspector, and all remaining policy templates into a single PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed commit message
Background
Part of https://github.com/elastic/ingest-dev/issues/8802 — second per-stream PR extending the GuardDuty federation pattern (after #20437 for Config). Split per stream to keep review and e2e validation scoped.
What changed
auth.awsthe input signs every request at the transport layer, pagination included.X-Amz-Security-Token, so temporary credentials (session tokens) were silently broken for Inspector.auth.awshandles them, plus Role ARN and shared credentials — none of which worked before.auth.awsblock added with theuse_cloud_connectorshook driven bysupports_identity_federation— same pattern as the GuardDuty HTTPJSON stream from [aws] Add var_groups for credential type selection with Identity Federation #19828.hide_in_var_group_optionsdropped from theinspectorpolicy template.format_versionchange (stays 3.6.1). Version is 7.3.0 assuming [aws] Enable Identity Federation for the Config data stream #20437 (7.2.0) merges first; whichever merges second re-numbers trivially.IAM permissions (for the paired cloudbeat PR)
The template calls exactly one operation:
POST /findings/list(Inspector2ListFindings)inspector2:ListFindingsNote: the permission patch sets in #20240 also list
inspector2:ListCoverage— the template never calls it, so the CFT mirror omits it (least privilege).Testing
elastic-package lint/buildpassauth.awspathE2E test plan
The critical thing this run proves: the input's
auth.awssigner correctly signs the pagination flow against real AWS — each page's body differs, so every page needs a fresh signature (this is exactly what the hand-rolled version got wrong-adjacent and re-implemented manually).1. AWS-side prerequisites (test account):
2. Generate findings:
3. Latency: initial scans typically complete within 15 minutes to 1 hour of activation; budget 1h before concluding failure.
4. Onboard in Kibana (agentless + Identity Federation):
logs-aws.inspector-<namespace>with populatedaws.inspectorfields (severity, status)5. Failure probes:
AccessDeniedExceptiononPOST /findings/list— check the paired cloudbeat PR's policy"findings": []— means no scans have produced findings yet (see step 2)Also validate the legacy paths (this PR touches shared request code): a default-mode policy with static access keys, and one with temporary credentials (session token) — the latter never worked before this PR, so it doubles as the bug-fix check.
Checklist
changelog.ymlfile.🤖 Generated with Claude Code