Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add an article for "immutable image tags" #161

Merged
merged 1 commit into from
Mar 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions docs/articles/immutable-tags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Immutable Image Tags

> :point_right: Immutable image tag support is achieved by leveraging authorization policies.

It is considered best practice to avoid changing the content once a software
version has been released. While `zot` does not have an explicit configuration
flag to make image tags immutable, the same effect can be achieved with
[authorization](../articles/authn-authz.md) as follows.

## Immutable For All Users

By setting the `defaultPolicy` to "read" and "create" for a particular
repository, images can be pushed (once) and pulled but further updates are
rejected.

```json
{
...
"repositories": {
"**": {
"defaultPolicy": ["read", "create"]
}
}
...
}
```

## Immutable With Overrides

As in the example above, with `defaultPolicy` set to "read" and "create" for a
particular repository, images can be pushed (once) and pulled, but further
updates are rejected. Exceptions can be made for some users, and user-specific
policies can be added to allow "update" operations as shown below.

```json
{
...
"repositories": {
"**": {
"policies": [{
"users": ["alice", "bob"],
"actions": ["read", "create", "update"]
}],
"defaultPolicy": ["read", "create"]
}
}
...
}
```
Loading