include-actions in exclusions file has no effect on Data Exfiltration finding category
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 64/100
Research direction
Read cloudsplaining/shared/constants.py and cloudsplaining/output/policy_finding.py first, then inspect the exclusions template used by create-exclusions-file and the include_actions handling in cloudsplaining/scan/statement_detail.py. Reproduce the issue with the listed s3:ListBucket policy; done when the behavior matches the template's documented scope, either by producing the intended finding or by clearly documenting the existing scope.
Written by the indexing model from the issue text.
Description
Summary
The exclusions file generated by cloudsplaining create-exclusions-file includes an include-actions key with a comment implying it extends the Data Exfiltration detection list:
Read-only actions to include in the results, such as s3:GetObject. By default, it includes Actions that could lead to Data Exfiltration
In practice, include-actions is never read by the Data Exfiltration finding logic. It only affects the unrelated Infrastructure Modification (Write / Permissions Management / Tagging) finding category.
Where this breaks down
cloudsplaining/shared/constants.pydefinesREAD_ONLY_DATA_EXFILTRATION_ACTIONSas a hardcoded list (currentlys3:GetObject,ssm:GetParameter,ssm:GetParameters,ssm:GetParametersByPath,secretsmanager:GetSecretValue).cloudsplaining/output/policy_finding.py, thedata_exfiltrationproperty, callsself.policy_document.allows_specific_actions_without_constraints(READ_ONLY_DATA_EXFILTRATION_ACTIONS)and filters only againstself.exclusions.exclude_actions. It never referencesself.exclusions.include_actions.exclusions.include_actionsis only consumed incloudsplaining/scan/statement_detail.py, insidemissing_resource_constraints_for_modify_actions, which feeds the Infrastructure Modification finding, a completely separate category from Data Exfiltration.
So there is no code path by which adding an action to include-actions can cause it to appear in the Data Exfiltration finding, no matter what the exclusions-file template comment says.
Repro
- Generate an exclusions file:
cloudsplaining create-exclusions-file - Add
s3:ListBuckettoinclude-actions:include-actions: - "s3:ListBucket" - Scan a policy that grants only
s3:ListBucket(no resource constraint) and does not grant any action already in the hardcodedREAD_ONLY_DATA_EXFILTRATION_ACTIONSlist, e.g.:{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "s3:ListBucket", "Resource": "*" } ] } - Run
cloudsplaining scanwith that exclusions file against the policy. - Observe: no Data Exfiltration finding is produced for
s3:ListBucket, despite it being explicitly added toinclude-actions.
Proposed fix (pick one)
Option A - wire up include-actions to Data Exfiltration: update the data_exfiltration property to union exclusions.include_actions into the action list passed to allows_specific_actions_without_constraints, so the property behaves as the generated template comment describes.
Option B - fix the documentation instead: if include-actions is intentionally scoped to Infrastructure Modification only, update the comment generated by create-exclusions-file to say so.
Either direction resolves the mismatch; maintainers should pick based on intended design.
- Dominant language
- JavaScript
- Stars
- 2.3k
- Forks
- 224
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from salesforce/cloudsplaining
-
Data Exfiltration: flag snapshot, export and batch secret-read actionsPossibly taken @devteamaegis claimed this 26 days ago. Open
Difficulty 5/5 Over a week Newbie friendliness 35/100
salesforce/cloudsplaining#654 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
salesforce/cloudsplaining#585 ·
-
Proposal: Implement Automated Logic Ingestion for IAM Privilege Escalation via Pathfinding.cloudOpen
Difficulty 4/5 3-5 days Newbie friendliness 45/100
salesforce/cloudsplaining#537 · 1 comment · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
salesforce/cloudsplaining#386 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
salesforce/cloudsplaining#324 ·
All issues in salesforce/cloudsplaining
Similar issues
-
verified whatsapp
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 6 days
-
Difficulty 1/5 Under an hour Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
salesforce/sa11y#1022 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
githubnext/gh-aw-workshop#6379 ·
Maintainers usually reply within 1 day
-
FEATURE REQUEST
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
linuxmint/cinnamon-spices-applets#9386 ·
Maintainers usually reply within 1 day