Using secrets in a track
Give tracks access to Secrets.
To make use of a Secret value in a tracks lifecycle scripts the track must to be granted access to the secret.
This provides better visibility to which secrets a track makes use of and adds a layer of security by limiting which secrets a track has access to.
You must have already built a track to which you access to a Secret.
🌐 Web UI
💻 Instruqt CLI
- 1.
- 2.Click the TRACK_NAME of the track to which you want to give secret access. ↳ Instruqt shows the corresponding Track dashboard page.
- 3.In the Sandbox section, click Edit to open the Sandbox page.
- 4.Click + Add a secret. ↳ The Add secrets pop-up opens.
- 5.Select the secrets you would like access in your track scripts by clicking the checked box.
- 6.Click Save. ↳ Instruqt shows the Sandbox page with your newly configured secrets.
Add the following code into
config.yml
, where SECRET_NAME
is the name of the secret you would like to make use of in the tracks lifecycle scripts.secrets:
- name: SECRET_NAME
↳ Your
config.yml
file should be similar to this:version: "3"
secrets:
- name: MY_SECRET_KEY
- name: ANOTHER_SECRET_KEY
Adding a Secret to your track sets an environment variable which is available for the duration of a tracks lifecycle scripts.
Making an authorised curl request using a username and password.
1. Add a Secret with
SITE_PASSWORD
as the name and the password as the value.2. Add the following to your lifecycle script:
curl --user name:${SITE_PASSWORD} http://www.example.com
Last modified 2mo ago