Skip to content

[aws] Add var_groups for credential type selection with Identity Federation - #19828

Merged
seanrathier merged 3 commits into
elastic:mainfrom
andrewkroh:aws/feat/var-groups-cloud-connector
Jul 16, 2026
Merged

[aws] Add var_groups for credential type selection with Identity Federation#19828
seanrathier merged 3 commits into
elastic:mainfrom
andrewkroh:aws/feat/var-groups-cloud-connector

Conversation

@andrewkroh

@andrewkroh andrewkroh commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Proposed commit message

[aws] Add var_groups for credential type selection with Identity Federation

Bump format_version to 3.6.1 and version to 7.0.0. Reorganize AWS
credential configuration into a `Setup Access` var_groups selector with
six options: Identity Federation, Direct Access Keys, Temporary Access
Keys, Assume Role, Assume Role with External ID, and Shared Credentials.

Key changes:
- format_version: 3.4.0 → 3.6.1
- version: 6.20.3 → 7.0.0
- kibana.version: "^8.19.4 || ^9.2.1" → "^9.4.0"
- agent.version: "^9.4.0"
- var_groups: credential_type selector with 6 options
- external_id is now secret: true
- New vars: assume_role_duration, assume_role_expiry_window,
  supports_cloud_connectors
- hide_in_var_group_options for 13 inputs across services that don't
  support Identity Federation
- GuardDuty httpjson stream: switch to auth.aws: block and add Identity
  Federation policy tests
- Add conditions.agent.version: ^9.4.0 because guardduty now requires
  it.

Source: elastic/integrations#19278 (Omolola-Akinleye/integrations)

Summary

This PR carries the var_groups / Identity Federation work from #19278 forward on top of the processor-tags pre-landing from #19824.

What changed

  • Bump format_version from 3.4.0 to 3.6.1 and package version from 6.20.3 to 7.0.0.
  • Require Kibana and Elastic Agent ^9.4.0 for the var_groups UI feature and auth.aws runtime support.
  • Add a credential_type var_groups selector with Identity Federation, Direct Access Keys, Temporary Access Keys, Assume Role, Assume Role with External ID, and Shared Credentials options.
  • Add assume_role_duration, assume_role_expiry_window, and supports_cloud_connectors variables.
  • Mark external_id as secret.
  • Hide the Identity Federation option for inputs where that path has not yet been validated.
  • Switch the GuardDuty httpjson stream from manual SigV4 HMAC signing to the native auth.aws block.
  • Add GuardDuty Identity Federation and legacy credential policy test fixtures.
  • Align Transit Gateway policy template categories with its metrics data stream.

Related

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.
@github-actions

Copy link
Copy Markdown
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.

@elastic-vault-github-plugin-prod

elastic-vault-github-plugin-prod Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@andrewkroh
andrewkroh force-pushed the aws/feat/var-groups-cloud-connector branch from 8863ece to c616bd9 Compare July 1, 2026 11:58
@github-actions

This comment has been minimized.

@andrewkroh
andrewkroh force-pushed the aws/feat/var-groups-cloud-connector branch from c616bd9 to feb0a03 Compare July 1, 2026 12:18
@github-actions

This comment has been minimized.

@andrewkroh
andrewkroh force-pushed the aws/feat/var-groups-cloud-connector branch 2 times, most recently from 51f64b7 to 9dea76e Compare July 1, 2026 12:39
@andrewkroh andrewkroh changed the title [aws] Add var_groups for credential type selection with Cloud Connector support Jul 1, 2026
@github-actions

This comment has been minimized.

@andrewkroh
andrewkroh force-pushed the aws/feat/var-groups-cloud-connector branch 2 times, most recently from 7aa1477 to 7710222 Compare July 1, 2026 16:49
@andrewkroh

andrewkroh commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

The PR's aws.config script test is failing because of the policy ID matching issues caused by the conditions.agent.version. Fix for this is in elastic/elastic-package#3729.

@andrewkroh
andrewkroh force-pushed the aws/feat/var-groups-cloud-connector branch from 7710222 to 8f9dffa Compare July 2, 2026 00:05
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

TL;DR

Check integrations aws is failing on the AWS package script-test path because the package now sets conditions.agent.version: ^9.4.0, which exposes an elastic-package Fleet policy ID matching bug. This looks like a tooling/dependency issue, not an AWS integration code bug; the fix is in elastic/elastic-package#3729.

Remediation

Investigation details

Root Cause

This PR introduces an Elastic Agent version condition in packages/aws/manifest.yml:20-27:

20: conditions:
23:   kibana:
24:     version: "^9.4.0"
25:   # auth.aws support in CEL and HTTPJSON inputs requires Elastic Agent 9.4.0+.
26:   agent:
27:     version: "^9.4.0"

With that condition present, Fleet can report a version-suffixed agent policy ID such as <policy-id>#9.5. The current elastic-package policy-assignment wait logic compares the IDs for exact equality, so it can time out even when the intended policy was assigned.

The upstream fix changes internal/kibana/agents.go from exact matching to accepting policyID + "#..." suffixes:

if assignedPolicyIDMatches(agent.PolicyID, p.ID) && agent.PolicyRevision >= p.Revision
...
return agentPolicyID == policyID || strings.HasPrefix(agentPolicyID, policyID+"#")

The PR head also points at this same failure mode in packages/aws/data_stream/config/_dev/test/scripts/missing_credentials.txt:4:

skip 'conditions.agent.version breaks this test. https://github.com/elastic/elastic-package/pull/3729'

Evidence

--- [aws] failed
Error: The command exited with status 1
user command error: exit status 1

The pre-fetched Buildkite log starts at stack teardown/artifact upload, so it does not include the earlier script-test timeout text. The root-cause trace above is based on the PR-head AWS files, the linked elastic-package fix, and the maintainer note already on this PR that the aws.config script test is failing due to policy ID matching caused by conditions.agent.version.

Verification

Not run locally; Docker-backed elastic-package package testing is unavailable in this environment, and the provided Buildkite log lacks the earlier failing command output.

Follow-up

If this remains red after the fixed elastic-package is present in CI, inspect the uploaded build/test-results/aws-*.xml artifacts from the rerun to confirm whether a new AWS package failure replaced the policy-ID matching issue.


What is this? | From workflow: PR Buildkite Detective

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@andrewkroh
andrewkroh force-pushed the aws/feat/var-groups-cloud-connector branch from 8f9dffa to b883d62 Compare July 6, 2026 16:43
…ration

Bump format_version to 3.6.0 and version to 7.0.0. Reorganize AWS
credential configuration into a `Setup Access` var_groups selector with
six options: Identity Federation, Direct Access Keys, Temporary Access
Keys, Assume Role, Assume Role with External ID, and Shared Credentials.

Key changes:
- format_version: 3.4.0 → 3.6.0
- version: 6.20.3 → 7.0.0
- kibana.version: "^8.19.4 || ^9.2.1" → "^9.4.0"
- agent.version: "^9.4.0"
- var_groups: credential_type selector with 6 options
- external_id is now secret: true
- New vars: assume_role_duration, assume_role_expiry_window,
  supports_identity_federation
- hide_in_var_group_options for 13 inputs across services that don't
  support Identity Federation
- GuardDuty httpjson stream: switch to auth.aws: block and add Identity
  Federation policy tests
- Add conditions.agent.version: ^9.4.0 because guardduty now requires
  it.

Source: elastic#19278 (Omolola-Akinleye/integrations)
@andrewkroh
andrewkroh force-pushed the aws/feat/var-groups-cloud-connector branch from 73d8d1b to 7d13726 Compare July 6, 2026 19:48
@andrewkroh
andrewkroh marked this pull request as ready for review July 6, 2026 19:54
@andrewkroh
andrewkroh requested review from a team as code owners July 6, 2026 19:54
@andrewkroh andrewkroh added the Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] label Jul 6, 2026
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

Comment thread packages/aws/manifest.yml Outdated
@@ -1,7 +1,7 @@
format_version: 3.4.0
format_version: 3.6.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity: 🟠 High confidence: medium path: packages/aws/manifest.yml:1

format_version is set to 3.6.0 but the package uses var_groups/hide_in_var_group_options, which package-spec introduced at 3.6.1 — bump format_version to 3.6.1.

Details

This PR adds a root-level var_groups block and hide_in_var_group_options entries on many policy-template inputs. Per the package-spec changelog, var_groups support at policy-template and input levels in integration packages was added in spec 3.6.1 (PR #​1120); spec 3.6.0 (issue #​1054) only added the base var_groups schema. The spec versioning model requires a package at format_version: x.y.z to validate against the x.y.z spec, so declaring 3.6.0 while relying on 3.6.1-level var_groups support risks an elastic-package check failure against the 3.6.0 spec. The only other integration in this repo that uses var_groups (okta) declares format_version: "3.6.1", and this repo's package-spec feature reference lists var_groups (policy template and input levels) as requiring 3.6.1. (Note: the current head of package-spec's schema only patches var_groups out before 3.6.0, which is why confidence is medium — but the changelog and the okta precedent both point to 3.6.1 as the correct minimum.)

Recommendation:

Declare the minimum spec version that supports the var_groups features used:

format_version: 3.6.1

🤖 AI-Generated Review | Vera Review Bot | 📚 Knowledge base: integration-skills

⚠️ Automated review — verify suggestions before applying.

The package uses hide_in_var_group_options on policy-template inputs, which package-spec documents at 3.6.1.
@vera-review-bot

Copy link
Copy Markdown

No issues across the latest commits 33eb83e.

Review summary

Issues found across earlier commits 7d13726 — 1 high
  • 🟠 format_version is set to 3.6.0 but the package uses var_groups/hide_in_var_group_options, which package-spec introduced at 3.6.1 — bump format_version to 3.6.1. (link) (Unresolved)

A new commit triggers another review — at most once every 15 minutes. I skip the PR while it's approved or has merge conflicts.

🤖 AI-Generated Review | Vera Review Bot | 📚 Knowledge base: integration-skills

⚠️ Automated review — verify suggestions before applying.

@mergify

mergify Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request
Add hide_in_var_group_options: { credential_type: [identity_federation] }
to the agentless-supported CloudWatch, EBS, EC2, ECS, and S3 metric/log
inputs. Only the GuardDuty API (httpjson) input supports identity
federation, so the others should not be offered when that setup access
option is selected. aws-s3 inputs and non-agentless policy templates are
already hidden in agentless mode, so they don't need the rule.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

✅ All changelog entries have the correct PR link.

seanrathier added a commit to elastic/kibana that referenced this pull request Jul 14, 2026
…effects

Newer integrations (e.g. the AWS integration in elastic/integrations#19828)
renamed the cloud-connector support flag var from `supports_cloud_connectors`
to `supports_identity_federation`. The var_group policy effects hardcoded the
old name, so selecting/deselecting a cloud-connector option never set the flag
for those integrations.

Add SUPPORTS_IDENTITY_FEDERATION_VAR_NAME and a findSupportFlagVarName() helper
that prefers the new name and falls back to the legacy one (CSPM / Asset
Discovery pre-migration). The fallback is tech debt to be removed once
elastic/security-team#15405 is complete.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

@seanrathier
seanrathier merged commit 3999204 into elastic:main Jul 16, 2026
9 checks passed
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

Package aws - 7.0.0 containing this change is available at https://epr.elastic.co/package/aws/7.0.0/

christophercutajar pushed a commit to christophercutajar/integrations that referenced this pull request Jul 21, 2026
seanrathier added a commit to seanrathier/integrations that referenced this pull request Jul 24, 2026
Remove hand-rolled SigV4 transforms (X-Amz-Date header, Authorization
header, pagination re-signing) from inspector, securityhub_findings,
securityhub_findings_full_posture, and securityhub_insights httpjson
streams. Add auth.aws block (matching the guardduty pattern from elastic#19828)
so the agent handles AWS auth natively and use_cloud_connectors works.

Revert identity federation enablement on aws.config: the CEL program
implements SigV4 inline and explicitly rejects non-key credentials;
cloud connectors cannot inject temporary creds as template variables,
so the option would silently fail at runtime. Restore
hide_in_var_group_options until the CEL program is rewritten.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Integration:aws AWS Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations]

4 participants