-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(CG-1291): add gcp cis 130 boilerplate
- Loading branch information
1 parent
2f8b0c7
commit f7d6418
Showing
9 changed files
with
209 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
rules/ | ||
tests/ | ||
*.bak | ||
.* | ||
jest.config.js | ||
tsconfig.json | ||
**/*.ts | ||
!dist/**/*.d.ts | ||
!dist/**/*.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
branches: | ||
- name: alpha | ||
channel: alpha | ||
prerelease: true | ||
- name: beta | ||
channel: beta | ||
prerelease: true | ||
- name: main | ||
|
||
dryRun: false | ||
|
||
plugins: | ||
- "@semantic-release/commit-analyzer" | ||
- "@semantic-release/release-notes-generator" | ||
- - "@semantic-release/changelog" | ||
- changelogFile: CHANGELOG.md | ||
- - "@semantic-release/git" | ||
- assets: | ||
- CHANGELOG.md | ||
- package.json | ||
- - "semantic-release-pnpm" | ||
- npmPublish: true | ||
- "@semantic-release/github" | ||
verifyConditions: | ||
- "@semantic-release/changelog" | ||
- "@semantic-release/github" | ||
- "semantic-release-pnpm" | ||
prepare: | ||
- "@semantic-release/changelog" | ||
- "semantic-release-pnpm" | ||
- - "@semantic-release/git" | ||
- message: "chore(release): @cloudgraph/policy-pack-gcp-cis-1.3.0 ${nextRelease.version} \n\n${nextRelease.notes}" | ||
publish: | ||
- "@semantic-release/github" | ||
- "semantic-release-pnpm" | ||
success: false | ||
fail: false | ||
tagFormat: "@cloudgraph/policy-pack-gcp-cis-1.3.0@${version}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
### Features | ||
|
||
### Bug Fixes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# CIS Google Cloud Platform Foundations 1.3.0 | ||
|
||
Policy Pack based on the GCP Foundations 1.3.0 benchmark provided by the [Center for Internet Security (CIS)](https://www.cisecurity.org/benchmark/google_cloud_computing_platform/) | ||
|
||
## First Steps | ||
|
||
1. Install [Cloud Graph CLI](https://docs.cloudgraph.dev/quick-start). | ||
2. Set up the [GCP Provider](https://www.npmjs.com/package/@cloudgraph/cg-provider-gcp) for CG with the `cg init gcp` command. | ||
3. Add Policy Pack for CIS Google Cloud Platform Foundations benchmark using `cg policy add gcp-cis-1.3.0` command. | ||
4. Execute the ruleset using the scan command `cg scan gcp`. | ||
5. Query the findings using the different options: | ||
|
||
5a. Querying findings by provider: | ||
|
||
```graphql | ||
query { | ||
querygcpFindings { | ||
CISFindings { | ||
id | ||
resourceId | ||
result | ||
} | ||
} | ||
} | ||
``` | ||
|
||
5b. Querying findings by specific benchmark: | ||
|
||
```graphql | ||
query { | ||
querygcpCISFindings { | ||
id | ||
resourceId | ||
result | ||
} | ||
} | ||
``` | ||
|
||
5c. Querying findings by resource: | ||
|
||
```graphql | ||
query { | ||
querygcpIamPolicy { | ||
id | ||
CISFindings { | ||
id | ||
resourceId | ||
result | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## Available Ruleset | ||
|
||
| Rule | Description | | ||
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import PolicyPacksRules from './rules' | ||
|
||
export default { | ||
provider: 'gcp', | ||
entity: 'CIS', | ||
rules: PolicyPacksRules, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** @type {import('@ts-jest/dist/types').InitialOptionsTsJest} */ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
testMatch: ['<rootDir>/tests/**/*.test.ts'], | ||
testPathIgnorePatterns: ['<rootDir>/lib/', '<rootDir>/node_modules/'], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
"name": "@cloudgraph/policy-pack-gcp-cis-1.3.0", | ||
"description": "Policy pack implementing CIS Google Cloud Platform Foundations 1.3.0 Benchmark", | ||
"version": "1.0.0", | ||
"author": "AutoCloud", | ||
"license": "MPL-2.0", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+/~https://github.com/cloudgraphdev/cloudgraph-policy-packs.git", | ||
"directory": "src/gcp/cis-1.2.0" | ||
}, | ||
"bugs": { | ||
"url": "/~https://github.com/cloudgraphdev/cloudgraph-policy-packs/issues" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"directories": { | ||
"test": "tests" | ||
}, | ||
"devDependencies": { | ||
"@autocloud/eslint-config": "^0.1.0", | ||
"@cloudgraph/sdk": "^0.21.1", | ||
"@types/jest": "^27.4.0", | ||
"@types/node": "^17.0.8", | ||
"@types/pino": "^6.3.11", | ||
"@typescript-eslint/eslint-plugin": "^4.28.5", | ||
"@typescript-eslint/parser": "^4.28.5", | ||
"cpx": "^1.5.0", | ||
"cuid": "^2.1.8", | ||
"eslint": "^7.25.0", | ||
"eslint-config-airbnb-base": "14.2.1", | ||
"eslint-config-prettier": "^6.11.0", | ||
"eslint-plugin-import": "^2.22.1", | ||
"eslint-plugin-prettier": "^3.4.0", | ||
"jest": "^27.0.6", | ||
"prettier": "^2.5.1", | ||
"shx": "^0.3.3", | ||
"ts-jest": "^27.0.4", | ||
"tslib": "^1", | ||
"typescript": "^4.3.5" | ||
}, | ||
"engines": { | ||
"node": ">=16.0.0" | ||
}, | ||
"homepage": "https://www.cloudgraph.dev/", | ||
"keywords": [ | ||
"cloudgraph" | ||
], | ||
"prettier": { | ||
"semi": false, | ||
"singleQuote": true, | ||
"arrowParens": "avoid" | ||
}, | ||
"scripts": { | ||
"build": "pnpm prepack", | ||
"clean": "rm -rf dist", | ||
"lint": "eslint", | ||
"prepack": "pnpm clean && tsc -b", | ||
"test": "NODE_ENV=test jest" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default [ | ||
|
||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"compilerOptions": { | ||
"declaration": true, | ||
"importHelpers": true, | ||
"module": "commonjs", | ||
"outDir": "dist", | ||
"rootDir": "./", | ||
"strict": true, | ||
"target": "es2020", | ||
"lib": ["esnext.array", "ES2020.Promise"], | ||
"allowSyntheticDefaultImports": true, | ||
"esModuleInterop": true, | ||
"skipLibCheck": true, | ||
"forceConsistentCasingInFileNames": true | ||
}, | ||
"include": [ | ||
"**/*" | ||
], | ||
"exclude": ["dist", "./tests"] | ||
} |