Skip to content

Commit 6414834

Browse files
committed
update to silkbomb 2.0
1 parent 7c1ad8d commit 6414834

File tree

2 files changed

+24
-18
lines changed

2 files changed

+24
-18
lines changed

.evergreen.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3780,6 +3780,25 @@ functions:
37803780
# - signature_tag (either 'signed' or 'unsigned')
37813781
###
37823782
add_crypt_shared_and_sbom:
3783+
- command: ec2.assume_role
3784+
display_name: Assume IAM role with permissions to pull Kondukto API token
3785+
params:
3786+
role_arn: ${kondukto_role_arn}
3787+
- command: shell.exec
3788+
display_name: Pull Kondukto API token from AWS Secrets Manager and write it to file
3789+
params:
3790+
silent: true
3791+
shell: bash
3792+
working_dir: src
3793+
include_expansions_in_env: [AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN]
3794+
script: |
3795+
# use AWS CLI to get the Kondukto API token from AWS Secrets Manager
3796+
kondukto_token=$(aws secretsmanager get-secret-value --secret-id "kondukto-token" --region "us-east-1" --query 'SecretString' --output text)
3797+
if [ $? -ne 0 ]; then
3798+
exit 1
3799+
fi
3800+
# set the KONDUKTO_TOKEN environment variable
3801+
echo "KONDUKTO_TOKEN=$kondukto_token" > ${workdir}/kondukto_credentials.env
37833802
- command: subprocess.exec
37843803
params:
37853804
working_dir: src
@@ -3791,9 +3810,7 @@ functions:
37913810
ARTIFACTORY_USERNAME: ${artifactory_username}
37923811
ARTIFACTORY_PASSWORD: ${artifactory_password}
37933812
# for Silk SBOM integration
3794-
SILK_ASSET_GROUP: mongosh-${executable_os_id}
3795-
SILK_CLIENT_ID: ${silk_client_id}
3796-
SILK_CLIENT_SECRET: ${silk_client_secret}
3813+
KONDUKTO_BRANCH: ${branch_name}_${executable_os_id}
37973814
create_static_analysis_report:
37983815
- command: s3.get
37993816
params:

.evergreen/download-crypt-shared-and-generate-sbom.sh

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,10 @@ cat dist/.purls.txt
1111

1212
set +x
1313
echo "${ARTIFACTORY_PASSWORD}" | docker login artifactory.corp.mongodb.com --username "${ARTIFACTORY_USERNAME}" --password-stdin
14-
cat << EOF > silkbomb.env
15-
SILK_CLIENT_ID=${SILK_CLIENT_ID}
16-
SILK_CLIENT_SECRET=${SILK_CLIENT_SECRET}
17-
EOF
1814
set -x
1915

20-
trap_handler() {
21-
rm -f silkbomb.env
22-
}
23-
trap trap_handler ERR EXIT
24-
25-
docker pull artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:1.0
26-
docker run --rm -v ${PWD}:/pwd artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:1.0 update \
16+
docker pull artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:2.0
17+
docker run --rm -v ${PWD}:/pwd artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:2.0 update \
2718
--purls /pwd/dist/.purls.txt --sbom-out /pwd/dist/.sbom-lite.json
28-
docker run --env-file silkbomb.env --rm -v ${PWD}:/pwd artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:1.0 upload \
29-
--silk-asset-group "${SILK_ASSET_GROUP}" --sbom-in /pwd/dist/.sbom-lite.json
30-
docker run --env-file silkbomb.env --rm -v ${PWD}:/pwd artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:1.0 download \
31-
--silk-asset-group "${SILK_ASSET_GROUP}" --sbom-out /pwd/dist/.sbom.json
19+
docker run --env-file ${workdir}/kondukto_credentials.env --rm -v ${PWD}:/pwd artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:2.0 augment \
20+
--repo mongodb-js/mongosh --branch ${KONDUKTO_BRANCH} --sbom-in /pwd/dist/.sbom-lite.json -sbom-out /pwd/dist/.sbom.json

0 commit comments

Comments
 (0)