Skip to content

Commit 50f6253

Browse files
authored
Add compliance report (#25)
1 parent 96872d0 commit 50f6253

File tree

8 files changed

+78
-9
lines changed

8 files changed

+78
-9
lines changed

authorized-pub/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ runs:
2222
run: |
2323
export GH_TOKEN=${{ inputs.token }}
2424
NAME=$(gh api users/${{ github.actor }} --jq '.name')
25-
export REPORT=$S3_ASSETS/authorized_publication.txt
25+
export REPORT=$S3_ASSETS/authorized-publication.txt
2626
echo "Product: ${{ inputs.product_name }}" > $REPORT
2727
echo "Version: ${{ inputs.release_version }}" >> $REPORT
2828
echo "Releaser: $NAME" >> $REPORT

compliance-report/action.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Generate a compliance report
2+
description: Generates the compliance report in the S3_ASSETS folder
3+
inputs:
4+
token:
5+
description: The GitHub token for the action
6+
required: true
7+
sbom_name:
8+
description: The name of the SBOM file in the S3 bucket
9+
default: cyclonedx.sbom.json
10+
sarif_name:
11+
description: The name of the SARIF file in the S3 bucket
12+
default: code-scanning-alerts.json
13+
authorized_pub_name:
14+
description: The name of the Authorized Publication file in the S3 bucket
15+
default: authorized-publication.txt
16+
runs:
17+
using: composite
18+
steps:
19+
- name: Generate Compliance Report
20+
shell: bash
21+
run: |
22+
set -eux
23+
export GH_TOKEN=${{ inputs.token }}
24+
export RELEASE_CREATOR=$(gh api users/${{ github.actor }} --jq '.name')
25+
export SBOM_NAME=${{ inputs.sbom_name }}
26+
export SARIF_NAME=${{ inputs.sarif_name }}
27+
export AUTHORIZED_PUB_NAME=${{ inputs.authorized_pub_name }}
28+
bash ${{ github.action_path }}/generate.sh

compliance-report/generate.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
3+
set -eux
4+
5+
cat << EOF >> ${S3_ASSETS}/ssdlc_compliance_report.md
6+
Release Creator
7+
${RELEASE_CREATOR}
8+
9+
Tool used to track third party vulnerabilities
10+
Silk
11+
12+
Third-Party Dependency Information
13+
See ${SBOM_NAME}
14+
15+
Static Analysis Findings
16+
See ${SARIF_NAME}
17+
18+
Signature Information
19+
See ${AUTHORIZED_PUB_NAME}
20+
21+
Known Vulnerabilities
22+
Any vulnerabilities that may be shown in the files referenced above have been reviewed and accepted by the appropriate approvers.
23+
EOF

gpg-sign/action.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ inputs:
1111
runs:
1212
using: composite
1313
steps:
14+
- name: Get the list of filenames as a space-separated string
15+
shell: bash
16+
id: filenames
17+
run: |
18+
set -eux
19+
export FILENAMES=${{inputs.filenames}}
20+
if [[ $FILENAMES =~ '*' ]]; then
21+
FILENAMES=$(ls $FILENAMES | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/ /g')
22+
fi
23+
echo "names=\"$FILENAMES\"" >> $GITHUB_OUTPUT
1424
- name: "Create detached signature for file"
1525
shell: bash
1626
run: |
@@ -25,4 +35,6 @@ runs:
2535
- name: "Move the signature files to the release directory"
2636
shell: bash
2737
run: |
28-
for filename in ${{ inputs.filenames }}; do mv ${filename}.sig $RELEASE_ASSETS; done
38+
set -eux
39+
export FILENAMES=${{steps.filenames.outputs.names}}
40+
for filename in $FILENAMES; do mv ${filename}.sig $RELEASE_ASSETS; done

python/publish/action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@ runs:
5151
- name: Generate Sarif Report
5252
uses: mongodb-labs/drivers-github-tools/code-scanning-export@v2
5353
with:
54-
output-file: sarif-report.json
5554
ref: ${{ inputs.version }}
55+
- name: Generate Compliance Report
56+
uses: mongodb-labs/drivers-github-tools/compliance-report@v2
57+
with:
58+
token: ${{ inputs.token }}
5659
- name: Run publish script
5760
shell: bash
5861
run: ${{github.action_path}}/publish.sh

python/publish/publish.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
set -eux
44

5-
mv sarif-report.json $S3_ASSETS
5+
cp $RELEASE_ASSETS/*.sig $S3_ASSETS
6+
mv code-scanning-alerts.json $S3_ASSETS
67

78
if [ "$DRY_RUN" == "false" ]; then
89
echo "Uploading Release Reports"

sbom/action.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ inputs:
1111
runs:
1212
using: composite
1313
steps:
14-
- name: Download the Augmented SBOM file to the release assets folder
14+
- name: Download the Augmented SBOM file to the release assets and s3 assets folders
1515
shell: bash
1616
run: |
17+
set -eux
1718
podman run --platform="linux/amd64" -it --rm -v ${RELEASE_ASSETS}:/pwd \
1819
--env-file=${SILKBOMB_ENVFILE} \
1920
${{ inputs.artifactory_image }} \
20-
download --silk-asset-group ${{ inputs.silk_asset_group }} --sbom-out /pwd/sbom.json
21+
download --silk-asset-group ${{ inputs.silk_asset_group }} --sbom-out /pwd/cyclonedx.sbom.json
22+
cp ${RELEASE_ASSETS}/cyclonedx.sbom.json ${S3_ASSETS}

setup/setup.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ mkdir $S3_ASSETS
3939

4040
echo "Set up global variables"
4141
cat <<EOF >> $GITHUB_ENV
42-
AWS_BUCKET=${RELEASE_ASSETS_BUCKET:-}"
42+
AWS_BUCKET=${RELEASE_ASSETS_BUCKET:-}
4343
GPG_KEY_ID=$GPG_KEY_ID
44-
GPG_PUBLIC_URL=${GPG_PUBLIC_URL:-}"
44+
GPG_PUBLIC_URL=${GPG_PUBLIC_URL:-}
4545
GARASIGN_ENVFILE=$GARASIGN_ENVFILE
46-
SILKBOMB_ENVFILE=${SILKBOMB_ENVFILE:-}"
46+
SILKBOMB_ENVFILE=${SILKBOMB_ENVFILE:-}
4747
ARTIFACTORY_REGISTRY=$ARTIFACTORY_REGISTRY
4848
RELEASE_ASSETS=$RELEASE_ASSETS
4949
S3_ASSETS=$S3_ASSETS

0 commit comments

Comments
 (0)