Skip to content

Commit

Permalink
Merge branch 'RhinoSecurityLabs:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveYesland authored May 24, 2024
2 parents 5c06971 + 75370ef commit 1bd1583
Show file tree
Hide file tree
Showing 8 changed files with 222 additions and 143 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
FROM python:3.9-alpine3.12

LABEL maintainer="Rhino Assessment Team <[email protected]>"
LABEL pacu.version="1.5.1"
LABEL pacu.version="1.5.3"

RUN apk add --no-cache aws-cli

Expand Down
28 changes: 15 additions & 13 deletions pacu/modules/cloudformation__download_data/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,21 @@ def default(self, obj):
all_stacks = []
found_regions = []
for region in regions:
client = pacu_main.get_boto3_client('cloudformation', region)
print('Looking for CloudFormation Stacks in region {}...'.format(region))
stacks_data = client.describe_stacks()
stacks = stacks_data['Stacks']
all_stacks += stacks

if stacks_data['Stacks']:
print('Getting exports for region: {}'.format(region))
exports = client.list_exports()
if exports:
with outfile('exports', region) as (f):
json.dump(exports, f, indent=1)
find_secrets(json.dumps(exports))
try:
client = pacu_main.get_boto3_client("cloudformation", region)
print("Looking for CloudFormation Stacks in region {}...".format(region))
stacks_data = client.describe_stacks()
stacks = stacks_data["Stacks"]
all_stacks += stacks
except ClientError as e:
print(f"Error: Could not enumerate region {region}")
print(f"Error: {e}")
continue
exports = client.list_exports()
if exports:
with outfile('exports', region) as (f):
json.dump(exports, f, indent=1)
find_secrets(json.dumps(exports))
while 'NextToken' in stacks_data:
stacks_data = client.describe_stacks(NextToken=(stacks_data['NextToken']))
stacks += stacks_data['Stacks']
Expand Down
Loading

0 comments on commit 1bd1583

Please sign in to comment.