Skip to content

feat: validate aws:CalledVia condition key service values#262

Open
raajheshkannaa wants to merge 2 commits intoduo-labs:mainfrom
raajheshkannaa:feat/validate-calledvia-services
Open

feat: validate aws:CalledVia condition key service values#262
raajheshkannaa wants to merge 2 commits intoduo-labs:mainfrom
raajheshkannaa:feat/validate-calledvia-services

Conversation

@raajheshkannaa
Copy link
Copy Markdown

Closes #84

Summary

  • Adds a community auditor that validates services referenced in aws:CalledVia, aws:CalledViaFirst, and aws:CalledViaLast conditions
  • Flags services not in the documented list of CalledVia-supported services as INVALID_CALLEDVIA_SERVICE (severity: MEDIUM)
  • Case-insensitive comparison to avoid false positives

Supported services

athena, cloudformation, databrew, dynamodb, kms, macie, ram, rolesanywhere, s3 (all .amazonaws.com)

Test plan

  • 7 tests covering valid, invalid, mixed, multi-key variants
  • All existing tests unaffected

Check that services referenced in aws:CalledVia, aws:CalledViaFirst,
and aws:CalledViaLast conditions are in the documented list of
supported services.

Fixes duo-labs#84
…dead code

- Add databrew.amazonaws.com, macie.amazonaws.com, s3.amazonaws.com to CALLEDVIA_SUPPORTED_SERVICES
- Switch list to set for O(1) membership checks
- Add .lower() on value before checking against the (all-lowercase) set
- Remove unused `import re` and unused `operator` variable extraction
- Update tests: fix stale invalid-service example (s3 -> ec2), add new services to all_supported test
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 23, 2026

CLA assistant check
All committers have signed the CLA.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check the services mentioned for aws:CalledVia

2 participants