feat(scan): organization-wide phantom user scan via AssumeRole#23
Merged
Conversation
… _setup_clients helper
MrCloudSec
approved these changes
May 18, 2026
Member
MrCloudSec
left a comment
There was a problem hiding this comment.
Thanks for your contribution @RajChowdhury240 !
madhavnakar-bt
approved these changes
May 18, 2026
Merged
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
Adds bks scan --org: enumerate every ACTIVE member account in the AWS Organization, AssumeRole into each in parallel,
run the existing PhantomUserScanner per account, aggregate into a single report. Closes the enterprise gap —
single-account scan was the toolkit's biggest scale ceiling.
Why
Real environments have 50–500 AWS accounts. v1.1.0 forced operators to loop bks scan per account and merge JSON
manually. Phantom users are a fleet-wide problem: any developer in any account can spawn one through the Console. SOC
needs one cross-org view.
What changes
account_id / account_name prepended.
Design choices
sub-calls per phantom. 8× safe under default throttle.
report.
Permissions
Documented in docs/permissions.md. Caller (mgmt / delegated admin) needs organizations:ListAccounts + sts:AssumeRole on arn:aws:iam::*:role/. Each member account's role needs the existing scan permission set.