sethvargo / ratchet

A tool for securing CI/CD workflows with version pinning.
Apache License 2.0
772 stars 32 forks source link

Allow filtering of certain docker images by URL #36

Closed vikingair closed 2 years ago

vikingair commented 2 years ago

TL;DR

Currently running e.g. the "pin" command tries to pin every image and action. For private images this is not wanted and currently lets the execution fail. So I have to manually out-comment the line before running the command.

Detailed design

container:
      image: eu.gcr.io/<GCP_ID>/images/<IMAGE_NAME>:<IMAGE_TAG>
      credentials:
        username: _json_key
        password: ${{ secrets.GCP_SERVICE_ACCOUNT }}

Additional information

sethvargo commented 2 years ago

You can exclude specific lines with a ratchet:exclude comment: https://github.com/sethvargo/ratchet#excluding. In your case, that would be:

container:
  image: eu.gcr.io/<GCP_ID>/images/<IMAGE_NAME>:<IMAGE_TAG> # ratchet:exclude
  credentials:
    username: _json_key
    password: ${{ secrets.GCP_SERVICE_ACCOUNT }}

Additionally, for private images, Ratchet uses the default Docker keychain auth. So if the authenticated user has permission to read images from the Docker registry, so will ratchet: https://github.com/sethvargo/ratchet#auth

vikingair commented 2 years ago

I've used the docker image of Ratchet and don't wanted to authenticate it. I was not fully reading the docs, but thanks for your hint. That will be sufficient for me 👍