Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Mar 10, 2026
1 parent d688d75 commit 8a3adeb
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 2 deletions.
Empty file modified local-app/python-tools/cross-organization/check_cloudtrail.py
100644 → 100755
Empty file.
Empty file modified local-app/python-tools/cross-organization/check_config.py
100644 → 100755
Empty file.
Empty file modified local-app/python-tools/cross-organization/check_ecr.py
100644 → 100755
Empty file.
Empty file modified local-app/python-tools/cross-organization/check_iam.py
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions local-app/python-tools/cross-organization/check_iam_roles.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import json

# --- VERSIONING ---
__version__ = "1.0.0"
__version__ = "1.0.1"

def account_task(account_session, account_id, account_name, region):
"""
Expand Down Expand Up @@ -35,7 +35,7 @@ def account_task(account_session, account_id, account_name, region):

# 3. Permissions Boundary
boundary = role.get('PermissionsBoundary', {})
boundary_name = boundary.get('PermissionsBoundaryArn', 'N/A').split('/')[-1] if boundary else 'N/A'
boundary_name = boundary.get('PermissionsBoundaryArn', None).split('/')[-1] if boundary else None

# 4. Tags
# Boto3's list_roles returns tags in the main response structure
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

FILE=$1
if [ -z $FILE ]
then
echo "* missing $FILE"
exit 1
fi
if [ ! -r $FILE ]
then
echo "* cannot read $FILE"
exit 1
fi

awk -F, '{print "aws --profile",$2 "-" $3,"--region",$4,"cloudtrail","stop-logging","--name",$5}' $FILE
Empty file modified local-app/python-tools/cross-organization/remediate_tgw.py
100644 → 100755
Empty file.
Empty file modified local-app/python-tools/cross-organization/remediate_tgw_dns.py
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

ORG="ent-gov"
REGION="us-gov-east-1"
CHECK="check_iam_roles"

./org_runner.py --profile $ORG.org --region $REGION --role-name r-inf-org-controller --output --enable-checks $CHECK 2>&1 |& tee $ORG.$CHECK.$(date +%s).txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

ORG="ent-gov"
REGION="us-gov-east-1"

./org_runner.py --profile $ORG.org --region $REGION --role-name r-inf-org-controller --output --enable-checks check_tgw_attachments 2>&1 |& tee $ORG.check_tgw_attachments.$(date +%s).txt
17 changes: 17 additions & 0 deletions local-app/python-tools/cross-organization/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

STAMP=$(date +%s)
for f in lab-gov ent-gov ent-ew
do
if [ $f == "ent-ew" ]
then
REGION="us-east-1"
else
REGION="us-gov-east-1"
fi

echo "# $f"
./org_runner.py --profile $f.org --region $REGION --role-name r-inf-org-controller --output --enable-checks check_cloudtrail check_config 2>&1 |& tee org_runner.$f.txt
mkdir $f.$STAMP
mv org_runner.$f.txt audit_results.* $f.$STAMP/
done

0 comments on commit 8a3adeb

Please sign in to comment.