Skip to content

Commit f6e02c1

Browse files
authored
Merge pull request #30 from aws-samples/feature/refactor-config-conformance-pack-org
Refactor Config Conformance Pack Solution Issue #28
2 parents 649819e + 01738e4 commit f6e02c1

18 files changed

+425
-279
lines changed

solutions/config/conformance-pack-org/README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ is not supported by CloudFormation (November 2020)
5555

5656
* Lambda Function Name = [Prefix]-config-register-delegated-admin
5757
* Environment Variables (Configurable and set via CloudFormation)
58+
* AWS_SERVICE_PRINCIPAL - AWS service principal to delegate administration for
5859
* DELEGATED_ADMIN_ACCOUNT_ID - Organization Member Account ID which is typically the Security account
59-
* LOG_LEVEL - Default = info, Valid Values = info, warning, error, critical
60+
* LOG_LEVEL - Default = info, Valid Values = debug, info, warning, error, critical
6061
* TAG_KEY1 - Tags the IAM role and Lambda Function with this key
6162
* TAG_VALUE1 - Tags the IAM role and Lambda Function with this value
6263

@@ -212,20 +213,20 @@ get started and to evaluate your AWS environment, use one of the sample conforma
212213

213214
#### Pre-requisites
214215
1. Create AWS Config Conformance Pack Templates S3 Bucket in the Security Tooling Account
215-
* Create an SSM parameter in the Organization Primary Account (Optional)
216+
* Create an SSM parameter in the Organization Management Account (Optional)
216217
* CloudFormation template to create the S3 bucket - documentation/setup/create-conformance-pack-templates-bucket.yaml
217218
2. Upload documentation/setup/conformance-pack-templates/aws-control-tower-detective-guardrails.yaml to the AWS Config
218219
Conformance Pack Templates S3 Bucket
219220

220221
#### Instructions
221222

222223
> **Solution Deployment Order:**
223-
> 1. Primary Account (ConformancePackDelegatedAdmin)
224+
> 1. Management Account (ConformancePackDelegatedAdmin)
224225
> 2. Log-Archive Account (ConformancePackDeliveryBucket)
225226
> 3. Security Account (ConformancePackDeployment)
226227
227-
1. Create new or use an existing S3 bucket within the deployment region owned by the Organization Primary Account
228-
* Example bucket name: lambda-zips-[Primary Account ID]-[AWS region]
228+
1. Create new or use an existing S3 bucket within the deployment region owned by the Organization Management Account
229+
* Example bucket name: lambda-zips-[Management Account ID]-[AWS region]
229230
* [Example CloudFormation Template](../../../extras/lambda-s3-buckets.yaml)
230231
* Each bucket must allow the s3:GetObject action to the AWS Organization using a bucket policy like the one below
231232
to allow the accounts within the Organization to get the Lambda files.
@@ -254,7 +255,7 @@ get started and to evaluate your AWS environment, use one of the sample conforma
254255
255256
| Account | StackSet Name | Template |
256257
| --------------- | ----------------- | ---------- |
257-
| Primary | ConformancePackDelegatedAdmin | templates/conformance-pack-org-register-delegated-admin.yaml |
258+
| Management | ConformancePackDelegatedAdmin | templates/conformance-pack-org-register-delegated-admin.yaml |
258259
| Log Archive | ConformancePackDeliveryBucket | templates/conformance-pack-org-delivery-bucket.yaml |
259260
| Security | ConformancePackDeployment | templates/conformance-pack-org-deployment.yaml |
260261

solutions/config/conformance-pack-org/aws-control-tower/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-
77
1. Make sure the required [prerequisites](../../../../extras/aws-control-tower/prerequisites/README.md) are completed
88
2. Verify that all accounts in the organization have an AWS Configuration Recorder
99
* Run the [list-config-recorder-status.py](../../../../extras/aws-control-tower/helper-scripts/list-config-recorder-status.py)
10-
within the Organization Primary account to get the list of accounts.
10+
within the Organization Management account to get the list of accounts.
1111
* Include the Account IDs without an AWS Configuration Recorder in the pExcludedAccounts parameter
12-
3. Create the Conformance Pack Template S3 bucket within the Audit account using the
12+
3. Create the Conformance Pack Template S3 bucket within the Security Tooling account using the
1313
[create-conformance-pack-templates-bucket.yaml](../documentation/setup/create-conformance-pack-templates-bucket.yaml)
1414
template
1515
4. Upload the [Operational-Best-Practices-for-Encryption-and-Keys.yaml](../documentation/setup/conformance-pack-templates/Operational-Best-Practices-for-Encryption-and-Keys.yaml)
1616
conformance pack template to the Conformance Pack Template S3 bucket created above.
17-
5. Add the /org/config/conformance_pack_templates_bucket SSM Parameter in the Primary account
17+
5. Add the /org/config/conformance_pack_templates_bucket SSM Parameter in the Management account
1818
```
1919
aws ssm put-parameter \
2020
--name /org/config/conformance_pack_templates_bucket \
@@ -35,7 +35,7 @@ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-
3535
8. Update the manifest.yaml file with your account names
3636
9. Deploy the Customizations for AWS Control Tower configuration
3737
10. How to verify after the pipeline completes?
38-
1. Log into the Audit account and navigate to the AWS Config page
38+
1. Log into the Security Tooling account and navigate to the AWS Config page
3939
2. Verify the correct configurations have been applied to each region
4040
1. Conformance packs -> OrgConformsPack-Operational-Best-Practices-for-Encryption-and-Keys-* created in each region
4141
2. Settings -> Delivery location set to the awsconfigconforms-[Log Archive Account ID]-[Region]
@@ -47,6 +47,6 @@ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-
4747
1. Remove the Conformance Pack configurations from the manifest.yaml file
4848
2. (Optional) Delete the parameter and template files for the Conformance Pack solution
4949
2. Deploy the Customizations for AWS Control Tower configuration
50-
3. After the pipeline completes, log into the Primary account and navigate to the CloudFormation page
50+
3. After the pipeline completes, log into the Management account and navigate to the CloudFormation page
5151
1. Delete the CustomControlTower-ConformancePack* CloudFormation StackSets
5252

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
#Default region for deploying Custom Control Tower: Code Pipeline, Step functions, Lambda, SSM parameters, and StackSets
3+
region: us-east-1
4+
version: 2021-03-15
5+
6+
# Control Tower Custom Resources (Service Control Policies or CloudFormation)
7+
resources:
8+
# -----------------------------------------------------------------------------
9+
# Organization Config Conformance Pack
10+
# -----------------------------------------------------------------------------
11+
- name: ConformancePackDelegatedAdmin
12+
resource_file: templates/conformance-pack-org-register-delegated-admin.yaml
13+
parameters:
14+
- parameter_key: pDefaultLogGroupRetention
15+
parameter_value: "30"
16+
- parameter_key: pDelegatedAdminAccountId
17+
parameter_value: $[alfred_ssm_/org/member/Audit/account_id]
18+
- parameter_key: pLambdaExecutionRoleName
19+
parameter_value: cfct-config-register-delegated-admin-lambda
20+
- parameter_key: pLambdaFunctionName
21+
parameter_value: cfct-config-register-delegated-admin
22+
- parameter_key: pLambdaS3BucketName
23+
parameter_value: $[alfred_ssm_/org/primary/lambda_zips_bucket/us-east-1]
24+
- parameter_key: pLambdaZipFileName
25+
parameter_value: organization-register-delegated-admin.zip
26+
- parameter_key: pLogLevel
27+
parameter_value: info
28+
- parameter_key: pTagKey1
29+
parameter_value: cfct
30+
- parameter_key: pTagValue1
31+
parameter_value: managed-by-cfct
32+
deploy_method: stack_set
33+
deployment_targets:
34+
accounts:
35+
- Control Tower Management
36+
37+
- name: ConformancePackDeliveryBucket
38+
resource_file: templates/conformance-pack-org-delivery-bucket.yaml
39+
parameters:
40+
- parameter_key: pOrganizationId
41+
parameter_value: $[alfred_ssm_/org/primary/organization_id]
42+
- parameter_key: pTagKey1
43+
parameter_value: cfct
44+
- parameter_key: pTagValue1
45+
parameter_value: managed-by-cfct
46+
deploy_method: stack_set
47+
deployment_targets:
48+
accounts:
49+
- Log archive
50+
export_outputs:
51+
- name: /org/config/conformance_pack_delivery_bucket
52+
value: $[output_oConformancePackDeliveryBucket]
53+
54+
- name: ConformancePackDeployment
55+
resource_file: templates/conformance-pack-org-deployment.yaml
56+
parameters:
57+
- parameter_key: pConformancePackName
58+
parameter_value: Operational-Best-Practices-for-Encryption-and-Keys
59+
- parameter_key: pDeliveryBucketName
60+
parameter_value: $[alfred_ssm_/org/config/conformance_pack_delivery_bucket]
61+
- parameter_key: pDeliveryS3KeyPrefix
62+
parameter_value: Config
63+
- parameter_key: pExcludedAccounts
64+
parameter_value: $[alfred_ssm_/org/member/Control-Tower-Management/account_id]
65+
- parameter_key: pTemplateBucketName
66+
parameter_value: $[alfred_ssm_/org/config/conformance_pack_templates_bucket]
67+
- parameter_key: pTemplatePrefix
68+
parameter_value: Operational-Best-Practices-for-Encryption-and-Keys.yaml
69+
deploy_method: stack_set
70+
deployment_targets:
71+
accounts:
72+
- Audit
73+
regions:
74+
- ap-southeast-2
75+
- eu-west-1
76+
- us-east-1
77+
- us-east-2
78+
- us-west-2

solutions/config/conformance-pack-org/aws-control-tower/manifest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ cloudformation_resources:
1313
parameter_file: parameters/conformance-pack-org-register-delegated-admin.json
1414
deploy_method: stack_set
1515
deploy_to_account:
16-
- Control Tower Primary
16+
- Control Tower Management
1717

1818
- name: ConformancePackDeliveryBucket
1919
template_file: templates/conformance-pack-org-delivery-bucket.yaml

solutions/config/conformance-pack-org/aws-control-tower/parameters/conformance-pack-org-delivery-bucket.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
},
66
{
77
"ParameterKey": "pTagKey1",
8-
"ParameterValue": "control-tower"
8+
"ParameterValue": "cfct"
99
},
1010
{
1111
"ParameterKey": "pTagValue1",
12-
"ParameterValue": "managed-by-control-tower"
12+
"ParameterValue": "managed-by-cfct"
1313
}
1414
]
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
[
22
{
33
"ParameterKey": "pConformancePackName",
4-
"ParameterValue": "control-tower-detective-guardrails"
5-
},
6-
{
7-
"ParameterKey": "pTemplateBucketName",
8-
"ParameterValue": "$[alfred_ssm_/org/config/conformance_pack_templates_bucket]"
9-
},
10-
{
11-
"ParameterKey": "pTemplatePrefix",
12-
"ParameterValue": "aws-control-tower-detective-guardrails.yaml"
4+
"ParameterValue": "Operational-Best-Practices-for-Encryption-and-Keys"
135
},
146
{
157
"ParameterKey": "pDeliveryBucketName",
@@ -21,6 +13,14 @@
2113
},
2214
{
2315
"ParameterKey": "pExcludedAccounts",
24-
"ParameterValue": "$[alfred_ssm_/org/member/Control-Tower-Primary/account_id]"
16+
"ParameterValue": "$[alfred_ssm_/org/member/Control-Tower-Management/account_id]"
17+
},
18+
{
19+
"ParameterKey": "pTemplateBucketName",
20+
"ParameterValue": "$[alfred_ssm_/org/config/conformance_pack_templates_bucket]"
21+
},
22+
{
23+
"ParameterKey": "pTemplatePrefix",
24+
"ParameterValue": "Operational-Best-Practices-for-Encryption-and-Keys.yaml"
2525
}
2626
]
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
[
22
{
3-
"ParameterKey": "pLambdaFunctionName",
4-
"ParameterValue": "control-tower-config-register-delegated-admin"
3+
"ParameterKey": "pDefaultLogGroupRetention",
4+
"ParameterValue": "30"
55
},
66
{
7-
"ParameterKey": "pLambdaS3BucketName",
8-
"ParameterValue": "$[alfred_ssm_/org/primary/lambda_zips_bucket/us-east-1]"
7+
"ParameterKey": "pDelegatedAdminAccountId",
8+
"ParameterValue": "$[alfred_ssm_/org/member/Audit/account_id]"
99
},
1010
{
11-
"ParameterKey": "pLambdaZipFileName",
12-
"ParameterValue": "organization-register-delegated-admin-v1.zip"
11+
"ParameterKey": "pLambdaExecutionRoleName",
12+
"ParameterValue": "cfct-config-register-delegated-admin-lambda"
1313
},
1414
{
15-
"ParameterKey": "pDelegatedAdminAccountId",
16-
"ParameterValue": "$[alfred_ssm_/org/member/Audit/account_id]"
15+
"ParameterKey": "pLambdaFunctionName",
16+
"ParameterValue": "cfct-config-register-delegated-admin"
1717
},
1818
{
19-
"ParameterKey": "pLogLevel",
20-
"ParameterValue": "info"
19+
"ParameterKey": "pLambdaS3BucketName",
20+
"ParameterValue": "$[alfred_ssm_/org/primary/lambda_zips_bucket/us-east-1]"
2121
},
2222
{
23-
"ParameterKey": "pDefaultLogGroupRetention",
24-
"ParameterValue": "30"
23+
"ParameterKey": "pLambdaZipFileName",
24+
"ParameterValue": "organization-register-delegated-admin.zip"
2525
},
2626
{
27-
"ParameterKey": "pLambdaExecutionRoleName",
28-
"ParameterValue": "control-tower-config-register-delegated-admin-lambda"
27+
"ParameterKey": "pLogLevel",
28+
"ParameterValue": "info"
2929
},
3030
{
3131
"ParameterKey": "pTagKey1",
32-
"ParameterValue": "control-tower"
32+
"ParameterValue": "cfct"
3333
},
3434
{
3535
"ParameterKey": "pTagValue1",
36-
"ParameterValue": "managed-by-control-tower"
36+
"ParameterValue": "managed-by-cfct"
3737
}
3838
]

solutions/config/conformance-pack-org/aws-landing-zone/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,18 @@ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-
77
1. Create AWS Config Conformance Pack Templates S3 Bucket in the Security Tooling Account
88
* Create an SSM parameter in the Organization Master account (Optional)
99
* CloudFormation template to create the S3 bucket - documentation/setup/create-conformance-pack-templates-bucket.yaml
10-
2. Upload documentation/setup/conformance-pack-templates/aws-control-tower-detective-guardrails.yaml to the AWS Config Conformance Pack Templates S3 Bucket
10+
2. Upload documentation/setup/conformance-pack-templates/aws-control-tower-detective-guardrails.yaml to the AWS Config
11+
Conformance Pack Templates S3 Bucket
1112

1213
### Instructions
1314

1415
> **Core accounts within the manifest.yaml must be listed in the following order for this solution to work:**
15-
> 1. primary (ConformancePackDelegatedAdmin)
16+
> 1. management (ConformancePackDelegatedAdmin)
1617
> 2. log-archive (ConformancePackDeliveryBucket)
1718
> 3. security (ConformancePackDeployment)
1819
19-
1. Create new or use an existing S3 bucket within the ALZ region owned by the Organization Primary Account
20-
* Example bucket name: lambda-zips-[Primary Account ID]-[ALZ Region]
20+
1. Create new or use an existing S3 bucket within the ALZ region owned by the Organization Management Account
21+
* Example bucket name: lambda-zips-[Management Account ID]-[ALZ Region]
2122
* [Example CloudFormation Template](../../../../extras/lambda-s3-buckets.yaml)
2223
* Each bucket must allow the s3:GetObject action to the AWS Organization using a bucket policy like the one below
2324
to allow the accounts within the Organization to get the Lambda files.
@@ -55,7 +56,7 @@ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-
5556
5. Update the parameter files with any specific values for your AWS Landing Zone implementation
5657
6. Update the add_on_manifest.yaml with OU and accounts for your AWS Landing Zone implementation
5758
7. Update the manifest.yaml file so that the core accounts are listed in this order:
58-
1. primary
59+
1. management
5960
2. log-archive
6061
3. security
6162
* Reason: The AWS Landing Zone deploys resources for the core accounts in the order that they are listed within

solutions/config/conformance-pack-org/aws-landing-zone/parameters/conformance-pack-org-deployment.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
"ParameterKey": "pConformancePackName",
44
"ParameterValue": "control-tower-detective-guardrails"
55
},
6-
{
7-
"ParameterKey": "pTemplateBucketName",
8-
"ParameterValue": "$[alfred_ssm_/org/config/conformance_pack_templates_bucket]"
9-
},
10-
{
11-
"ParameterKey": "pTemplatePrefix",
12-
"ParameterValue": "aws-control-tower-detective-guardrails.yaml"
13-
},
146
{
157
"ParameterKey": "pDeliveryBucketName",
168
"ParameterValue": "$[alfred_ssm_/org/config/conformance_pack_delivery_bucket]"
@@ -22,5 +14,13 @@
2214
{
2315
"ParameterKey": "pExcludedAccounts",
2416
"ParameterValue": ""
17+
},
18+
{
19+
"ParameterKey": "pTemplateBucketName",
20+
"ParameterValue": "$[alfred_ssm_/org/config/conformance_pack_templates_bucket]"
21+
},
22+
{
23+
"ParameterKey": "pTemplatePrefix",
24+
"ParameterValue": "aws-control-tower-detective-guardrails.yaml"
2525
}
2626
]

solutions/config/conformance-pack-org/aws-landing-zone/parameters/conformance-pack-org-register-delegated-admin.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
[
2+
{
3+
"ParameterKey": "pDefaultLogGroupRetention",
4+
"ParameterValue": "30"
5+
},
6+
{
7+
"ParameterKey": "pDelegatedAdminAccountId",
8+
"ParameterValue": "$[alfred_ssm_/org/member/security/account_id]"
9+
},
10+
{
11+
"ParameterKey": "pLambdaExecutionRoleName",
12+
"ParameterValue": "aws-landing-zone-config-register-delegated-admin-lambda"
13+
},
214
{
315
"ParameterKey": "pLambdaFunctionName",
416
"ParameterValue": "aws-landing-zone-config-register-delegated-admin"
@@ -11,22 +23,10 @@
1123
"ParameterKey": "pLambdaZipFileName",
1224
"ParameterValue": "organization-register-delegated-admin-v1.zip"
1325
},
14-
{
15-
"ParameterKey": "pDelegatedAdminAccountId",
16-
"ParameterValue": "$[alfred_ssm_/org/member/security/account_id]"
17-
},
1826
{
1927
"ParameterKey": "pLogLevel",
2028
"ParameterValue": "info"
2129
},
22-
{
23-
"ParameterKey": "pDefaultLogGroupRetention",
24-
"ParameterValue": "30"
25-
},
26-
{
27-
"ParameterKey": "pLambdaExecutionRoleName",
28-
"ParameterValue": "aws-landing-zone-config-register-delegated-admin-lambda"
29-
},
3030
{
3131
"ParameterKey": "pTagKey1",
3232
"ParameterValue": "aws-landing-zone"

0 commit comments

Comments
 (0)