feat(aws): create config access logs for IAM assume role#1908
Merged
Conversation
Contributor
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
WalkthroughAdds handling for AWS CloudTrail AssumeRole events: a new RequestParameters.RoleArn field, removal of default AssumeRole exclusion, a converter function that turns AssumeRole events into ExternalUser + ConfigAccessLog ScrapeResult, and corresponding tests. Changes
Sequence Diagram(s)sequenceDiagram
participant CloudTrail as CloudTrail (event source)
participant Scraper as CloudTrail Scraper
participant Converter as cloudtrailAssumeRoleToAccessLog
participant Emitter as ScrapeResult Emitter
CloudTrail->>Scraper: delivers event (AssumeRole)
Scraper->>Converter: parse event, extract roleArn & userIdentity
Converter->>Converter: determine actor ARN, build ExternalUser & ConfigAccessLog
Converter-->>Scraper: return ScrapeResult
Scraper->>Emitter: emit ExternalUser + ConfigAccessLog
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@scrapers/aws/cloudtrail.go`:
- Around line 287-307: The switch handling userType can set userARN to empty
when AssumedRole lacks SessionContext.SessionIssuer; update the AssumedRole
branch in the switch (where userName/userARN are assigned from
ctEvent.UserIdentity.SessionContext.SessionIssuer) to first try
SessionIssuer.Arn and if empty fall back to ctEvent.UserIdentity.Arn, and after
the switch validate that userARN is non-empty before calling
hash.DeterministicUUID (return an error if still empty) so DeterministicUUID
never receives an empty alias; reference ctEvent.UserIdentity,
SessionContext.SessionIssuer, the userARN variable, and the call to
hash.DeterministicUUID/userID.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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.
Fixes: #1845
Summary by CodeRabbit
New Features
Refactor
Tests