Registry credentials.
Let Rivex pin the base images of a Dockerfile that come from a private registry, with a token that you pass for one run or store for your account or organization.
Why you need them.
Rivex pins each FROM line to a digest, so a tag cannot change under you. For a public image it reads the digest through its own caches. An image on a registry that needs a login is out of reach of the caches, so Rivex leaves the FROM line as it is and the finding says that the registry requires credentials. With a credential, Rivex reads the digest on that registry and pins the image.
A credential is only for reading the digest of an image. Use a read-only token with pull access.
Pass a token for one run.
The safest way is a short-lived token that you pass with the request. Rivex uses it for that request only and never stores it.
With the CLI, set RIVEX_REGISTRY_AUTH to one host=username:secret entry per registry, separated by spaces or new lines. The secret may contain : and =. The CLI has no flag for it, because the arguments of a command are visible to other processes. Replace <token> with your token.
export RIVEX_REGISTRY_AUTH='ghcr.io=me:<token>'
rivex --api-url "$RIVEX_API_URL" harden Dockerfile With the GitHub Action, use the registry-auth input. For GitHub Container Registry, the workflow's own token is enough, with read access to packages:
permissions:
contents: read
packages: read
steps:
- uses: actions/checkout@v4
- uses: Rivex-Security/rivex-cli@v1
with:
api-key: ${{ secrets.RIVEX_API_KEY }}
registry-auth: |
ghcr.io=${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} For Amazon ECR, sign in to AWS with aws-actions/configure-aws-credentials (OIDC, no stored key), then get a password that lasts 12 hours. The user name is AWS:
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::123456789012:role/rivex-ecr-read
aws-region: us-east-1
- id: ecr
run: echo "password=$(aws ecr get-login-password)" >> "$GITHUB_OUTPUT"
- uses: Rivex-Security/rivex-cli@v1
with:
api-key: ${{ secrets.RIVEX_API_KEY }}
registry-auth: |
123456789012.dkr.ecr.us-east-1.amazonaws.com=AWS:${{ steps.ecr.outputs.password }} For Google Artifact Registry, sign in with google-github-actions/auth (workload identity federation, no stored key) and pass an access token. The user name is oauth2accesstoken:
- id: auth
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ vars.WIF_PROVIDER }}
service_account: ${{ vars.WIF_SERVICE_ACCOUNT }}
token_format: access_token
- uses: Rivex-Security/rivex-cli@v1
with:
api-key: ${{ secrets.RIVEX_API_KEY }}
registry-auth: |
europe-docker.pkg.dev=oauth2accesstoken:${{ steps.auth.outputs.access_token }} ECR and Artifact Registry hosts are not on the list of allowed hosts yet. See the allowed hosts.
Store a credential.
If you cannot pass a token, store one. Open Settings for a credential of your own account, or Organization for one that every run of the organization uses. Type the registry host, the repository namespace, the user name and the token, then select Save credential.
Use a read-only token with pull access only. Rivex encrypts it with its own key, wrapped by Cloud KMS, and shows only its last four characters from then on. You cannot read it back. To change it, delete it and add it again. Deleting it stops its use at once.
A run uses the credentials of its owner. A run with no policy, or with a personal policy, uses your own. A run with an organization's policy uses the organization's. Only owners and admins of an organization can change its credentials, and every member's run uses them. Each use, creation and deletion goes to the audit log without the host or the token.
You can store 20 credentials for your account and 20 for each organization, one per host. The same routes are in the API reference.
Stored credentials are used only for runs started with an API key (the X-API-Key header, or the CLI with RIVEX_API_KEY) or from the signed-in web app. They are not used with a bearer token (--token) or by the GitHub App. If you signed in to the web app before this change, sign in again for your runs to use stored credentials. Credentials that you pass for one run (registry_auth) keep working with any sign-in.
Repository namespace.
The namespace is the path after the host, at least the owner. For ghcr.io/acme/app it is acme. A credential is used only for images inside its namespace: acme matches ghcr.io/acme/app and ghcr.io/acme/team/app, and not ghcr.io/acme-labs/app. For Docker Hub official images, such as ubuntu, the namespace is library.
An image outside every namespace gets no credential: Rivex only tries the anonymous lookup through its caches. You can store one credential per host per account or organization.
Credentials saved before namespaces show "Not used by runs". Rivex leaves them unused until they are deleted and added again with a namespace.
Credentials that you pass for one run (RIVEX_REGISTRY_AUTH, registry-auth, registry_auth) have no namespace. They still apply to the whole host.
Allowed hosts.
Rivex sends a credential only to a registry on a reviewed list. A host that is not on it is refused when you save the credential, and a run that passes one for it is refused too. The list is the file api/registry_egress_hosts.txt in the Rivex repository:
docker.io(Docker Hub, and its token service)ghcr.ioquay.io
To ask for another host, open a pull request that adds it to that file, and say which feature needs it. The firewall of the service reads the same file. A credential for a host is matched by name only: ghcr.io:443 does not match ghcr.io.
Rivex follows no redirect, sends the credential only to the registry and to its token service on the same list, and asks for a token that can only pull the one image.
What Rivex does not do.
Rivex does no build verification and no SBOM or vulnerability scan with a credential. A credential is never sent to a build, to the engine or to a scanner, and it never appears in the hardened Dockerfile. A private FROM line stays "not verifiable offline" for those steps.
Rivex does not sign in to a cloud on your behalf. Pass a short-lived token from your own CI, as above.
The feature is off unless the server operator turns it on. When it is off, the credential routes answer 503, and a request that carries registry_auth is refused with 400.