Add CloudFormation template for Federated Identity (AWS) - #7422
Draft
seanrathier wants to merge 5 commits into
Draft
Add CloudFormation template for Federated Identity (AWS)#7422seanrathier wants to merge 5 commits into
seanrathier wants to merge 5 commits into
Conversation
Introduces federated-identity-aws.yml — a single CFT with one Enable* boolean parameter per AWS integration. CloudFormation Conditions attach only the IAM policies needed for the selected data streams, keeping the role minimal. Transport-layer policies (S3/SQS, CloudWatch Logs, Metrics) are auto-derived so users never need to think about them. Adds the template to publish_cft.sh so it is uploaded to S3 alongside the existing cloud-connectors templates. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
|
This pull request does not have a backport label. Could you fix it @seanrathier? 🙏
|
seanrathier
marked this pull request as draft
July 21, 2026 20:18
…nally Drops the 24 Enable* parameters and all CloudFormation Conditions in favor of a single static read-only role. Every IAM policy needed by the agentless-enabled AWS policy templates is always attached, so Kibana only needs to pass ElasticResourceId in the quick-create URL and users never have to update the stack when they add integrations later. Policies are grouped into four inline policy resources (transport, metrics, security findings, service inventory) plus the GuardDuty managed policy. Trust policy, ExternalId derivation, and outputs are unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Closed
4 tasks
Extends the federated identity role to cover CSPM, Cloud Asset Inventory, and KSPM-EKS: attaches the SecurityAudit managed policy and adds an ElasticSecurityPosture inline policy with the supplemental config, organizations, access-analyzer, account, cross-account sts:AssumeRole, and EKS read permissions declared in the per-package IaC patches of elastic/integrations#20240. CNVM is deliberately excluded: its scan operations (snapshot create/delete, RunInstances/TerminateInstances, iam:PassRole) require write access, and this role stays read-only. CNVM keeps its dedicated template. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Cross-checked every inline action against the provider_permissions declarations in elastic/integrations#19405 (the AWS package's per-datastream permission manifest) and added the missing actions the agentless data streams require at runtime: - ec2:DescribeInstanceStatus (ec2_metrics) - ecs:DescribeClusters (ecs_metrics) - elasticloadbalancing:DescribeTargetHealth (elb_metrics) - lambda:GetFunction (lambda) - rds:DescribeDBClusters (rds) - health:DescribeAffectedEntities (awshealth) - securityhub:BatchGetSecurityControls, GetInsightResults (securityhub_findings_full_posture, securityhub_insights) securityhub:ListInsights, declared by #19405, is NOT added: cfn-lint confirms no such IAM action exists — listing insights is securityhub:GetInsights, which was already granted. Also corrects the Config grant: the aws.config data stream polls rule compliance (DescribeConfigRules, DescribeComplianceByConfigRule, GetComplianceDetailsByConfigRule), not resource inventory; the inventory-style Config reads moved to the SecurityPosturePolicy with the rest of the Asset Inventory permission set. Actions not declared by #19405 are retained when another primary source documents them (e.g. iam:ListAccountAliases in the package README); services whose policy templates are not agentless-enabled (apigateway, natgateway, vpn, emr, kafka, kinesis, redshift, s3_storage_lens) stay out of scope. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
seanrathier
added a commit
to seanrathier/integrations
that referenced
this pull request
Jul 31, 2026
Kibana renders the template via the IaC Provider first and falls back to opening this quick-create URL when the render fails (422/502). Same S3 bucket and URL shape as the aws package's existing URL, but pointing at the incremental federated-identity-aws template, version pinned to the package's Kibana floor minor. The fallback only functions once elastic/cloudbeat#7422 merges and publishes the template to S3. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Draft
3 tasks
Replace the all-at-once grant (five inline policies + SecurityAudit covering every agentless-enabled AWS integration upfront) with an incremental model: the template carries only the permissions of integrations that are actually federated, one block per integration, mirroring the provider_permissions declared in that integration's package manifest in elastic/integrations. Never grant ahead of a declaration. The baseline is GuardDuty only — the single integration federated in production today. Its AmazonGuardDutyReadOnlyAccess grant is carried over verbatim from the shipped cloud-connectors-guardduty template, pre-dating provider_permissions; it converts to a mirrored block when the aws package gains declarations. Per-integration additions land as separate PRs stacked on this one, each paired with the elastic/integrations PR that declares the permissions it mirrors. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 31, 2026
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
closes https://github.com/elastic/ingest-dev/issues/8803
deploy/cloudformation/federated-identity-aws.yml— a single CloudFormation template that creates one read-only IAM role for Elastic Federated Identity (Cloud Connectors) across AWS integrations.provider_permissionsdeclared in that integration's package manifest in elastic/integrations. Grants are never added ahead of a declaration.AmazonGuardDutyReadOnlyAccessgrant is carried over verbatim from the shippedcloud-connectors-guarddutytemplate (it pre-datesprovider_permissions; it converts to a mirrored block when theawspackage gains declarations under elastic/ingest-dev#8800).ElasticResourceId(used to derive the composite ExternalId).scripts/publish_cft.shso it is uploaded tos3://elastic-cspm-cft/ascloudformation-federated-identity-aws-{version}.ymlon release.Background
Part of https://github.com/elastic/ingest-dev/issues/8812
This template supports the Federated Identity auth path for Cloud Connectors. In Kibana's flow it is the fallback: the IaC Provider renders role templates dynamically from
provider_permissionsat onboard time, and Kibana opens this static template's quick-create URL (via the package'siac_template_url) only when that render fails.Two earlier revisions of this PR took different approaches — one
Enable*boolean parameter per integration with CloudFormation Conditions, then a single unconditional grant covering every agentless-enabled AWS integration upfront. Both are superseded by the incremental model: per-integration additions land as separate PRs stacked on this one, each paired with the elastic/integrations PR that declares the permissions it mirrors (first up:aws_securityhub, paired with elastic/integrations#20436).Test plan
cfn-lint deploy/cloudformation/federated-identity-aws.yml(passes in pre-commit, along with therainformatter)RoleArnandExternalId, and that assuming the role with the composite ExternalId succeedspublish_cft.shagainst a test S3 bucket to verify the upload entry works🤖 Generated with Claude Code