Before you start
- An Azure ML workspace and a compute cluster with a system-assigned managed identity.
- A
memberAPI key stored in the workspace Key Vault as the secretcertone-api-key. - The cluster's identity granted Key Vault Secrets User on that vault.
Azure CLI
# The cluster's managed identity reads the key from the workspace Key Vault.
az keyvault secret set --vault-name <workspace-vault> --name certone-api-key --value "$CERTONE_API_KEY"
# Grant the compute cluster's system-assigned identity "Key Vault Secrets User" on that vault.In the CertOne console, open Developer Hub, then API keys. Name the key, choose the member role and select New key.
- Copy the secret right away: it is shown only once.
- Keys start with
ck_and expire after at most 365 days. - Creating keys requires the
adminrole in your organization. - A
viewerkey can read results but cannot submit scans.
Add the gate step
Declare the vault URL as a pipeline input and add a command job that runs certone-submit. The packaging job takes the gate's output as its input, so it only runs after a pass.
pipeline.yml
inputs:
certone_key_vault_url:
type: string
jobs:
# train: ... evaluate: ...
certone_gate:
type: command
inputs:
certone_key_vault_url: ${{parent.inputs.certone_key_vault_url}}
model: ${{parent.jobs.train.outputs.model}}
outputs:
report: { type: uri_folder }
code: ..
command: >-
pip install -q "certone-sdk[azure]>=0.2.1" &&
certone-submit --project . --asset "Card Fraud Scorer" --environment ci
--country-code CA --tee kata_cc --fail-on high
--api-key-vault "${{inputs.certone_key_vault_url}}/secrets/certone-api-key"
--report-out ${{outputs.report}}/report.json
--attestation-out ${{outputs.report}}/attestation.json
package:
inputs:
gate: ${{parent.jobs.certone_gate.outputs.report}} # runs only if the gate passedSubmit the pipeline with the vault URL:
Azure CLI
az ml job create -f pipeline.yml --set inputs.certone_key_vault_url=https://<workspace-vault>.vault.azure.netOptions
The gate uses certone-submit; every option is described in the SDKs and CLI guide. The ones used here:
| Option | Meaning |
|---|---|
--api-key-vault | Read the key from Key Vault with the compute's managed identity. |
--tee | amd_sev_snp (default) or kata_cc. |
--country-code | Where the system operates. |
--fail-on | Lowest severity that fails, high by default. |
--report-out, --attestation-out | Write the report and, on a pass, the attestation to the step's output. |
What you see
- In Studio, the pipeline graph shows the gate step completed or failed, and the packaging step runs only after a pass.
- The gate step's
user_logs/std_log.txtshows the verdict, where the scan ran, and one line per finding with its severity.
How it gates
- Exit 0 on a passing verdict: the pipeline continues.
- Exit 1 on a failing verdict, or 2 on an error such as an unreadable key: the step fails and nothing downstream runs.