-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ASH, Bandit and CDK Nag (#530)
### Feature or Bugfix - Feature ### Detail Add ASH, Bandit and CDK Nag security checks. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Co-authored-by: dlpzx <[email protected]>
- Loading branch information
Showing
7 changed files
with
125 additions
and
11 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,30 @@ | ||
name: ASH | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
ash: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.8] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install | ||
run: git clone https://github.com/aws-samples/automated-security-helper.git /tmp/ash | ||
- name: ASH | ||
run: /tmp/ash/ash --source-dir . | ||
- name: Upload Artifact | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ash-report | ||
path: aggregated_results.txt |
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,32 @@ | ||
name: Bandit | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
bandit: | ||
strategy: | ||
matrix: | ||
python-version: [3.8] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install bandit | ||
- name: Bandit | ||
run: bandit -r -lll -ii . |
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,52 @@ | ||
name: CDK Nag | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
paths: | ||
- "deploy/**" | ||
branches: | ||
- main | ||
pull_request: | ||
paths: | ||
- "deploy/**" | ||
branches: | ||
- main | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
cdk-nag: | ||
strategy: | ||
matrix: | ||
python-version: [3.8] | ||
env: | ||
AWS_DEFAULT_REGION: us-east-1 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Git clone | ||
uses: actions/checkout@v3 | ||
- name: configure aws credentials | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
role-to-assume: arn:aws:iam::020286015001:role/aws-dataall-github-actions | ||
role-session-name: dataall-gh-act | ||
aws-region: ${{ env.AWS_DEFAULT_REGION }} | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
- name: Install CDK | ||
run: | | ||
npm install -g aws-cdk cdk-nag | ||
cdk --version | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Upgrade Pip | ||
run: python -m pip install --upgrade pip | ||
- name: Install Requirements | ||
run: python -m pip install -r deploy/requirements.txt | ||
- name: CDK Synth | ||
run: npx cdk synth |
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
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
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
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