Skip to content

Commit e559f75

Browse files
oarbusiCopilot
andauthored
chore: Generate SSDLC report after release (#3383)
* generate ssdlc report * add missing target shell * fix issues with generation * Update scripts/gen-ssdlc-report.sh Co-authored-by: Copilot <[email protected]> * Update .github/workflows/ssdlc-report.yml Co-authored-by: Copilot <[email protected]> * remove double tab * fix commit message --------- Co-authored-by: Copilot <[email protected]>
1 parent 9b89111 commit e559f75

File tree

3 files changed

+108
-0
lines changed

3 files changed

+108
-0
lines changed

.github/workflows/ssdlc-report.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Generate SSDLC Compliance Report
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
tag:
9+
description: 'terraform-provider-mongodbatlas tag version (e.g. 1.42.2)'
10+
required: true
11+
type: string
12+
13+
jobs:
14+
generate-ssdlc-report:
15+
uses: ./.github/workflows/run-script-and-commit.yml
16+
with:
17+
script_call: |
18+
if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then
19+
TAG="${{ github.event.inputs.tag }}"
20+
VERSION="${TAG#v}"
21+
AUTHOR="${{ github.actor }}"
22+
else
23+
VERSION="${GITHUB_REF#refs/tags/v}"
24+
AUTHOR="${{ github.event.release.author.login }}"
25+
fi
26+
export AUTHOR VERSION
27+
./scripts/gen-ssdlc-report.sh
28+
file_to_commit: 'compliance/v*/ssdlc-compliance-*.md'
29+
commit_message: "chore: Update SSDLC report for ${{ github.event.inputs.tag || github.ref }}"
30+
secrets:
31+
apix_bot_pat: ${{ secrets.APIX_BOT_PAT }}
32+
remote: https://svc-apix-bot:${{ secrets.APIX_BOT_PAT }}@github.com/${{ github.repository }}
33+
gpg_private_key: ${{ secrets.APIX_BOT_GPG_PRIVATE_KEY }}
34+
passphrase: ${{ secrets.APIX_BOT_PASSPHRASE }}

scripts/gen-ssdlc-report.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
release_date=${DATE:-$(date -u '+%Y-%m-%d')}
5+
6+
export DATE="${release_date}"
7+
8+
if [ -z "${AUTHOR:-}" ]; then
9+
AUTHOR=$(git config user.name)
10+
fi
11+
12+
if [ -z "${VERSION:-}" ]; then
13+
VERSION=$(git tag --list 'v*' --sort=-taggerdate | head -1 | cut -d 'v' -f 2)
14+
fi
15+
16+
if [ "${AUGMENTED_REPORT:-false}" = "true" ]; then
17+
target_dir="."
18+
file_name="ssdlc-compliance-${VERSION}-${DATE}.md"
19+
SBOM_TEXT=" - See Augmented SBOM manifests (CycloneDX in JSON format):
20+
- This file has been provided along with this report under the name 'linux_amd64_augmented_sbom_v${VERSION}.json'
21+
- Please note that this file was generated on ${DATE} and may not reflect the latest security information of all third party dependencies."
22+
23+
else # If not augmented, generate the standard report
24+
target_dir="compliance/v${VERSION}"
25+
file_name="ssdlc-compliance-${VERSION}.md"
26+
SBOM_TEXT=" - See SBOM Lite manifests (CycloneDX in JSON format):
27+
- https://github.com/mongodb/terraform-provider-mongodbatlas/releases/download/terraform-provider-mongodbatlas%2Fv${VERSION}/sbom.json"
28+
# Ensure terraform-provider-mongodbatlas version directory exists
29+
mkdir -p "${target_dir}"
30+
fi
31+
32+
export AUTHOR
33+
export VERSION
34+
export SBOM_TEXT
35+
36+
echo "Generating SSDLC report for Terraform Provider for MongoDB Atlas version ${VERSION}, author ${AUTHOR} and release date ${DATE}..."
37+
38+
envsubst < templates/releases/ssdlc-compliance.template.md \
39+
> "${target_dir}/${file_name}"
40+
41+
echo "SSDLC compliance report ready. Files in ${target_dir}/:"
42+
ls -l "${target_dir}/"
43+
44+
echo "Printing the generated report:"
45+
cat "${target_dir}/${file_name}"
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
SSDLC Compliance Report: Terraform Provider MongoDB Atlas ${VERSION}
2+
=================================================================
3+
4+
- Release Creator: ${AUTHOR}
5+
- Created On: ${DATE}
6+
7+
Overview:
8+
9+
- **Product and Release Name**
10+
- Terraform Provider MongoDB Atlas ${VERSION}, ${DATE}.
11+
12+
- **Process Document**
13+
- https://www.mongodb.com/blog/post/how-mongodb-protects-against-supply-chain-vulnerabilities
14+
15+
- **Tool used to track third party vulnerabilities**
16+
- [Kondukto](https://arcticglow.kondukto.io/)
17+
18+
- **Dependency Information**
19+
${SBOM_TEXT}
20+
21+
- **Security Testing Report**
22+
- Available as needed from Cloud Security.
23+
24+
- **Security Assessment Report**
25+
- Available as needed from Cloud Security.
26+
27+
Assumptions and attestations:
28+
29+
- Internal processes are used to ensure CVEs are identified and mitigated within SLAs.

0 commit comments

Comments
 (0)