[aws] Enable Identity Federation for the CloudWatch policy template - #20525
Closed
seanrathier wants to merge 4 commits into
Closed
[aws] Enable Identity Federation for the CloudWatch policy template#20525seanrathier wants to merge 4 commits into
seanrathier wants to merge 4 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>
Removes the identity_federation hide gate from the aws-cloudwatch and aws/metrics inputs in the cloudwatch policy template, and adds external_id support to both stream templates. This enables role assumption with an External ID when using the Identity Federation credential group for cloudwatch_logs and cloudwatch_metrics. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
|
Changelog link mismatch — expected
Tip If expected, add the |
💔 Build Failed
Failed CI StepsHistory |
Contributor
Author
|
Closing in favour of a single combined PR covering all remaining gated policy templates. |
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.
Summary
hide_in_var_group_options: credential_type: [identity_federation]from theaws-cloudwatchandaws/metricsinputs in thecloudwatchpolicy template, making them visible in the Identity Federation credential groupexternal_id: {{external_id}}tocloudwatch_logs/aws-cloudwatch.yml.hbsandcloudwatch_metrics/stream.yml.hbs, enabling role assumption with an External IDPaired cloudbeat PR: elastic/cloudbeat#7622 (adds
logs:DescribeLogGroups,logs:FilterLogEvents,cloudwatch:ListMetrics,cloudwatch:GetMetricDatato the federated IAM role)Depends on: #20437 (Config), #20439 (Inspector) — carries federation infrastructure from those PRs; hold merge until both predecessors land
E2E test plan
What this run uniquely proves: role assumption with
external_idworks for bothaws-cloudwatchandaws/metricsinput types when using the Identity Federation credential group.cloudformation-federated-identity-aws-9.4.0.yml)logs-aws.cloudwatch_logs-*metrics-aws.cloudwatch_metrics-*DEGRADEDstatus in Fleet for either data stream