File tree Expand file tree Collapse file tree 8 files changed +78
-9
lines changed Expand file tree Collapse file tree 8 files changed +78
-9
lines changed Original file line number Diff line number Diff line change 22
22
run : |
23
23
export GH_TOKEN=${{ inputs.token }}
24
24
NAME=$(gh api users/${{ github.actor }} --jq '.name')
25
- export REPORT=$S3_ASSETS/authorized_publication .txt
25
+ export REPORT=$S3_ASSETS/authorized-publication .txt
26
26
echo "Product: ${{ inputs.product_name }}" > $REPORT
27
27
echo "Version: ${{ inputs.release_version }}" >> $REPORT
28
28
echo "Releaser: $NAME" >> $REPORT
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change @@ -11,6 +11,16 @@ inputs:
11
11
runs :
12
12
using : composite
13
13
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
14
24
- name : " Create detached signature for file"
15
25
shell : bash
16
26
run : |
25
35
- name : " Move the signature files to the release directory"
26
36
shell : bash
27
37
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
Original file line number Diff line number Diff line change 51
51
- name : Generate Sarif Report
52
52
uses : mongodb-labs/drivers-github-tools/code-scanning-export@v2
53
53
with :
54
- output-file : sarif-report.json
55
54
ref : ${{ inputs.version }}
55
+ - name : Generate Compliance Report
56
+ uses : mongodb-labs/drivers-github-tools/compliance-report@v2
57
+ with :
58
+ token : ${{ inputs.token }}
56
59
- name : Run publish script
57
60
shell : bash
58
61
run : ${{github.action_path}}/publish.sh
Original file line number Diff line number Diff line change 2
2
3
3
set -eux
4
4
5
- mv sarif-report.json $S3_ASSETS
5
+ cp $RELEASE_ASSETS /* .sig $S3_ASSETS
6
+ mv code-scanning-alerts.json $S3_ASSETS
6
7
7
8
if [ " $DRY_RUN " == " false" ]; then
8
9
echo " Uploading Release Reports"
Original file line number Diff line number Diff line change @@ -11,10 +11,12 @@ inputs:
11
11
runs :
12
12
using : composite
13
13
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
15
15
shell : bash
16
16
run : |
17
+ set -eux
17
18
podman run --platform="linux/amd64" -it --rm -v ${RELEASE_ASSETS}:/pwd \
18
19
--env-file=${SILKBOMB_ENVFILE} \
19
20
${{ 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}
Original file line number Diff line number Diff line change @@ -39,11 +39,11 @@ mkdir $S3_ASSETS
39
39
40
40
echo " Set up global variables"
41
41
cat << EOF >> $GITHUB_ENV
42
- AWS_BUCKET=${RELEASE_ASSETS_BUCKET:- } "
42
+ AWS_BUCKET=${RELEASE_ASSETS_BUCKET:- }
43
43
GPG_KEY_ID=$GPG_KEY_ID
44
- GPG_PUBLIC_URL=${GPG_PUBLIC_URL:- } "
44
+ GPG_PUBLIC_URL=${GPG_PUBLIC_URL:- }
45
45
GARASIGN_ENVFILE=$GARASIGN_ENVFILE
46
- SILKBOMB_ENVFILE=${SILKBOMB_ENVFILE:- } "
46
+ SILKBOMB_ENVFILE=${SILKBOMB_ENVFILE:- }
47
47
ARTIFACTORY_REGISTRY=$ARTIFACTORY_REGISTRY
48
48
RELEASE_ASSETS=$RELEASE_ASSETS
49
49
S3_ASSETS=$S3_ASSETS
You can’t perform that action at this time.
0 commit comments