Skip to content

Conversation

@TheLortex
Copy link

A secret is an externally provided key-value pair that can be mounted on demand by the job. This PR implements:

  • Spec: adding a secrets field in the run command, which mounts a list of secrets files in the chosen target, or in /run/secrets/[id] if the target is not provided.
  • Spec: when translated to docker, the secret list translate's to buildkit's --mount=type=secret,id=[id],dst=[target] option.
  • Obuilder: a temporary file and a mount point are created for each specified secret. Obuilder's build context has an additional secrets parameter in order to provide the values.

Copy link
Contributor

@talex5 talex5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a very useful feature!

Please add a test-case to test_docker to check the serialisation.

Would be nice to change the syntax from:

(secrets ((foo ...)))

to

(secrets (foo ...))

Also, the README needs updating.

Thanks!

@TheLortex
Copy link
Author

Thanks for your review ! I've addressed all the points you mentioned, and updated the readme, changelog and obuilder cli.

Also, load secrets from files rather than putting them on the
command-line (where they will appear in the shell history, `ps` output,
etc).
Copy link
Contributor

@talex5 talex5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I pushed some minor changes:

  • Replaced use of the phrase "secret key", which could be confusing.
  • Got the binary to read the secrets from files rather than taking them as command-line arguments. Command-line arguments appear to other users in ps output, end up in shell history, etc.

If you're happy with that, then it's ready to merge.

@TheLortex
Copy link
Author

Great, that looks good. I'm happy with that ! I'll update the ocluster PR.

@talex5 talex5 merged commit bb3af25 into ocurrent:master Mar 17, 2021
tmcgilchrist added a commit to tmcgilchrist/opam-repository that referenced this pull request Jun 17, 2022
CHANGES:

- Use GNU tar format instead of UStar for `copy` operations (@TheLortex ocurrent/obuilder#82, reviewed @dra27).
  This enables copying from sources containing long file names (>100 characters).

- Add support for secrets (@TheLortex ocurrent/obuilder#63, reviewed by @talex5).
  The obuilder spec's `run` command supports a new `secrets` fields, which allows to temporarily
  mount secret files in an user-specified location. The sandbox build context has an additional
  `secrets` parameter to provide values for the requested keys.

- Limit permissions on temporary directories (@talex5 ocurrent/obuilder#67)

- Check Linux kernel version support for btrfs (@kit-ty-kate ocurrent/obuilder#68)

- Generalise obuilder sandbox, removing runc/linux specifc pieces and
  making the S.SANDBOX interface more general
  (@patricoferris ocurrent/obuilder#58, reviewed by @talex5, @avsm, @MisterDA)

- Convert --fast-sync back to a flag (@talex5 ocurrent/obuilder#72)

- Support Fmt.cli and Logs.cli flags. (@MisterDA ocurrent/obuilder#74, reviewed by @talex5)
  For Fmt the new options are --color=always|never|auto
  For Log the new options are:
    -v, --verbose Increase verbosity
    --verbosity=LEVEL (absent=warning)
        Be more or less verbose. LEVEL must be one of quiet, error,
        warning, info or debug. Takes over -v.

- Minor cleanup changes (@talex5 ocurrent/obuilder#76)

- Fix deprecations in Fmt 0.8.10 (@tmcgilchrist ocurrent/obuilder#80)

- Remove travis-ci and replace with Github Actions (@MisterDA ocurrent/obuilder#84)

- Add RSync store backend for obuilder to support macOS builders (@patricoferris ocurrent/obuilder#88, reviewed @talex5)

- Fixes for ZFS tests in CI (@patricoferris ocurrent/obuilder#91)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants