Skip to content

Commit 7c72840

Browse files
author
@tomnight
committed
Updated to v1.1.0
1 parent f2d5276 commit 7c72840

File tree

3 files changed

+124
-0
lines changed

3 files changed

+124
-0
lines changed

source/playbooks/CIS/bin/cis.ts

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#!/usr/bin/env node
2+
/*****************************************************************************
3+
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. *
4+
* *
5+
* Licensed under the Apache License, Version 2.0 (the "License"). You may *
6+
* not use this file except in compliance with the License. A copy of the *
7+
* License is located at *
8+
* *
9+
* http://www.apache.org/licenses/LICENSE-2.0 *
10+
* *
11+
* or in the 'license' file accompanying this file. This file is distributed *
12+
* on an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, *
13+
* express or implied. See the License for the specific language governing *
14+
* permissions and limitations under the License. *
15+
*****************************************************************************/
16+
import 'source-map-support/register';
17+
import * as cdk from '@aws-cdk/core';
18+
import { CisStack } from '../lib/cis-stack';
19+
import { CisPermissionsStack } from '../lib/cis-permissions-stack';
20+
21+
// SOLUTION_* - set by solution_env.sh
22+
const SOLUTION_ID = process.env['SOLUTION_ID'] || 'undefined';
23+
const SOLUTION_NAME = process.env['SOLUTION_NAME'] || 'undefined';
24+
// DIST_* - set by build-s3-dist.sh
25+
const DIST_VERSION = process.env['DIST_VERSION'] || '%%VERSION%%';
26+
const DIST_OUTPUT_BUCKET = process.env['DIST_OUTPUT_BUCKET'] || '%%BUCKET%%';
27+
const DIST_SOLUTION_NAME = process.env['DIST_SOLUTION_NAME'] || '%%SOLUTION%%';
28+
29+
const app = new cdk.App();
30+
31+
const cisStack = new CisStack(app, 'CisStack', {
32+
description: '(' + SOLUTION_ID + ') ' + SOLUTION_NAME +
33+
' CIS Compliance Pack, ' + DIST_VERSION,
34+
solutionId: SOLUTION_ID,
35+
solutionVersion: DIST_VERSION,
36+
solutionName: SOLUTION_NAME,
37+
solutionDistBucket: DIST_OUTPUT_BUCKET,
38+
solutionDistName: DIST_SOLUTION_NAME
39+
});
40+
41+
const cisPermStack = new CisPermissionsStack(app, 'CisPermissionsStack', {
42+
description: '(' + SOLUTION_ID + ') ' + SOLUTION_NAME +
43+
' CIS Compliance Pack Permissions, ' + DIST_VERSION,
44+
solutionId: SOLUTION_ID,
45+
solutionVersion: DIST_VERSION,
46+
solutionName: SOLUTION_NAME,
47+
solutionDistBucket: DIST_OUTPUT_BUCKET,
48+
solutionDistName: DIST_SOLUTION_NAME
49+
});
50+
51+
const stackMedata = {
52+
"AWS::CloudFormation::Interface": {
53+
"ParameterGroups": [
54+
{
55+
"Label": { "default": "Even if you do not enable fully automated remediation, you can still trigger a remediation action in the Security Hub console by selecting a specific finding, clicking the Action menu, and choosing the remediation action." },
56+
"Parameters": ["CIS1314AutoRemediation", "CIS15111AutoRemediation", "CIS22AutoRemediation", "CIS23AutoRemediation",
57+
"CIS24AutoRemediation", "CIS26AutoRemediation", "CIS28AutoRemediation", "CIS29AutoRemediation",
58+
"CIS4142AutoRemediation", "CIS43AutoRemediation"]
59+
}
60+
],
61+
}
62+
}
63+
64+
cisStack.templateOptions.metadata = stackMedata;
65+
66+
cisStack.templateOptions.templateFormatVersion = "2010-09-09"
67+
cisPermStack.templateOptions.templateFormatVersion = "2010-09-09"
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/usr/bin/env node
2+
/*****************************************************************************
3+
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. *
4+
* *
5+
* Licensed under the Apache License, Version 2.0 (the "License"). You may *
6+
* not use this file except in compliance with the License. A copy of the *
7+
* License is located at *
8+
* *
9+
* http://www.apache.org/licenses/LICENSE-2.0 *
10+
* *
11+
* or in the 'license' file accompanying this file. This file is distributed *
12+
* on an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, *
13+
* express or implied. See the License for the specific language governing *
14+
* permissions and limitations under the License. *
15+
*****************************************************************************/
16+
17+
import 'source-map-support/register';
18+
import * as cdk from '@aws-cdk/core';
19+
import { SolutionDeployStack } from '../lib/solution_deploy-stack';
20+
import { ServiceCatalogStack } from '../lib/service_catalog-stack';
21+
22+
const SOLUTION_ID = process.env['SOLUTION_ID'] || 'unknown';
23+
const SOLUTION_NAME = process.env['SOLUTION_NAME'] || 'unknown';
24+
const SOLUTION_VERSION = process.env['DIST_VERSION'] || '%%VERSION%%';
25+
const SOLUTION_TMN = process.env['SOLUTION_TRADEMARKEDNAME'] || 'unknown';
26+
const SOLUTION_BUCKET = process.env['DIST_OUTPUT_BUCKET'] || 'unknown';
27+
28+
const app = new cdk.App();
29+
30+
const solStack = new SolutionDeployStack(app, 'SolutionDeployStack', {
31+
description: '(' + SOLUTION_ID + ') ' + SOLUTION_NAME + ' Master Stack, ' + SOLUTION_VERSION,
32+
solutionId: SOLUTION_ID,
33+
solutionVersion: SOLUTION_VERSION,
34+
solutionDistBucket: SOLUTION_BUCKET,
35+
solutionTMN: SOLUTION_TMN,
36+
solutionName: SOLUTION_NAME
37+
});
38+
39+
const catStack = new ServiceCatalogStack(app, 'ServiceCatalogStack', {
40+
description: '(' + SOLUTION_ID + ') ' + SOLUTION_NAME + ' Service Catalog Stack, ' + SOLUTION_VERSION,
41+
solutionId: SOLUTION_ID,
42+
solutionVersion: SOLUTION_VERSION,
43+
solutionDistBucket: SOLUTION_BUCKET,
44+
solutionTMN: SOLUTION_TMN,
45+
solutionName: SOLUTION_NAME
46+
});
47+
48+
solStack.templateOptions.templateFormatVersion = "2010-09-09"
49+
catStack.templateOptions.templateFormatVersion = "2010-09-09"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/root/.pyenv/versions/3.8.1/bin/python3.8
2+
# -*- coding: utf-8 -*-
3+
import re
4+
import sys
5+
from chardet.cli.chardetect import main
6+
if __name__ == '__main__':
7+
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
8+
sys.exit(main())

0 commit comments

Comments
 (0)