Skip to content

Commit 9140677

Browse files
William ChrispJoshArmi
authored andcommitted
Add pip-audit workflow
1 parent 1e96b05 commit 9140677

File tree

7 files changed

+62
-20
lines changed

7 files changed

+62
-20
lines changed

.github/workflows/aws_cicd.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
name: aws-cicd
22
on:
3-
push:
4-
branches:
5-
- main
63
workflow_dispatch:
7-
pull_request:
4+
workflow_call:
85
concurrency:
96
group: "AWS"
10-
# cancel-in-progress: true
7+
cancel-in-progress: true
118
jobs:
129
deploy:
1310
name: AWS

.github/workflows/cicd.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: cicd
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
workflow_dispatch:
10+
11+
jobs:
12+
pip-audit:
13+
uses: ./.github/workflows/pip-audit.yaml
14+
15+
aws:
16+
uses: ./.github/workflows/aws_cicd.yaml
17+
needs: [pip-audit]
18+
19+
gcp:
20+
uses: ./.github/workflows/gcp_cicd.yaml
21+
secrets: inherit
22+
needs: [pip-audit]
23+
24+
# slsa:
25+
# uses: ./.github/workflows/provenance.yaml
26+
# needs: [aws, gcp]

.github/workflows/gcp_cicd.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
name: gcp-cicd
22
on:
3-
push:
4-
branches:
5-
- main
63
workflow_dispatch:
7-
pull_request:
4+
workflow_call:
85
concurrency:
96
group: "GCP"
107
cancel-in-progress: true

.github/workflows/pip-audit.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: pip-audit
2+
on:
3+
workflow_call:
4+
5+
jobs:
6+
pip-audit:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- uses: actions/setup-python@v4
11+
with:
12+
python-version: "3.9"
13+
- name: Install pipenv
14+
run: pip install pipenv
15+
- name: Build requirement files
16+
run: |
17+
pipenv requirements | tee requirements.txt
18+
pipenv requirements --dev | tee dev-requirements.txt
19+
- uses: pypa/gh-action-pip-audit@v1.0.6
20+
with:
21+
inputs: requirements.txt dev-requirements.txt

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ Thumbs.db
257257

258258
# CDKTF Specifics
259259
requirements.txt
260+
dev-requirements.txt
260261
controller_core/
261262
api_key_rotation/
262263
!api_key_rotation/main.py

infrastructure/aws/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ API key is created by the terraform whilst core AWS infrastructure is being depl
5151
While writing this, Grafana API Keys are valid for maximum 30 days only.
5252
Hopefully, Amazon will address this limitation in the future - but in the meantime, this simple pattern can be used to automatically rotate an API key every 29 days and store it for use in AWS Secrets Manager.
5353

54-
![Grafana](images/manage_grafana_api_key.png)
54+
![Grafana](/images/manage_grafana_api_key.png)
5555

5656
The solution is made up of two components:
5757

infrastructure/gcp/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## Architecture
55

6-
![Flight Controller Architecture](images/gcp_flight_controller.png)
6+
![Flight Controller Architecture](/images/gcp_flight_controller.png)
77

88
## Development
99

@@ -73,20 +73,20 @@ Create a GCP Service Account for a Project
7373

7474
1. Navigate to the `APIs & Services Credentials` page.
7575
2. Click on `Create credentials` and choose `Service account key`.
76-
![Create Credentials](images/credentials.png)
76+
![Create Credentials](/images/credentials.png)
7777

78-
3. On the Create service account key page, choose key type `JSON`. Then in the Service Account dropdown, choose the `New service account` option:
79-
![New Service Account](images/service_account_key.png)
78+
1. On the Create service account key page, choose key type `JSON`. Then in the Service Account dropdown, choose the `New service account` option:
79+
![New Service Account](/images/service_account_key.png)
8080

81-
4. Some new fields will appear. Fill in a name for the service account in the `Service account name` field and then choose the `BigQuery Data Viewer` and `BigQuery Job User` roles from the Role dropdown:
82-
![Attach roles](images/service_account_role.png)
81+
1. Some new fields will appear. Fill in a name for the service account in the `Service account name` field and then choose the `BigQuery Data Viewer` and `BigQuery Job User` roles from the Role dropdown:
82+
![Attach roles](/images/service_account_role.png)
8383

84-
5. Click the `Create` button. A JSON key file will be created and downloaded to your computer. Store this file in a secure place as it allows access to your BigQuery data.
84+
1. Click the `Create` button. A JSON key file will be created and downloaded to your computer. Store this file in a secure place as it allows access to your BigQuery data.
8585

86-
6. Upload it to Grafana on the datasource Configuration page. You can either upload the file or paste in the contents of the file.
87-
![Grafana authentication](images/grafana_authentication.png)
86+
2. Upload it to Grafana on the datasource Configuration page. You can either upload the file or paste in the contents of the file.
87+
![Grafana authentication](/images/grafana_authentication.png)
8888

89-
7. The file contents will be encrypted and saved in the Grafana database. Don't forget to save after uploading the file!
89+
1. The file contents will be encrypted and saved in the Grafana database. Don't forget to save after uploading the file!
9090

9191
#### Creating Dashboards
9292

0 commit comments

Comments
 (0)