salesforce / salesforce/cloudsplaining
include-actions in exclusions file has no effect on Data Exfiltration finding category
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2.2k
- Forks
- 221
- Avg merge
- 3h 21m
- Merged PRs (30d)
- 8
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.
Contributor guide
No contributing guide indexed for this repository
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.
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.
Assessment
- Tech stack
- aws, python
- Domain
- security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100