cnb:destroy-token
About 228 wordsLess than 1 minute
cnb:destroy-token
A CNB_TOKEN is created before the pipeline starts and is destroyed after it ends. Use this task to proactively destroy the CNB_TOKEN and remove this environment variable.
When to use it: use it when the pipeline no longer needs the CNB_TOKEN and you want to revoke its permission as early as possible - for example destroying the token right after the operations that required it, reducing the risk of it being misused by later tasks. The platform destroys the token automatically when the pipeline ends; this task only moves the timing earlier.
Applicable Events
Parameters
None
Output
None
Configuration Examples
Proactively destroy the CNB_TOKEN after use in the pipeline to reduce the risk of CNB_TOKEN misuse.
.cnb.yml
main:
push:
- stages:
- name: use CNB_TOKEN
script: echo "Make API calls using the CNB_TOKEN."
- name: destroy token
type: cnb:destroy-token