Skip to content

aws_securityhub: raise total_fields limit to prevent transform failures - #20603

Open
kcreddy wants to merge 4 commits into
elastic:mainfrom
kcreddy:aws-sh-field-limit
Open

aws_securityhub: raise total_fields limit to prevent transform failures#20603
kcreddy wants to merge 4 commits into
elastic:mainfrom
kcreddy:aws-sh-field-limit

Conversation

@kcreddy

@kcreddy kcreddy commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Proposed commit message

aws_securityhub: raise total_fields limit to prevent transform failures

The finding data stream already declares ~1,570 fields against a 2000
total_fields.limit, leaving little room for the resource subtrees that
map dynamically: resources.data covers only two of the ASFF detail
schemas, and resources.tags keys are customer-defined. The
latest_findings transform destination hits that ceiling and goes
health red; the data stream itself survives only because logs@settings
sets ignore_dynamic_beyond_limit, silently dropping the excess.

Raise the limit to 5000 on the finding stream and both transform
destinations. Bump fleet_transform_version and the destination index
names so the new setting reaches existing installations, since Fleet
skips reinstalling the destination index template when the transform
version is unchanged and does not delete the destination index on
upgrade.

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.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

Related issues

The finding data stream already declares ~1,500 fields against a 2000
total_fields.limit, leaving little room for dynamically mapped nested
resources. The latest_findings transform destination hits that ceiling
and goes health red. Raise the limit to 5000 on the finding stream and
both transform destinations.
@github-actions

github-actions Bot commented Aug 7, 2026

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.

@kcreddy kcreddy self-assigned this Aug 7, 2026
@kcreddy
kcreddy marked this pull request as ready for review August 7, 2026 10:07
@kcreddy
kcreddy requested review from a team as code owners August 7, 2026 10:07
@kcreddy kcreddy added bugfix Pull request that fixes a bug issue Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] Integration:aws_securityhub AWS Security Hub labels Aug 7, 2026
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

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

Comment thread packages/aws_securityhub/changelog.yml Outdated
changes:
- description: Raise finding and transform destination `total_fields.limit` from 2000 to 5000 to prevent transform failures as dynamic resource fields grow.
type: bugfix
link: https://github.com/elastic/integrations/pull/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: 🟡 Medium confidence: high path: packages/aws_securityhub/changelog.yml:6

Both new changelog entries link to placeholder PR pull/0; replace them with this PR's URL (pull/20603) before merge.

Details

The two changes added under version 1.2.2 (changelog.yml lines 6 and 9) both use https://github.com/elastic/integrations/pull/0 as their link. PR 0 does not exist, so the published package changelog for 1.2.2 ships two dead links, unlike every earlier entry in this file which points at its real PR (e.g. 1.2.1 -> pull/20421).

Recommendation:

Point both entries at this PR:

- version: "1.2.2"
  changes:
    - description: Raise finding and transform destination `total_fields.limit` from 2000 to 5000 to prevent transform failures as dynamic resource fields grow.
      type: bugfix
      link: https://github.com/elastic/integrations/pull/20603
    - description: Bump transform versions and destination index names so the new field limit is applied on upgrade.
      type: bugfix
      link: https://github.com/elastic/integrations/pull/20603

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

⚠️ Automated review — verify suggestions before applying.

Comment thread packages/aws_securityhub/changelog.yml Outdated
changes:
- description: Raise finding and transform destination `total_fields.limit` from 2000 to 5000 to prevent transform failures as dynamic resource fields grow.
type: bugfix
link: https://github.com/elastic/integrations/pull/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: 🟡 Medium confidence: high path: packages/aws_securityhub/changelog.yml:6

Changelog links a different PR number

Details

This changelog entry's link: points at pull/0, but it was added in PR #​20603. It is likely a leftover template placeholder or a copy from another PR.

Recommendation:

Point the changelog link at this PR:

link: https://github.com/elastic/integrations/pull/20603

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

⚠️ Automated review — verify suggestions before applying.

Comment thread packages/aws_securityhub/changelog.yml Outdated
link: https://github.com/elastic/integrations/pull/0
- description: Bump transform versions and destination index names so the new field limit is applied on upgrade.
type: bugfix
link: https://github.com/elastic/integrations/pull/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: 🟡 Medium confidence: high path: packages/aws_securityhub/changelog.yml:9

Changelog links a different PR number

Details

This changelog entry's link: points at pull/0, but it was added in PR #​20603. It is likely a leftover template placeholder or a copy from another PR.

Recommendation:

Point the changelog link at this PR:

link: https://github.com/elastic/integrations/pull/20603

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

⚠️ Automated review — verify suggestions before applying.

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

✅ All changelog entries have the correct PR link.

mapping:
total_fields:
limit: 2000
limit: 5000

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: 🟡 Medium confidence: medium path: packages/aws_securityhub/elasticsearch/transform/latest_findings/manifest.yml:16

The transform destination index templates raise the limit but still have no ignore_dynamic_beyond_limit, so an over-budget mapping update fails the transform hard instead of degrading; add index.mapping.total_fields.ignore_dynamic_beyond_limit: true alongside the new limit in both transform manifests.

Details

The linked issue's own analysis is that the finding data stream survives an exhausted mapping budget only because Fleet composes logs@​settings into logs index templates, and that template sets index.mapping.total_fields.ignore_dynamic_beyond_limit: true. Transform destination index templates are built by a different code path that composes only the package component templates plus ecs@​mappings, so they get no such escape hatch — which is exactly why the transform goes health red with Limit of total fields [2000] has been exceeded while ingest keeps working.

This PR raises the ceiling on both destination templates but does not close that asymmetry: the failure mode is unchanged, only deferred. aws_securityhub.finding.resources.tags.* is a wildcard object over customer-defined tag keys and resources.data declares only 2 of the many ASFF *Details schemas, so the dynamic portion of the mapping is unbounded by the package. Setting the flag turns the remaining risk from 'latest view goes stale and the transform retry-loops' into 'a few late dynamic fields are left unmapped' — the same trade-off the data stream already makes.

The same line applies to packages/aws_securityhub/elasticsearch/transform/latest_cdr_vulnerabilities/manifest.yml (line 7), whose destination_index_template declares no mappings block at all and therefore also maps dynamically. Both destination indexes are being recreated by this PR's index-name bump, so the setting would take effect on upgrade at no extra cost.

Note this is additive to, not a replacement for, the flattened remap of resources.data/resources.tags that the issue records as deliberately out of scope.

Recommendation:

Add the flag next to the raised limit in both transform manifests:

start: true
destination_index_template:
  mappings:
    dynamic: true
    dynamic_templates:
      - strings_as_keyword:
          match_mapping_type: string
          mapping:
            ignore_above: 1024
            type: keyword
    date_detection: true
  settings:
    index:
      mapping:
        total_fields:
          limit: 5000
          ignore_dynamic_beyond_limit: true

And in latest_cdr_vulnerabilities/manifest.yml:

start: true
destination_index_template:
  settings:
    index:
      mapping:
        total_fields:
          limit: 5000
          ignore_dynamic_beyond_limit: true

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

⚠️ Automated review — verify suggestions before applying.

mapping:
total_fields:
limit: 2000
limit: 5000

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: 🔵 Low confidence: medium path: packages/aws_securityhub/elasticsearch/transform/latest_cdr_vulnerabilities/manifest.yml:7

limit is indented four spaces under total_fields instead of two in both transform manifests; re-indent it to two while touching this line so it matches the data stream manifest and the rest of the repo.

Details

total_fields: sits at 8 spaces and limit: at 12, a 4-space step where every other level in the file steps by 2. It parses fine, but these two transform manifests are the only files in the repository with this indentation for the total_fields/limit pair — packages/aws_securityhub/data_stream/finding/manifest.yml, edited in the same PR, uses the standard 2-space step. The same off-by-two exists at packages/aws_securityhub/elasticsearch/transform/latest_findings/manifest.yml line 16.

Purely cosmetic; worth correcting only because both lines are already being modified here.

Recommendation:

Re-indent limit by two spaces relative to total_fields:

start: true
destination_index_template:
  settings:
    index:
      mapping:
        total_fields:
          limit: 5000

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

⚠️ Automated review — verify suggestions before applying.

@vera-review-bot

Copy link
Copy Markdown

Review summary

Issues found across the latest commits 8c806b7, cad2e59 — 1 medium, 1 low
  • 🟡 The transform destination index templates raise the limit but still have no ignore_dynamic_beyond_limit, so an over-budget mapping update fails the transform hard instead of degrading (link) (Unresolved)
  • 🔵 limit is indented four spaces under total_fields instead of two in both transform manifests (link) (Unresolved)
Issues found across earlier commits 04dec84 — 3 medium
  • 🟡 Both new changelog entries link to placeholder PR pull/0 (link) (Unresolved)
  • 🟡 Changelog links a different PR number (link) (Unresolved)
  • 🟡 Changelog links a different PR number (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.

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @kcreddy

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

Labels

bugfix Pull request that fixes a bug issue Integration:aws_securityhub AWS Security Hub Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aws_securityhub: latest_findings transform fails once total_fields.limit (2000) is exhausted

1 participant