File tree Expand file tree Collapse file tree 2 files changed +24
-9
lines changed
Expand file tree Collapse file tree 2 files changed +24
-9
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
33# Environment variables used as input:
4- # SILK_CLIENT_ID
5- # SILK_CLIENT_SECRET
4+ # AWS_ACCESS_KEY_ID
5+ # AWS_SECRET_ACCESS_KEY
6+ # AWS_SESSION_TOKEN
67
78declare -r SSDLC_PATH=" ./artifacts/ssdlc"
89mkdir -p " ${SSDLC_PATH} "
910
10- echo " Downloading augmented sbom from silk"
11+ echo " Downloading augmented sbom from Kondukto"
12+
13+ # use AWS CLI to get the Kondukto API token from AWS Secrets Manager
14+ kondukto_token=$( aws secretsmanager get-secret-value --secret-id " kondukto-token" --region " us-east-1" --query ' SecretString' --output text)
15+ if [ $? -ne 0 ]; then
16+ exit 1
17+ fi
18+ # set the KONDUKTO_TOKEN environment variable
19+ echo " KONDUKTO_TOKEN=$kondukto_token " > ${PWD} /kondukto_credentials.env
1120
1221docker run --platform=" linux/amd64" --rm -v ${PWD} :/pwd \
13- -e SILK_CLIENT_ID \
14- -e SILK_CLIENT_SECRET \
15- artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:1.0 \
16- download --silk-asset-group mongo-csharp-analyzer --sbom-out /pwd/${SSDLC_PATH} /augmented-sbom.json
22+ --env-file ${PWD} /kondukto_credentials.env \
23+ artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:2.0 \
24+ augment --repo mongodb/mongo-csharp-analyzer --branch main --sbom-in /pwd/sbom.json --sbom-out /pwd/${SSDLC_PATH} /augmented-sbom.json
Original file line number Diff line number Diff line change @@ -183,15 +183,22 @@ functions:
183183 - " mongo-csharp-analyzer/artifacts/nuget/MongoDB.Analyzer.${PACKAGE_VERSION}.nupkg"
184184
185185 download-and-promote-augmented-sbom-to-s3-bucket :
186+ - command : ec2.assume_role
187+ params :
188+ role_arn : ${kondukto_role_arn}
186189 - command : shell.exec
187190 params :
188191 working_dir : " mongo-csharp-analyzer"
189192 include_expansions_in_env :
190- - " SILK_CLIENT_ID"
191- - " SILK_CLIENT_SECRET"
193+ - " AWS_ACCESS_KEY_ID"
194+ - " AWS_SECRET_ACCESS_KEY"
195+ - " AWS_SESSION_TOKEN"
192196 script : |
193197 ${PREPARE_SHELL}
194198 ./evergreen/download-augmented-sbom.sh
199+ - command : ec2.assume_role
200+ params :
201+ role_arn : ${UPLOAD_SSDLC_RELEASE_ASSETS_ROLE_ARN}
195202 - command : s3.put
196203 params :
197204 aws_key : ${AWS_ACCESS_KEY_ID}
You can’t perform that action at this time.
0 commit comments