coreos / coreos/coreos-assembler

cosa leaks git access tokens into generated ociarchive

Open
#3,355 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
393
Forks
193
Avg merge
17h 6m
Merged PRs (30d)
5

Description

Cosa writes the current config source into the ociarchive:
https://github.com/coreos/coreos-assembler/blob/3ad4cf5c33dfc6b53dd07f50058767cc3525a3e6/src/cmd-build#L447

In my case this ends up as:

"org.opencontainers.image.source": "https://gitlab-ci-token:XXXX@gitlab.instance.mine",

since I am building in gitlab CI which uses a short lived access token to check out the image. It would be great if this token could be masked.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/cmd-build around line 447, where cosa writes the current config source into the OCI archive metadata. Reproduce the build with a credentialed GitLab checkout and inspect the generated org.opencontainers.image.source value. Done means the source metadata no longer exposes the access token while still retaining the repository source.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
build-system, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.