The steps used during the release process, including release candidates
Before a release it is required that a release candidate version is created. This allows the Threat Dragon community to review and feedback on the proposed release. Changes that are agreed for the release should then be made available with a further release candidate.
For example if RC1, but change for RC2 and so on :
git clone git@github.com:OWASP/threat-dragon.git
cd threat-dragon
- update version, for example
"version": "2.3.1-RC1",
, intd.vue/package.json
- ensure
buildState
intd.vue/package.json
is "" (empty) - update version, for example
"version": "2.3.1-RC1",
, inpackage.json
andtd.server/package.json
- update package lock files:
npm install
npm run build
npm test
npm run test:vue
- ensure that the package-lock files are up to date using
npm install
git add --all; git status
git commit -m"release candidate 2.3.1-RC1"
git push
- tag the release
git tag v2.3.1-RC1
git push origin v2.3.1-RC1
repeat as necessary for further release candidates.
The github release workflow will then create the release candidate along with the install images
Ensure the release candidate is announced on the OWASP Threat Dragon slack channel and any other relevant channels
After the releases candidate has been agreed by the Threat Dragon community, a release version can be prepared:
git clone git@github.com:OWASP/threat-dragon.git
cd threat-dragon
- update version eg
"version": "2.3.1",
, inpackage.json
,td.vue/package.json
andtd.server/package.json
- update
buildState
intd.vue/package.json
away from-latest
to "" (empty) - update package lock files:
npm install
npm run build
npm test
npm run test:vue
- ensure that the package-lock files are up to date using
npm install
git add --all; git status
git commit -m"release version 2.3.1"
git push
- tag the release
git tag v2.3.1
git push origin v2.3.1
The github release workflow then creates the draft release and the install images
Ensure the tag now exists on the [Threat Dragon Docker hub]tddock].
- once tagged, the github workflow pushes the docker image to docker hub
- pull image for an X86 platform using
docker pull threatdragon/owasp-threat-dragon:v2.3.1
- pull image for an ARM platform using
docker pull threatdragon/owasp-threat-dragon:v2.3.1-arm64
- Test using the command to run a detached container:
docker run -d -p 8080:3000 -v $(pwd)/.env:/app/.env threatdragon/owasp-threat-dragon:v2.3.1
- Test the ARM container as well:
docker run -d -p 8080:3000 -v $(pwd)/.env:/app/.env threatdragon/owasp-threat-dragon:v2.3.1-arm64
- Ideally test these releases on Windows, linux and MacOS using
http://localhost:8080/#/
If the image tests correctly, promote the docker image from dockerhub threatdragon/
to dockerhub OWASP/threat-dragon/v2.3.1
and OWASP/threat-dragon/v2.3.1-arm64
.
There is no going back on these steps, so they are deliberately left as manual tasks:
docker pull --platform linux/x86_64 threatdragon/owasp-threat-dragon:v2.3.1
docker tag threatdragon/owasp-threat-dragon:v2.3.1 owasp/threat-dragon:v2.3.1
docker push owasp/threat-dragon:v2.3.1
docker pull owasp/threat-dragon:v2.3.1
docker tag owasp/threat-dragon:v2.3.1 owasp/threat-dragon:stable
docker push owasp/threat-dragon:stable
docker pull --platform linux/arm64 threatdragon/owasp-threat-dragon:v2.3.1-arm64
docker tag threatdragon/owasp-threat-dragon:v2.3.1-arm64 owasp/threat-dragon:v2.3.1-arm64
docker push owasp/threat-dragon:v2.3.1-arm64
ensure the tag now exists within the OWASP Docker hub.
- Install Heroku CLI tools if necessary
- Login to Heroku
- Inspect logs using
heroku logs --app=threatdragon-v2 --tail
- Ensure no rollback shown in dashboard
Download desktop AppImage for Linux and the latest-linux.yml
auto-update checksum file.
Create SHA512 checksum-linux.yml
file:
grep sha512 latest-linux.yml | tail -n 1 | cut -d ":" -f 2 | base64 -d | \
hexdump -ve '1/1 "%.2x"' > checksum-linux.yml
echo -n " Threat-Dragon-ng-2.3.1.AppImage" >> checksum-linux.yml
Check correct using: cat checksum-linux.yml | sha512sum --check
Ensure that Threat Dragon is updated on Snapcraft. This is also accessible using Ubuntu One, check the release is current on the dashboard.
Token used in the Threat Dragon release pipeline is 'SNAPCRAFT_TOKEN' and this has to be refreshed annually. Use commands to refresh creds:
snapcraft login
snapcraft export-login --snaps threat-dragon --channels stable
The snapcraft username is 'threat-dragon' and uses an Ubuntu One password.
It used to be that altool could be used to notarize the MacOS .dmg
files in the pipeline.
As of early 2024 this is no longer available and notarytool must be used in a secure environment.
The secrets for both signing and notarization can be checked by running it manually from the command line:
- provide the code signing certs for MacOS
- Download both x86 and arm64 files for the MacOS installer (
*.dmg
and*.zip
) - ensure that the apple developer environment is set up
- notarize and staple the
.dmg
file, for example with arm64 version 2.3.1:xcrun notarytool submit --apple-id <apple-account-email> --team-id <teamid> \
--password <password> --verbose --wait Threat-Dragon-ng-2.3.1-arm64.dmg
xcrun stapler staple --verbose Threat-Dragon-ng-2.3.1-arm64.dmg
- similarly for the x86 image
Threat-Dragon-ng-2.3.1.dmg
- notarize the application in the
.zip
file, for example with arm64 version 2.3.1:xcrun notarytool submit --apple-id <apple-account-email> --team-id <teamid> \
--password <password> --verbose --wait Threat-Dragon-ng-2.3.1-arm64-mac.zip
- unzip the file to obtainn the application directory
Threat-Dragon-ng.app
- check notarization worked with:
spctl -a -v Threat-Dragon-ng.app
- staple the applications with:
xcrun stapler staple --verbose Threat-Dragon-ng.app
- zip the application directory to get
Threat-Dragon-ng.zip
- rename
Threat-Dragon-ng.zip
toThreat-Dragon-ng-2.3.1-arm64-mac.zip
- similarly for the x86 application
Threat-Dragon-ng-2.3.1-mac.zip
Fix up the checksums in latest-mac.yml
values using script:
echo -n " - url: Threat-Dragon-ng-2.3.1-mac.zip\n sha512: "
openssl dgst -binary -sha512 Threat-Dragon-ng-2.3.1-mac.zip | openssl base64 -A
echo -n "\n size: "
ls -l Threat-Dragon-ng-2.3.1-mac.zip | cut -d " " -f 7
echo -n "\n - url: Threat-Dragon-ng-2.3.1-arm64-mac.zip\n sha512: "
openssl dgst -binary -sha512 Threat-Dragon-ng-2.3.1-arm64-mac.zip | openssl base64 -A
echo -n "\n size: "
ls -l Threat-Dragon-ng-2.3.1-arm64-mac.zip | cut -d " " -f 7
echo -n "\n - url: Threat-Dragon-ng-2.3.1.dmg\n sha512: "
openssl dgst -binary -sha512 Threat-Dragon-ng-2.3.1.dmg | openssl base64 -A
echo -n "\n size: "
ls -l Threat-Dragon-ng-2.3.1.dmg | cut -d " " -f 7
echo -n "\n - url: Threat-Dragon-ng-2.3.1-arm64.dmg\n sha512: "
openssl dgst -binary -sha512 Threat-Dragon-ng-2.3.1-arm64.dmg | openssl base64 -A
echo -n "\n size: "
ls -l Threat-Dragon-ng-2.3.1-arm64.dmg | cut -d " " -f 7
Create the checksum files:
sha512sum Threat-Dragon-ng-2.3.1.dmg > checksum-mac.yml
sha512sum Threat-Dragon-ng-2.3.1-arm64.dmg > checksum-mac-arm64.yml
upload files into the new release
If the certificate needs to be provided in Base64 :
openssl pkcs12 -export -in WINDOWS_OSS_CERT.pem -nokeys -out WINDOWS_OSS_CERT.p12 -passout pass:<password>
openssl pkcs12 -info -in WINDOWS_OSS_CERT.p12 -passin pass:<password>
base64 -i WINDOWS_OSS_CERT.p12 -o WINDOWS_OSS_CERT.p12.b64
The use of the pipeline for code signing is not practical for this open source project because of the need for a private key in the keychain, so use the certificate issuer's utilities.
The latest certificate is provided using Certum's Open Source certificate:
- install proCertum SmartSign + SimplySign Desktop for personal computers
- use as a general reference Certum’s Code Signing in the Cloud
- download the unsigned windows installer file
- ensure Powershell has the
signtool
utility installed from Windows SDK - right click the icon in the desktop tray to select ‘Connect to SimplySign’
- gain a thumbprint from desktop tray icon, Manage certificates → Certificate list → Details → Thumbprint
signtool sign /sha1 "<thumbprint>" /tr http://time.certum.pl /td sha256 /fd sha256 /v "Threat-Dragon-ng-Setup-2.3.1.exe"
Once signed create the checksum file: sha512sum Threat-Dragon-ng-Setup-2.3.1.exe > checksum.yml
Fix up the file latest.yml
with the correct size and the SHA256 value given by:
openssl dgst -binary -sha512 Threat-Dragon-ng-Setup-2.3.1.exe | openssl base64 -A
Confirm SHA512 with:
cat checksum-linux.yml | sha512sum --check
cat checksum.yml | sha512sum --check
cat checksum-mac.yml | sha512sum --check
cat checksum-mac-arm64.yml | sha512sum --check
Upload checksum*.yml
files to the draft release.
Before adding text to the draft release, click on 'Generate Release Notes' button from the edit window. If this is done after text is added it does not work. Edit the 'What's Changed' to filter out any chores.
Then update the release notes for the draft in the Threat Dragon release area
using the release notes using markdown provided by .release-note-template.md
as a template,
making sure to revise 2.x.x
to the correct version number such as 2.3.1
Once everything is in place promote the release from 'draft' to 'public' and 'latest'
Update the releases tab and the info pane on the OWASP Threat Dragon project pages.
Finally ensure Threat Dragon announces the new release on the OWASP Threat Dragon slack channel and any other relevant channels such as Blue Sky
Reset the build state to 'latest'; this is displayed on the demo site:
- update
buildState
intd.vue/package.json
away from "" to-latest
- ensure that the package-lock files are up to date using
npm install
git add --all; git status
git commit -m"set latest build version"
git push