Skip to content

Commit

Permalink
Ban lambda wildcards (#223)
Browse files Browse the repository at this point in the history
* Improve wildcard expressions to start considering question marks as wildcards too

* Update changelog

* Apply suggestions from code review

Co-authored-by: Ramon <w0rmr1d3r@users.noreply.github.com>

* Start blocking lambda actions that allow wildcards

* Update changelog

* Add urlconfig actions

Co-authored-by: Ramon <w0rmr1d3r@users.noreply.github.com>
  • Loading branch information
jsoucheiron and w0rmr1d3r committed Apr 19, 2022
1 parent 776839c commit 8c8c924
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
### Improvements
- CFRipper is now compatible with Python3.10
- CFRipper is now able to detect new types of wildcard usage.
- Default config will now detect lambda resource wildcards as through IAM overpowered roles.

### Updates
- Bump dev dependency `moto` to allow `>=3.0.0`.
Expand Down
43 changes: 40 additions & 3 deletions cfripper/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,50 @@ class Config:
"ec2:CreateDhcpOptions",
"ec2:CreateCustomerGateway",
"ecs:*",
# Lambda
"lambda:AddLayerVersionPermission",
"lambda:AddPermission",
"lambda:CreateFunctionUrlConfig",
"lambda:DeleteAlias",
"lambda:DeleteCodeSigningConfig",
"lambda:DeleteEventSourceMapping",
"lambda:DeleteFunction",
"lambda:DeleteFunctionCodeSigningConfig",
"lambda:DeleteFunctionConcurrency",
"lambda:DeleteFunctionEventInvokeConfig",
"lambda:DeleteFunctionUrlConfig",
"lambda:DeleteLayerVersion",
"lambda:DeleteProvisionedConcurrencyConfig",
"lambda:DisableReplication",
"lambda:EnableReplication",
"lambda:InvokeAsync",
"lambda:InvokeFunction",
"lambda:InvokeFunctionUrl",
"lambda:PublishLayerVersion",
"lambda:PublishVersion",
"lambda:PutFunctionCodeSigningConfig",
"lambda:PutFunctionConcurrency",
"lambda:PutFunctionEventInvokeConfig",
"lambda:PutProvisionedConcurrencyConfig",
"lambda:RemoveLayerVersionPermission",
"lambda:RemovePermission",
"lambda:TagResource",
"lambda:UntagResource",
"lambda:UpdateAlias",
"lambda:UpdateCodeSigningConfig",
"lambda:UpdateEventSourceMapping",
"lambda:UpdateFunctionCode",
"lambda:UpdateFunctionCodeSigningConfig",
"lambda:UpdateFunctionConfiguration",
"lambda:UpdateFunctionEventInvokeConfig",
"lambda:UpdateFunctionUrlConfig",
# other lovely services
"cloudtrail:",
"aws-portal:",
"acm:",
"trustedadvisor:",
"aws-marketplace",
"aws-portal:",
"cloudtrail:",
"directconnect:",
"trustedadvisor:",
]

def __init__(
Expand Down

0 comments on commit 8c8c924

Please sign in to comment.