Skip to content

Commit

Permalink
docker: Add 'keylime' system user
Browse files Browse the repository at this point in the history
This allows dropping privileges inside the container.

Signed-off-by: Anderson Toshiyuki Sasaki <[email protected]>
  • Loading branch information
ansasaki committed Aug 11, 2023
1 parent 8997333 commit 5965a15
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docker/release/Dockerfile.distroless
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,8 @@ LABEL install="podman volume create keylime-agent"
LABEL uninstall="podman volume rm keylime-agent"
LABEL run="podman run --read-only --name keylime-agent --rm --device /dev/tpm0 --device /dev/tpmrm0 -v keylime-agent:/var/lib/keylime -v /etc/keylime:/etc/keylime:ro --tmpfs /var/lib/keylime/secure:rw,size=1m,mode=0700 -dt IMAGE"

# Create a system user 'keylime' to allow dropping privileges
RUN useradd -s /sbin/nologin -r -G tss keylime

# run as root by default
USER 0:0
3 changes: 3 additions & 0 deletions docker/release/Dockerfile.fedora
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,8 @@ LABEL install="podman volume create keylime-agent"
LABEL uninstall="podman volume rm keylime-agent"
LABEL run="podman run --read-only --name keylime-agent --rm --device /dev/tpm0 --device /dev/tpmrm0 -v keylime-agent:/var/lib/keylime -v /etc/keylime:/etc/keylime:ro --tmpfs /var/lib/keylime/secure:rw,size=1m,mode=0700 -dt IMAGE"

# Create a system user 'keylime' to allow dropping privileges
RUN useradd -s /sbin/nologin -r -G tss keylime

# run as root by default
USER 0:0
3 changes: 3 additions & 0 deletions docker/release/Dockerfile.wolfi
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,8 @@ LABEL install="podman volume create keylime-agent"
LABEL uninstall="podman volume rm keylime-agent"
LABEL run="podman run --read-only --name keylime-agent --rm --device /dev/tpm0 --device /dev/tpmrm0 -v keylime-agent:/var/lib/keylime -v /etc/keylime:/etc/keylime:ro --tmpfs /var/lib/keylime/secure:rw,size=1m,mode=0700 -dt IMAGE"

# Create a system user 'keylime' to allow dropping privileges
RUN useradd -s /sbin/nologin -r -G tss keylime

# run as root by default
USER 0:0

0 comments on commit 5965a15

Please sign in to comment.