Skip to content

Commit 9c1d6f3

Browse files
feat(CG-1290): create boilerplate for aws cis 1.5.0
1 parent 2f8b0c7 commit 9c1d6f3

9 files changed

Lines changed: 213 additions & 0 deletions

File tree

src/aws/cis-1.5.0/.npmignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
rules/
2+
tests/
3+
*.bak
4+
.*
5+
jest.config.js
6+
tsconfig.json
7+
**/*.ts
8+
!dist/**/*.d.ts
9+
!dist/**/*.js

src/aws/cis-1.5.0/.releaserc.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
branches:
3+
- name: alpha
4+
channel: alpha
5+
prerelease: true
6+
- name: beta
7+
channel: beta
8+
prerelease: true
9+
- name: main
10+
11+
dryRun: false
12+
13+
plugins:
14+
- "@semantic-release/commit-analyzer"
15+
- "@semantic-release/release-notes-generator"
16+
- - "@semantic-release/changelog"
17+
- changelogFile: CHANGELOG.md
18+
- - "@semantic-release/git"
19+
- assets:
20+
- CHANGELOG.md
21+
- package.json
22+
- - "semantic-release-pnpm"
23+
- npmPublish: true
24+
- "@semantic-release/github"
25+
verifyConditions:
26+
- "@semantic-release/changelog"
27+
- "@semantic-release/github"
28+
- "semantic-release-pnpm"
29+
prepare:
30+
- "@semantic-release/changelog"
31+
- "semantic-release-pnpm"
32+
- - "@semantic-release/git"
33+
- message: "chore(release): @cloudgraph/policy-pack-aws-cis-1.5.0 ${nextRelease.version} \n\n${nextRelease.notes}"
34+
publish:
35+
- "@semantic-release/github"
36+
- "semantic-release-pnpm"
37+
success: false
38+
fail: false
39+
tagFormat: "@cloudgraph/policy-pack-aws-cis-1.5.0@${version}"

src/aws/cis-1.5.0/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### Bug Fixes
2+
3+
4+
### Features
5+

src/aws/cis-1.5.0/README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# CIS Amazon Web Services Foundations 1.5.0
2+
3+
Policy Pack based on the [AWS Foundations 1.5.0](https://docs.aws.amazon.com/audit-manager/latest/userguide/CIS-1-5.html) benchmark provided by the [Center for Internet Security (CIS)](https://www.cisecurity.org/benchmark/amazon_web_services/)
4+
5+
## First Steps
6+
7+
1. Install [Cloud Graph CLI](https://docs.cloudgraph.dev/quick-start).
8+
2. Set up the [AWS Provider](https://www.npmjs.com/package/@cloudgraph/cg-provider-aws) for CG with the `cg init aws` command.
9+
3. Add Policy Pack for CIS Amazon Web Services Foundations benchmark using `cg policy add aws-cis-1.5.0` command.
10+
4. Execute the ruleset using the scan command `cg scan aws`.
11+
5. Query the findings using the different options:
12+
13+
5a. Querying findings by provider:
14+
15+
```graphql
16+
query {
17+
queryawsFindings {
18+
CISFindings {
19+
id
20+
resourceId
21+
result
22+
}
23+
}
24+
}
25+
```
26+
27+
5b. Querying findings by specific benchmark:
28+
29+
```graphql
30+
query {
31+
queryawsCISFindings {
32+
id
33+
resourceId
34+
result
35+
}
36+
}
37+
```
38+
39+
5c. Querying findings by resource:
40+
41+
```graphql
42+
query {
43+
queryawsIamUser {
44+
id
45+
arn
46+
accountId
47+
CISFindings {
48+
id
49+
resourceId
50+
result
51+
}
52+
}
53+
}
54+
```
55+
56+
## Available Ruleset
57+
58+
| Rule | Description |
59+
| ------------- | --------------------------------------------------------------------------------------------------------------------------- |
60+

src/aws/cis-1.5.0/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import PolicyPacksRules from './rules'
2+
3+
export default {
4+
provider: 'aws',
5+
entity: 'CIS',
6+
rules: PolicyPacksRules,
7+
extraFields: ['arn', 'accountId'],
8+
}

src/aws/cis-1.5.0/jest.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/** @type {import('@ts-jest/dist/types').InitialOptionsTsJest} */
2+
module.exports = {
3+
preset: 'ts-jest',
4+
testEnvironment: 'node',
5+
testMatch: ['<rootDir>/tests/**/*.test.ts'],
6+
testPathIgnorePatterns: ['<rootDir>/lib/', '<rootDir>/node_modules/'],
7+
}

src/aws/cis-1.5.0/package.json

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"name": "@cloudgraph/policy-pack-aws-cis-1.5.0",
3+
"description": "Policy pack implementing CIS Amazon Web Services Foundations 1.5.0 Benchmark",
4+
"version": "0.3.0",
5+
"author": "AutoCloud",
6+
"license": "MPL-2.0",
7+
"main": "dist/index.js",
8+
"types": "dist/index.d.ts",
9+
"repository": {
10+
"type": "git",
11+
"url": "https://github.com/cloudgraphdev/cloudgraph-policy-packs.git",
12+
"directory": "src/aws/cis-1.5.0"
13+
},
14+
"bugs": {
15+
"url": "https://github.com/cloudgraphdev/cloudgraph-policy-packs/issues"
16+
},
17+
"publishConfig": {
18+
"access": "public"
19+
},
20+
"directories": {
21+
"test": "tests"
22+
},
23+
"devDependencies": {
24+
"@autocloud/eslint-config": "^0.1.0",
25+
"@cloudgraph/sdk": "^0.21.1",
26+
"@types/jest": "^27.0.3",
27+
"@types/node": "^15.12.4",
28+
"@types/pino": "^6.3.11",
29+
"@typescript-eslint/eslint-plugin": "^4.28.5",
30+
"@typescript-eslint/parser": "^4.28.5",
31+
"cpx": "^1.5.0",
32+
"cuid": "^2.1.8",
33+
"eslint": "^7.25.0",
34+
"eslint-config-airbnb-base": "14.2.1",
35+
"eslint-config-prettier": "^6.11.0",
36+
"eslint-plugin-import": "^2.22.1",
37+
"eslint-plugin-prettier": "^3.4.0",
38+
"jest": "^27.0.6",
39+
"prettier": "^2.4.1",
40+
"shx": "^0.3.3",
41+
"ts-jest": "^27.0.4",
42+
"tslib": "^1",
43+
"typescript": "^4.3.5"
44+
},
45+
"engines": {
46+
"node": ">=14.0.0"
47+
},
48+
"homepage": "https://www.cloudgraph.dev/",
49+
"keywords": [
50+
"cloudgraph"
51+
],
52+
"prettier": {
53+
"semi": false,
54+
"singleQuote": true
55+
},
56+
"scripts": {
57+
"build": "pnpm prepack",
58+
"clean": "rm -rf dist",
59+
"lint": "eslint",
60+
"prepack": "rm -rf dist && tsc -b",
61+
"test": "NODE_ENV=test jest"
62+
}
63+
}

src/aws/cis-1.5.0/rules/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export default [
2+
]

src/aws/cis-1.5.0/tsconfig.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"compilerOptions": {
3+
"declaration": true,
4+
"importHelpers": true,
5+
"module": "commonjs",
6+
"outDir": "dist",
7+
"rootDir": "./",
8+
"strict": true,
9+
"target": "es2020",
10+
"lib": ["esnext.array", "ES2020.Promise"],
11+
"allowSyntheticDefaultImports": true,
12+
"esModuleInterop": true,
13+
"skipLibCheck": true,
14+
"forceConsistentCasingInFileNames": true
15+
},
16+
"include": [
17+
"**/*"
18+
],
19+
"exclude": ["dist", "./tests"]
20+
}

0 commit comments

Comments
 (0)