Mechanism for automatically fetching secrets
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by reading the task definition schema and the existing fetches handling in run_task.py, then inspect the run-task script that executes tasks. Define how the top-level secrets entries are transformed and consumed for environment variables and files, and verify that both example forms work without wrapper scripts.
Written by the indexing model from the issue text.
Description
When a task needs to use a secret, we need to create a custom wrapper script that first downloads the secret from the secrets service, sets it up, and then invokes the regular command. This makes creating tasks that need secrets inconvenient.. There's no way to just "declare" that the secret is needed in the task definition and have everything just work.
I propose we introduce a new run-task based mechanism for handling secrets. At a high level it would work like this:
- A task declares which secrets it needs in a top-level
secretskey. - The
run_task.pytransforms would massage this into a format we can easily stuff into an environment variable. - The
run-taskscript reads said env and fetches the required secrets before proceeding with the task
There is precedent here as this is exactly how fetches work.
To start, the schema for defining the secrets should support both environment variables, as well as files. Maybe something like:
secrets:
- secret: myproject/secret
key: api_token
env: API_TOKEN
- secret: myproject/other/secret
file: /builds/worker/secret
The above definition would:
A) store the value of api_token in the myproject/secret secret into the API_TOKEN env
B) write the entirety of the myproject/other/secret secret wholesale into a file at /builds/worker/secret
- Dominant language
- Python
- Stars
- 26
- Forks
- 55
- Avg merge
- 2d 6m
- Merged PRs (30d)
- 15
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from taskcluster/taskgraph
-
Dependency Dashboard Open
Difficulty 5/5 Over a week Newbie friendliness 20/100
taskcluster/taskgraph#952 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
taskcluster/taskgraph#915 ·
-
feature
Difficulty 3/5 1-2 days Newbie friendliness 35/100
taskcluster/taskgraph#911 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
taskcluster/taskgraph#882 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
taskcluster/taskgraph#865 · 1 comment ·
All issues in taskcluster/taskgraph
Similar issues
-
link-check link-check:sphinx-theme
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
OpenHands/extensions#626 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
CSCfi/sd-search-api#39 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100