Skip to content

Commit f141288

Browse files
authored
CT Optional (#165)
* Make AWS Control Tower optional * merge * update easy setup for easy testing * update easy setup for easy testing * update easy setup for easy testing * fixing flake8 msg * fixing flake8 msg * fixing formatter msg * fixing formatter msg * set param description
1 parent f4a2955 commit f141288

File tree

41 files changed

+1225
-333
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1225
-333
lines changed

CHANGELOG.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
## Table of Contents<!-- omit in toc -->
44

55
- [Introduction](#introduction)
6+
- [2023-08-07](#2023-08-07)
7+
- [2023-07-07](#2023-07-07)
68
- [2023-07-01](#2023-07-07)
79
- [2023-07-01](#2023-07-01)
810
- [2023-06-21](#2023-06-21)
@@ -42,22 +44,26 @@ All notable changes to this project will be documented in this file.
4244

4345
---
4446

45-
## 2023-07-07
47+
## 2023-08-07
4648

47-
### Changed<!-- omit in toc -->
49+
- Updated [Common Prerequisites](https://github.com/aws-samples/aws-security-reference-architecture-examples/tree/main/aws_sra_examples/solutions/common/common_prerequisites) solution to make AWS Control Tower optional.
50+
- Updated [Security Hub](https://github.com/aws-samples/aws-security-reference-architecture-examples/tree/main/aws_sra_examples/solutions/securityhub/securityhub_org) solution to make AWS Control Tower optional.
51+
- Updated [Inspector](https://github.com/aws-samples/aws-security-reference-architecture-examples/tree/main/aws_sra_examples/solutions/inspector/inspector_org) solution to make AWS Control Tower optional.
52+
- Updated [GuardDuty](https://github.com/aws-samples/aws-security-reference-architecture-examples/tree/main/aws_sra_examples/solutions/guardduty/guardduty_org) solution to make AWS Control Tower optional.
53+
- Updated [Easy Setup](https://github.com/aws-samples/aws-security-reference-architecture-examples/tree/main/aws_sra_examples/easy_setup) to support solution updates for making AWS Control Tower optional.
54+
- Updated [CloudTrail](https://github.com/aws-samples/aws-security-reference-architecture-examples/tree/main/aws_sra_examples/solutions/cloudtrail/cloudtrail_org) solution to make AWS Control Tower optional.
55+
- Updated [IAM Access Analyzer](https://github.com/aws-samples/aws-security-reference-architecture-examples/tree/main/aws_sra_examples/solutions/iam/iam_access_analyzer) solution to make AWS Control Tower optional.
56+
57+
## 2023-07-07
4858

4959
- Updated [CloudTrail](https://github.com/aws-samples/aws-security-reference-architecture-examples/tree/main/aws_sra_examples/solutions/cloudtrail/cloudtrail_org) solution to enable delegated administrator.
5060

5161
## 2023-07-01
5262

53-
### Changed<!-- omit in toc -->
54-
5563
- Added [Detective Organization](aws_sra_examples/solutions/detective/detective_org) solution to [Easy Setup](aws_sra_examples/easy_setup) and [Quick Setup](aws_sra_examples/quick_setup/)
5664

5765
## 2023-06-21
5866

59-
### Changed<!-- omit in toc -->
60-
6167
- Added [GuardDuty Organization](aws_sra_examples/solutions/guardduty/guardduty_org) EKS, Malware, RDS, and Lambda protections to [Easy Setup](aws_sra_examples/easy_setup) and [Quick Setup](aws_sra_examples/quick_setup/) deployment options
6268
- Added [Inspector Organization](aws_sra_examples/solutions/inspector/inspector_org) solution to [Quick Setup](aws_sra_examples/quick_setup/) deployment option
6369

README.md

Lines changed: 73 additions & 38 deletions
Large diffs are not rendered by default.
Loading
Binary file not shown.

aws_sra_examples/easy_setup/README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ In the CloudFormation service console, navigate to the stacks area.
7777
In the stacks area, create a stack, and then select the "Upload a template file" option. Click on "Next", then follow the process to deploy the stack.
7878
Be sure to specify the appropriate parameters for the template as needed.
7979

80+
- IMPORTANT: If `AWS Organizations` is being used without AWS Control Tower, you must also specify the following parameter values as you create the stack:
81+
- `pControlTower` as `false`
82+
- `pLogArchiveAccountId` as the AWS Account Id of the account designated to be the `Log Archive` account.
83+
- `pSecurityAccountId` as the AWS Account Id of the account designated to be the `Security Tooling` account.
84+
- `pGovernedRegions` as a list of AWS regions separated by commas
85+
8086
#### II. (Option B) Deployment using the AWS CLI
8187

8288
Deployment using the AWS CLI requires the template to be downloaded first.
@@ -100,15 +106,26 @@ Prepare and run the `aws cloudformation deploy` command to launch the template.
100106
- Be sure to alter the folder/path for the `sra-easy-setup.yaml` template-file appropriately (replace `[path to template file]`)
101107
- Be sure to put in the s3 bucket name (replace `[s3 bucket name from step 1]`)
102108
- Be sure to specify the proper parameter overrides and specify the alarm email address (`[email address]`)
109+
- If `AWS Organizations` is being used without AWS Control Tower, you must also specify the following parameter values as you create the stack:
110+
- `pControlTower` as `false`
111+
- `pLogArchiveAccountId` as the AWS Account Id of the account designated to be the `Log Archive` account.
112+
- `pSecurityAccountId` as the AWS Account Id of the account designated to be the `Security Tooling` account.
113+
- `pGovernedRegions` as a list of AWS regions separated by commas
103114

104115
*NOTE: The example command below deploys The Guard Duty, Security Hub, and Config Management solutions (you can remove those 3 parameters or replace them with other solutions deployment parameters)*
105116

106-
###### Example Command To Launch The Template<!-- omit in toc -->
117+
###### Example Command To Launch The Template in AWS Control Tower landing zone<!-- omit in toc -->
107118

108119
```bash
109120
aws cloudformation deploy --template-file [path to template file]/sra-easy-setup.yaml --stack-name sra-easy-setup --s3-bucket [s3 bucket name from step 1] --capabilities CAPABILITY_NAMED_IAM --parameter-overrides pDeployGuardDutySolution=Yes pDeployConfigManagementSolution=Yes pDeploySecurityHubSolution=Yes pSRAAlarmEmail=[email address]
110121
```
111122

123+
###### Example Command To Launch The Template in AWS Organizations<!-- omit in toc -->
124+
125+
```bash
126+
aws cloudformation deploy --template-file [path to template file]/sra-easy-setup.yaml --stack-name sra-easy-setup --s3-bucket [s3 bucket name from step 1] --capabilities CAPABILITY_NAMED_IAM --parameter-overrides pControlTower=false pLogArchiveAccountId=<LOG_ARCHIVE_ACCOUNT_ID> pSecurityAccountId=<SECURITY_ACCOUNT_ID> pGovernedRegions=<COMMA_SEPARATED_REGIONS>
127+
```
128+
112129
#### CloudFormation AWS SRA Removal Instructions
113130

114131
From within the management account:

aws_sra_examples/easy_setup/customizations_for_aws_control_tower/manifest.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,10 @@ resources:
229229
parameter_value: 'false'
230230
- parameter_key: pEnableSecurityBestPracticesStandard
231231
parameter_value: 'true'
232+
- parameter_key: pEnableNISTStandard
233+
parameter_value: 'false'
234+
- parameter_key: pNISTStandardVersion
235+
parameter_value: 'false'
232236
- parameter_key: pRegionLinkingMode
233237
parameter_value: 'SPECIFIED_REGIONS'
234238

aws_sra_examples/easy_setup/templates/sra-easy-setup.yaml

Lines changed: 90 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ Metadata:
2121
# - pOrganizationId
2222
- pSRAStagingS3BucketNamePrefix
2323
- pSRAStagingS3BucketStackName
24+
- pRepoURL
25+
- pRepoBranch
26+
- Label:
27+
default: Landing Zone
28+
Parameters:
29+
- pControlTower
30+
- pGovernedRegions
31+
- pSecurityAccountId
32+
- pLogArchiveAccountId
2433
- Label:
2534
default: CodeBuild Properties
2635
Parameters:
@@ -166,6 +175,8 @@ Metadata:
166175
- pCISStandardVersion
167176
- pEnablePCIStandard
168177
- pEnableSecurityBestPracticesStandard
178+
- pEnableNISTStandard
179+
- pNISTStandardVersion
169180
- pRegionLinkingMode
170181
- Label:
171182
default: Inspector Solution
@@ -187,6 +198,18 @@ Metadata:
187198
- pLambdaLogLevel
188199

189200
ParameterLabels:
201+
pControlTower:
202+
default: AWS Control Tower landing zone deployed/in-use
203+
pGovernedRegions:
204+
default: AWS regions (comma separated) if not using AWS Control Tower (leave set to ct-regions for AWS Control Tower environments)
205+
pSecurityAccountId:
206+
default: Security Tooling Account ID
207+
pLogArchiveAccountId:
208+
default: Log Archive Account ID
209+
pRepoURL:
210+
default: The AWS SRA public code repository HTTPS URL
211+
pRepoBranch:
212+
default: The AWS SRA public code repository branch name
190213
pSRASolutionName:
191214
default: SRA Solution Name
192215
pCodeBuildProjectName:
@@ -363,6 +386,10 @@ Metadata:
363386
default: Max Password Age
364387
pMinimumPasswordLength:
365388
default: Minimum Password Length
389+
pEnableNISTStandard:
390+
default: Enable NIST Standard
391+
pNISTStandardVersion:
392+
default: NIST Standard Version
366393
pOperationsContactAction:
367394
default: Operations Alternate Contact Action
368395
pOperationsEmail:
@@ -411,6 +438,41 @@ Metadata:
411438
default: (Optional) Existing VPC ID
412439

413440
Parameters:
441+
pRepoURL:
442+
Default: https://github.com/aws-samples/aws-security-reference-architecture-examples.git
443+
Description:
444+
SRA Code Library Repository URL
445+
Type: String
446+
pRepoBranch:
447+
Default: main
448+
Description:
449+
SRA Code Library Repository branch name
450+
Type: String
451+
pControlTower:
452+
AllowedValues: ['true', 'false']
453+
Default: 'true'
454+
Description:
455+
Indicates whether AWS Control Tower is deployed and being used for this AWS environment.
456+
Type: String
457+
pGovernedRegions:
458+
AllowedPattern: '^(ct-regions)|((\b(?<!@)(af-south-1|ap-east-1|ap-northeast-1|ap-northeast-2|ap-northeast-3|ap-south-1|ap-south-2|ap-southeast-1|ap-southeast-2|ap-southeast-3|ap-southeast-4|ca-central-1|cn-north-1|cn-northwest-1|eu-central-1|eu-central-2|eu-north-1|eu-south-1|eu-south-2|eu-west-1|eu-west-2|eu-west-3|me-central-1|me-south-1|sa-east-1|us-east-1|us-east-2|us-gov-east-1|us-gov-west-1|us-west-1|us-west-2)\b,{0,1})*)$'
459+
ConstraintDescription:
460+
For AWS Control Tower, set to ct-regions (default). If not using AWS Control Tower, specify comma separated list of regions (e.g. us-west-2,us-east-1,ap-south-1) in lower case.
461+
Default: ct-regions
462+
Description: AWS regions (comma separated) if not using AWS Control Tower (leave set to ct-regions for AWS Control Tower environments)
463+
Type: String
464+
pSecurityAccountId:
465+
AllowedPattern: '^\d{12}$'
466+
Default: 111111111111
467+
ConstraintDescription: Must be 12 digits.
468+
Description: AWS Account ID of the Security Tooling account (ignored for AWS Control Tower environments).
469+
Type: String
470+
pLogArchiveAccountId:
471+
AllowedPattern: '^\d{12}$'
472+
Default: 222222222222
473+
ConstraintDescription: Must be 12 digits.
474+
Description: AWS Account ID of the Log Archive account (ignored for AWS Control Tower environments).
475+
Type: String
414476
pSRASolutionName:
415477
AllowedValues: [sra-common-prerequisites]
416478
Default: sra-common-prerequisites
@@ -918,6 +980,16 @@ Parameters:
918980
MaxValue: 128
919981
MinValue: 6
920982
Type: Number
983+
pEnableNISTStandard:
984+
AllowedValues: ['true', 'false']
985+
Default: 'false'
986+
Description: Indicates whether to enable the National Institute of Standards and Technology (NIST) SP 800-53 Rev. 5.
987+
Type: String
988+
pNISTStandardVersion:
989+
AllowedValues: [5.0.0]
990+
Default: 5.0.0
991+
Description: NIST Standard Version
992+
Type: String
921993
pOperationsContactAction:
922994
AllowedValues: ['add', 'delete', 'ignore']
923995
Default: add
@@ -1182,8 +1254,10 @@ Resources:
11821254
Value: !Ref AWS::Region
11831255
- Name: AWS_ACCOUNT_ID
11841256
Value: !Ref "AWS::AccountId"
1185-
- Name: SRA_DEPLOY_GUARDDUTY
1186-
Value: !Ref pDeployGuardDutySolution
1257+
- Name: SRA_REPO_URL
1258+
Value: !Ref pRepoURL
1259+
- Name: SRA_REPO_BRANCH_NAME
1260+
Value: !Ref pRepoBranch
11871261
- Name: SRA_STAGING_S3_BUCKET_STACK_NAME
11881262
Value: !Ref pSRAStagingS3BucketStackName
11891263
Image: "aws/codebuild/standard:5.0"
@@ -1202,16 +1276,18 @@ Resources:
12021276
build:
12031277
commands:
12041278
- echo Build started on `date` in ${AWS::Region} region
1205-
- echo Cloning SRA repository...
1206-
- git clone https://github.com/aws-samples/aws-security-reference-architecture-examples.git
1279+
- echo Cloning SRA code repository from $SRA_REPO_URL...
1280+
- git clone $SRA_REPO_URL
12071281
- echo Listing current directory...
12081282
- ls
1283+
- cd aws-security-reference-architecture-examples
1284+
- git checkout $SRA_REPO_BRANCH_NAME
12091285
- echo Showing current caller identity...
12101286
- aws sts get-caller-identity
12111287
- echo Deploying SRA staging bucket cloudformation template...
1212-
- aws cloudformation deploy --template-file ./aws-security-reference-architecture-examples/aws_sra_examples/solutions/common/common_prerequisites/templates/sra-common-prerequisites-staging-s3-bucket.yaml --stack-name $SRA_STAGING_S3_BUCKET_STACK_NAME --capabilities CAPABILITY_NAMED_IAM
1288+
- aws cloudformation deploy --template-file ./aws_sra_examples/solutions/common/common_prerequisites/templates/sra-common-prerequisites-staging-s3-bucket.yaml --stack-name $SRA_STAGING_S3_BUCKET_STACK_NAME --capabilities CAPABILITY_NAMED_IAM
12131289
- echo Staging SRA solutions...
1214-
- ./aws-security-reference-architecture-examples/aws_sra_examples/utils/packaging_scripts/stage_solution.sh
1290+
- ./aws_sra_examples/utils/packaging_scripts/stage_solution.sh
12151291
post_build:
12161292
commands:
12171293
- echo Build completed on `date`
@@ -1228,6 +1304,11 @@ Resources:
12281304
Tags:
12291305
- Key: sra-solution
12301306
Value: !Ref pSRASolutionName
1307+
Parameters:
1308+
pControlTower: !Ref pControlTower
1309+
pGovernedRegions: !Ref pGovernedRegions
1310+
pSecurityAccountId: !Ref pSecurityAccountId
1311+
pLogArchiveAccountId: !Ref pLogArchiveAccountId
12311312

12321313
rCommonPrerequisitesMainSsm:
12331314
Type: AWS::CloudFormation::Stack
@@ -1243,6 +1324,7 @@ Resources:
12431324
Value: !Ref pSRASolutionName
12441325
Parameters:
12451326
pCreateAWSControlTowerExecutionRole: !Ref pCreateAWSControlTowerExecutionRole
1327+
pControlTower: !Ref pControlTower
12461328

12471329
rCodeBuildRole:
12481330
Type: AWS::IAM::Role
@@ -1979,6 +2061,8 @@ Resources:
19792061
pSourceStackName: !If [cDeployConfigManagementSolution, !Ref rConfigManagementSolutionStack, '']
19802062
pSRAAlarmEmail: !Ref pSRAAlarmEmail
19812063
# pSRAStagingS3BucketName: !Ref pSRAStagingS3BucketName
2064+
pEnableNISTStandard: !Ref pEnableNISTStandard
2065+
pNISTStandardVersion: !Ref pNISTStandardVersion
19822066

19832067

19842068
rInspectorSolutionStack:

aws_sra_examples/solutions/cloudtrail/cloudtrail_org/templates/sra-cloudtrail-org-main-ssm.yaml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ Metadata:
2424
- pAuditAccountId
2525
- pLogArchiveAccountId
2626
- pOrganizationId
27+
28+
- Label:
29+
default: IAM Properties
30+
Parameters:
31+
- pStackSetAdminRole
32+
- pStackExecutionRole
33+
2734
- Label:
2835
default: CloudTrail Logging & Encryption Properties
2936
Parameters:
@@ -48,6 +55,10 @@ Metadata:
4855
- pLambdaLogLevel
4956

5057
ParameterLabels:
58+
pStackSetAdminRole:
59+
default: Stack Set Role
60+
pStackExecutionRole:
61+
default: Stack execution role
5162
pAuditAccountId:
5263
default: Audit Account ID
5364
pBucketNamePrefix:
@@ -88,6 +99,16 @@ Metadata:
8899
default: SRA Staging S3 Bucket Name
89100

90101
Parameters:
102+
pStackSetAdminRole:
103+
AllowedValues: [sra-stackset]
104+
Default: sra-stackset
105+
Description: The administration role name that is used in the stackset.
106+
Type: String
107+
pStackExecutionRole:
108+
AllowedValues: [sra-execution]
109+
Default: sra-execution
110+
Description: The execution role name that is used in the stack.
111+
Type: String
91112
pAuditAccountId:
92113
AllowedPattern: ^([\w.-]{1,900})$|^(\/[\w.-]{1,900})*[\w.-]{1,900}$
93114
ConstraintDescription:
@@ -213,10 +234,10 @@ Resources:
213234
Type: AWS::CloudFormation::StackSet
214235
Properties:
215236
StackSetName: sra-cloudtrail-org-kms
216-
AdministrationRoleARN: !Sub arn:${AWS::Partition}:iam::${AWS::AccountId}:role/service-role/AWSControlTowerStackSetRole
237+
AdministrationRoleARN: !Sub arn:${AWS::Partition}:iam::${AWS::AccountId}:role/${pStackSetAdminRole}
217238
CallAs: SELF
218239
Description: !Sub ${pSRASolutionVersion} - Creates a KMS key within the Audit account for encrypting CloudTrail logs.
219-
ExecutionRoleName: AWSControlTowerExecution
240+
ExecutionRoleName: !Ref pStackExecutionRole
220241
ManagedExecution:
221242
Active: true
222243
OperationPreferences:
@@ -249,10 +270,10 @@ Resources:
249270
Type: AWS::CloudFormation::StackSet
250271
Properties:
251272
StackSetName: sra-cloudtrail-org-bucket
252-
AdministrationRoleARN: !Sub arn:${AWS::Partition}:iam::${AWS::AccountId}:role/service-role/AWSControlTowerStackSetRole
273+
AdministrationRoleARN: !Sub arn:${AWS::Partition}:iam::${AWS::AccountId}:role/${pStackSetAdminRole}
253274
CallAs: SELF
254275
Description: !Sub ${pSRASolutionVersion} - Creates a S3 bucket within the Log Archive account for storing CloudTrail logs.
255-
ExecutionRoleName: AWSControlTowerExecution
276+
ExecutionRoleName: !Ref pStackExecutionRole
256277
ManagedExecution:
257278
Active: true
258279
OperationPreferences:

0 commit comments

Comments
 (0)