-
Notifications
You must be signed in to change notification settings - Fork 0
Task/saet 0000 baseline set up #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
94d6741
ab2a418
56764d8
2a9031b
6c7355d
24e4708
ff12b1e
4d4c149
069e5af
5bd03dc
3b7de4d
c234a94
d55c4bb
771aa57
10df9d0
aaf5ea4
e820615
d398fa4
8b272bc
6f3b9e3
efa17b3
f5bd0e2
0e7115f
a12246d
826440e
68eefc3
7b0b802
e5f2921
e9ac333
4d1a807
485671b
612aae7
4c651aa
4374703
d0c42d7
1199fec
f77fd8a
e9a24c5
2df04dc
6cdd305
214f0a8
7df47a0
377c2d2
6cff29a
3723ac3
fe424ff
dc3462d
6755bf1
a57ad6e
9cb3fca
c3e4804
31e6e53
df20d28
d77ace3
f192cd0
d782246
eda39e4
feacfb5
532b8c5
7f5f26a
9f38269
4cbacd1
a110c84
7998629
a2c63c3
0492f4e
4655567
7a33f73
8504ee8
caa2291
ae4c3cf
f196240
9c9dbaf
8e112cc
9dbd485
2f975ae
a1c483f
5449fe2
50cdd84
c96a9e2
161a1b8
46586c3
5d889c3
a52d236
af60a7b
7b7478a
b1c158c
e6b733a
5db22fe
c0479c5
d7d4d07
46dc4b8
aea6742
b900502
40b3692
5185aa9
b1d5d3a
ec887cd
e1f1818
447c29e
f2187e7
c629562
079112e
6551ec6
0229d7c
02b0add
405f3e5
c128cd1
1f4e778
eafa557
1e6b5aa
0565642
3e15a0b
745ca8e
2706ba0
c9da8bf
e0796cc
d589295
cb3ca9c
93120ae
bdfe005
837da4c
604515f
0775b10
a5d5193
9e382da
144c3cc
2d4648d
8c1bcdf
86bcee4
cb3cb87
96337a7
4abc20f
7c65e2b
be560e5
8b319c4
e4d600d
f269834
a7d7e3d
eb98066
51bdb2d
613881e
bd5d572
1c94ac9
1d0d7e4
7aa2ce7
1e1d153
035a739
51e4144
ebcd172
9e79229
0b7114b
70c46ab
c4235ed
89472f6
0f2ebdf
5dca3c0
a2ed585
33dd40c
437ceb2
cc664f8
2cd4350
9b26f44
45b07ec
411cfef
2acf323
50999d4
d9c3909
4a293e2
ac6827c
6d95a1c
f749a93
4eae5ed
143aa14
3e9e866
aa6a7c3
45f95bd
b1f7cb2
0ee52bd
eb543db
cf77f17
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| name: "Cleardown redundant artefacts action" | ||
| description: "Delete the redundant artefacts" | ||
| inputs: | ||
| workspace: | ||
| description: "The name of the workspace to action the infrastructure into." | ||
| required: true | ||
| artefact_bucket_name: | ||
| description: "The name of the s3 bucket holding domain artefacts" | ||
| required: true | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Delete artefacts | ||
| id: delete_artefacts | ||
| shell: bash | ||
| run: | | ||
| export WORKSPACE=${{inputs.workspace}} | ||
| export ARTEFACT_BUCKET_NAME=${{inputs.artefact_bucket_name}} | ||
Check failureCode scanning / SonarCloud GitHub Actions should not be vulnerable to script injections High
Change this action to not use user-controlled data directly in a run block. See more on SonarQube Cloud
|
||
| ./scripts/workflow/cleardown-artefacts.sh | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| name: "Check terraform state cleardown action" | ||
| description: "Check deletion of terraform state" | ||
| inputs: | ||
| workspace: | ||
| description: "The name of the workspace to check." | ||
| required: true | ||
| environment: | ||
| description: "The name of the environment to action the infrastructure into." | ||
| required: true | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Delete terraform state | ||
| id: delete_tf_state | ||
| shell: bash | ||
| run: | | ||
| export WORKSPACE=${{inputs.workspace}} | ||
Check failureCode scanning / SonarCloud GitHub Actions should not be vulnerable to script injections High
Change this action to not use user-controlled data directly in a run block. See more on SonarQube Cloud
|
||
| export ENVIRONMENT=${{inputs.environment}} | ||
Check failureCode scanning / SonarCloud GitHub Actions should not be vulnerable to script injections High
Change this action to not use user-controlled data directly in a run block. See more on SonarQube Cloud
|
||
| ./scripts/workflow/check-terraform-state.sh | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| name: "Derive Workspace action" | ||
| description: "Derives the name of the workspace for subsequent actions to run against" | ||
|
|
||
| outputs: | ||
| workspace: | ||
| description: "The derived workspace name" | ||
| value: ${{ steps.derive-workspace.outputs.workspace }} | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: "Derive workspace" | ||
| id: "derive-workspace" | ||
| shell: bash | ||
| run: | | ||
| export TRIGGER=${{ github.ref_type }} | ||
| export TRIGGER_ACTION=${{ github.event_name }} | ||
| export TRIGGER_REFERENCE=${{ github.ref_name }} | ||
| export TRIGGER_HEAD_REFERENCE=${{ github.head_ref }} | ||
Check failureCode scanning / SonarCloud GitHub Actions should not be vulnerable to script injections High
Change this action to not use user-controlled data directly in a run block. See more on SonarQube Cloud
|
||
| export TRIGGER_EVENT_REF=${{ github.event.ref}} | ||
| export COMMIT_HASH=$(git rev-parse --short $GITHUB_SHA) | ||
| . scripts/workflow/derive-workspace.sh | ||
| echo "Workspace Name: ${WORKSPACE}" | ||
| echo "workspace=${WORKSPACE}" >> $GITHUB_OUTPUT | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| name: "Run SonarCloud static analysis" | ||
| description: "Perform SonarCloud static analysis" | ||
|
|
||
| inputs: | ||
| sonar_organisation_key: | ||
| description: "Sonar organisation key, used to identify the project" | ||
| required: false | ||
| sonar_project_key: | ||
| description: "Sonar project key, used to identify the project" | ||
| required: false | ||
| sonar_token: | ||
| description: "Sonar token, the API key" | ||
| required: false | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: "Download code coverage reports" | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| path: coverage/ | ||
| pattern: coverage-*.xml | ||
|
|
||
| - name: "Find coverage files" | ||
| id: coverage-files | ||
| shell: bash | ||
| run: | | ||
| FILES=$(find coverage -name 'coverage-*.xml' | paste -sd "," -) | ||
| echo "files=$FILES" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: "Perform SonarCloud static analysis" | ||
| uses: sonarsource/sonarqube-scan-action@v5.3.1 | ||
| env: | ||
| SONAR_TOKEN: ${{ inputs.sonar_token }} | ||
| with: | ||
| args: > | ||
| -Dsonar.organization=${{ inputs.sonar_organisation_key }} | ||
| -Dsonar.projectKey=${{ inputs.sonar_project_key }} | ||
| -Dsonar.branch.name=${{ github.ref_name }} | ||
| -Dsonar.python.coverage.reportPaths=${{ steps.coverage-files.outputs.files }} | ||
| -Dproject.settings=./scripts/config/sonar-scanner.properties | ||
| continue-on-error: true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| name: Cleardown Artefacts | ||
|
|
||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| environment: | ||
| description: "Defines the Github environment in which to pull environment variables from" | ||
| required: true | ||
| type: string | ||
| workspace: | ||
| description: "Name of the workspace" | ||
| required: true | ||
| type: string | ||
| workflow_timeout: | ||
| description: "Timeout duration in minutes" | ||
| required: false | ||
| default: 10 | ||
| type: number | ||
| artefact_bucket_name: | ||
| description: "The name of the s3 bucket holding domain artefacts" | ||
| required: true | ||
| type: string | ||
| type: | ||
| description: "The type of permissions (e.g., account, app)" | ||
| required: true | ||
| type: string | ||
|
|
||
| jobs: | ||
| cleardown-artefacts: | ||
| name: "Cleardown redundant artefacts" | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: ${{ inputs.workflow_timeout }} | ||
| environment: ${{ inputs.environment }} | ||
|
|
||
| steps: | ||
| - name: "Checkout code" | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ inputs.tag }} | ||
|
|
||
| - name: "Configure AWS Credentials" | ||
| uses: ./.github/actions/configure-credentials | ||
| with: | ||
| aws_account_id: ${{ secrets.ACCOUNT_ID }} | ||
| aws_region: ${{ vars.AWS_REGION }} | ||
| type: ${{ inputs.type }} | ||
| environment: ${{ inputs.environment }} | ||
|
|
||
| - name: "Cleardown redundant artefacts" | ||
| uses: ./.github/actions/artefact-cleardown | ||
| with: | ||
| workspace: ${{ inputs.workspace }} | ||
| artefact_bucket_name: ${{ inputs.artefact_bucket_name }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| name: Build project workflow | ||
| run-name: Build ${{ inputs.type }} - ${{ inputs.name }} | ||
|
|
||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| build_type: | ||
| description: "The type of project to build (service, package)" | ||
| required: true | ||
| type: string | ||
| name: | ||
| description: "The name of the package to build" | ||
| required: true | ||
| type: string | ||
| python_version: | ||
| description: "The version of Python" | ||
| required: true | ||
| type: string | ||
| commit_hash: | ||
| description: "The commit hash, set by the CI/CD pipeline workflow" | ||
| required: false | ||
| type: string | ||
| environment: | ||
| description: "The deployment environment" | ||
| required: true | ||
| type: string | ||
| repo_name: | ||
| description: "The name of the Git repo" | ||
| required: true | ||
| type: string | ||
| workspace: | ||
| description: "The name of the workspace to deploy the infrastructure into" | ||
| required: true | ||
| type: string | ||
| application_tag: | ||
| description: "The application tag identifying the timeline in the repository to deploy from" | ||
| required: false | ||
| type: string | ||
| type: | ||
| description: "The type of permissions (e.g., account, app)" | ||
| required: true | ||
| type: string | ||
| release_build: | ||
| description: "Flag to indicate if this is a release build" | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
|
|
||
| jobs: | ||
| build-project: | ||
| name: "Build ${{ inputs.build_type }} - ${{ inputs.name }}" | ||
| runs-on: ubuntu-latest | ||
| environment: ${{ inputs.environment }} | ||
|
|
||
| steps: | ||
| - name: "Checkout code" | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: "Configure AWS Credentials" | ||
| uses: ./.github/actions/configure-credentials | ||
| with: | ||
| aws_account_id: ${{ secrets.ACCOUNT_ID }} | ||
| aws_region: ${{ vars.AWS_REGION }} | ||
| type: ${{ inputs.type }} | ||
| environment: ${{ inputs.environment }} | ||
|
|
||
| - name: "Set up Python" | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ inputs.python_version }} | ||
|
|
||
| - name: "Build project" | ||
| run: make build | ||
| env: | ||
| SERVICE: ${{ inputs.name }} | ||
| PACKAGE: ${{ inputs.name }} | ||
| COMMIT_HASH: ${{ inputs.commit_hash }} | ||
| ENVIRONMENT: ${{ inputs.environment }} | ||
| REPO_NAME: ${{ inputs.repo_name }} | ||
| WORKSPACE: ${{ inputs.workspace }} | ||
| APPLICATION_TAG: ${{ inputs.application_tag }} | ||
| RELEASE_BUILD: ${{ inputs.release_build }} | ||
|
|
||
| - name: "Publish artefacts to S3" | ||
| run: make publish | ||
| env: | ||
| SERVICE: ${{ inputs.name }} | ||
| PACKAGE: ${{ inputs.name }} | ||
| COMMIT_HASH: ${{ inputs.commit_hash }} | ||
| ENVIRONMENT: ${{ inputs.environment }} | ||
| REPO_NAME: ${{ inputs.repo_name }} | ||
| WORKSPACE: ${{ inputs.workspace }} | ||
| APPLICATION_TAG: ${{ inputs.application_tag }} | ||
| RELEASE_BUILD: ${{ inputs.release_build }} | ||
|
|
||
| - name: "Publish artefacts to GitHub" | ||
| uses: actions/upload-artifact@v6 | ||
| with: | ||
| name: ${{ inputs.name }}-${{ inputs.build_type }}-artefacts | ||
| path: src/lambda_function.zip | ||
| if-no-files-found: error |
Check failure
Code scanning / SonarCloud
GitHub Actions should not be vulnerable to script injections High