Skip to content

Commit 98b14c5

Browse files
committed
remove mention of isengard
remove mention of isengard remove mention of isengard fixed dependency files fixed dependency files clean up dockerfile clean up dockerfile clean up dockerfile
1 parent 266a7e7 commit 98b14c5

File tree

5 files changed

+15
-4500
lines changed

5 files changed

+15
-4500
lines changed
Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
11
FROM ghcr.io/ekristen/aws-nuke:v3.42.0
2-
3-
# Set environment variables
42
ENV AWS_SDK_LOAD_CONFIG=1 \
53
AWS_DEBUG=true
6-
7-
# Switch to root, install AWS CLI and cleanup in single layer
84
USER root
95
RUN apk add --no-cache \
106
python3 \
117
py3-pip \
128
aws-cli
13-
14-
# Copy configuration and script
159
COPY nuke_generic_config.yaml /nuke_generic_config.yaml
1610
COPY --chmod=755 run.sh /run.sh
17-
18-
# Switch back to non-root user for security
1911
USER aws-nuke
20-
2112
ENTRYPOINT ["/run.sh"]

.tools/test/stacks/nuke/typescript/README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
11

22
# aws-nuke for Weathertop
33

4-
[aws-nuke](https://github.com/ekristen/aws-nuke) is an open-source tool that deletes resources in a provided AWS account that are not considered "Default" or "AWS-Managed".
5-
6-
This tool is implemented using the Cloud Development Kit (CDK) script in this directory which deploy the [official aws-nuke image](https://github.com/ekristen/aws-nuke/pkgs/container/aws-nuke) to an AWS Lambda function.
4+
[aws-nuke](https://github.com/ekristen/aws-nuke) is an open-source tool that deletes non-default resources in a provided AWS account. It's implemented here in this directory using Cloud Development Kit (CDK) code that deploys the [official aws-nuke image](https://github.com/ekristen/aws-nuke/pkgs/container/aws-nuke) to an AWS Lambda function.
75

86
## ⚠ Important
97
This is a very destructive tool! It should not be deployed without fully understanding the impact it will have on your AWS accounts.
108
Please use caution and configure this tool to delete unused resources only in your lower test/sandbox environment accounts.
119

1210
## Overview
1311

14-
Defined in [account_nuker.ts](account_nuker.ts), this CDK stack deploys an AWS Lambda function that runs in a Docker container, scheduled to execute weekly via EventBridge.
15-
16-
It includes:
12+
This CDK stack is defined in [account_nuker.ts](account_nuker.ts). It includes:
1713
- A Docker-based Lambda function with ARM64 architecture and 1GB memory
1814
- An IAM role with administrative permissions for the Lambda's nuking function
1915
- An EventBridge rule that triggers the function every Sunday at midnight
2016

21-
The Lambda function is built from a [Dockerfile](Dockerfile) and runs with a 15-minute timeout. It contains a [nuke_generic_config.yml](nuke_generic_config.yaml) config and executes a [run.sh](run.sh).
17+
More specifically, this Lambda function is built from a [Dockerfile](Dockerfile) and runs with a 15-minute timeout. It contains a [nuke_generic_config.yml](nuke_generic_config.yaml) config and executes a [run.sh](run.sh) when invoked every Sunday at midnight UTC.
2218

2319
![infrastructure-overview](nuke-overview.png)
2420

.tools/test/stacks/nuke/typescript/nuke_generic_config.yaml

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ resource-types:
6666
- SecretsManagerSecret
6767
- SQSQueue
6868
- SSMParameter
69-
69+
7070
accounts:
7171
AWSACCOUNTID:
7272
filters:
@@ -107,65 +107,50 @@ accounts:
107107
- property: DetectorID
108108
type: glob
109109
value: "*"
110-
CloudTrailTrail:
111-
- type: regex
112-
value: "^(AccountGuardian|Isengard).*DO-NOT-DELETE.*$"
113110
CloudWatchEventsRule:
114111
- type: regex
115-
value: "^Rule: (AccountGuardian-.*DO-NOT-DELETE|AwsSecurity.*DO-NOT-DELETE|DO-NOT-DELETE-GatedGarden-.*)$"
112+
value: "^Rule: (AwsSecurity.*)$"
116113
CloudWatchEventsTarget:
117114
- type: regex
118-
value: "^Rule: (AccountGuardian-.*DO-NOT-DELETE.*|AwsSecurity.*DO-NOT-DELETE|DO-NOT-DELETE-GatedGarden-.*)$"
115+
value: "^Rule: (AwsSecurity.*)$"
119116
CloudWatchLogsLogGroup:
120117
- type: regex
121-
value: "^(AccountGuardian-).*$"
118+
value: "^.*$"
122119
ConfigServiceDeliveryChannel:
123-
- "pitbull-default"
120+
- "default"
124121
ConfigServiceConfigRule:
125122
- type: regex
126-
value: "^(managed-ec2-patch-compliance|ec2-managed-by-systems-manager-REMEDIATE|pvre-.*-REMEDIATE|.*-pvre-.*-REMEDIATE)$"
123+
value: "^(managed-ec2-patch-compliance|ec2-managed-by-systems-manager-REMEDIATE)$"
127124
S3Bucket:
128125
- property: Name
129126
type: regex
130-
value: "^(cdktoolkit-stagingbucket-.*|pitbull-aws-config-.*|cloudtrail-awslogs-.*-isengard-do-not-delete|do-not-delete-gatedgarden-audit-.*|aws-nuke.*)$"
127+
value: "^(cdktoolkit-stagingbucket-.*|aws-nuke.*)$"
131128
S3Object:
132129
- property: Bucket
133130
type: regex
134-
value: "^(cdktoolkit-stagingbucket-.*|pitbull-aws-config-.*|cloudtrail-awslogs-.*-isengard-do-not-delete|do-not-delete-gatedgarden-audit-.*|aws-nuke.*)$"
131+
value: "^(cdktoolkit-stagingbucket-.*|aws-nuke.*)$"
135132
ConfigServiceConfigurationRecorder:
136133
- "MainRecorder"
137134
CloudFormationStack:
138135
- property: Name
139136
type: regex
140-
value: "^(CDKToolkit|AccountGuardian|.*DO-NOT-DELETE)$"
137+
value: "^(CDKToolkit)$"
141138
- property: Name
142139
type: regex
143140
value: "^(PluginStack|NukeStack)*$"
144-
- property: Name
145-
type: regex
146-
value: "^(pvre.*|PVRE.*)$"
147-
- property: Name
148-
type: regex
149-
value: "^(.*PatchBaseline.*)$"
150141
IAMPolicy:
151142
- property: Name
152143
type: regex
153144
value: "^(ConfigAccessPolicy|ResourceConfigurationCollectorPolicy|CloudFormationRefereeService|EC2CapacityReservationService|AwsSecurit.*AuditPolicy)$"
154145
IAMRole:
155146
- property: Name
156147
type: regex
157-
value: "^(AWSServiceRoleFor.*|.*DO-NOT-DELETE|^Isengard.*|Admin|ReadOnly|GatedGarden.*Audit|ShadowTrooper.*|InternalAuditInternal|EC2CapacityReservationService|AccessAnalyzerTrustedService|EC2CapacityReservationService|AwsSecurit.*Audit|AWS.*Audit)$"
148+
value: "^(AWSServiceRoleFor.*|Admin|ReadOnly|InternalAuditInternal|EC2CapacityReservationService|AccessAnalyzerTrustedService|AwsSecurit.*Audit|AWS.*Audit)$"
158149
IAMRolePolicy:
159150
- property: role:RoleName
160151
type: regex
161-
value: "^(.*DO-NOT-DELETE|Isengard.*|GatedGarden.*Audit|AccountGuardian.*|ShadowTrooper.*|AccessAnalyzerTrustedService|AwsSecurit.*Audit)$"
152+
value: "^(AccessAnalyzerTrustedService|AwsSecurit.*Audit)$"
162153
IAMRolePolicyAttachment:
163154
- property: RoleName
164155
type: regex
165-
value: "^(Admin|ReadOnly|AWSServiceRoleFor.*|.*DO-NOT-DELETE|Isengard.*|InternalAuditInternal|EC2CapacityReservationService|AWSVAPTAudit|AwsSecurit.*Audit)$"
166-
SSMDocument:
167-
- type: regex
168-
value: "^(AccountGuardian|Isengard).*DO-NOT-DELETE.*$"
169-
SSMResourceDataSync:
170-
- type: regex
171-
value: "^(AccountGuardian|Isengard).*DO-NOT-DELETE.*$"
156+
value: "^(Admin|ReadOnly|AWSServiceRoleFor.*|InternalAuditInternal|EC2CapacityReservationService|AWSVAPTAudit|AwsSecurit.*Audit)$"

0 commit comments

Comments
 (0)