containers / containers/podman-security-bench
Test 3
- Dominant language
- Shell
- Stars
- 66
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
A clear and concise description of what the bug is.
If you install podman based on the documentation and execute Podman security bench.
```
node@docker-host:~/podman-security-bench$ sudo bash podman-security-bench.sh -p PRINT
# --------------------------------------------------------------------------------------------
# Podman Security Bench v1.0.0
#
# Based off of Docker Bench for security
# Docker, Inc. (c) 2015-2021
#
# Checks for dozens of common best-practices around deploying Podman containers in production.
# Based on the CIS Docker Benchmark 1.3.1.
# --------------------------------------------------------------------------------------------
...
[INFO] 3.15 - Ensure that the Podman socket file ownership is set to root:podman (Automated)
[INFO] * File not found
[INFO] 3.16 - Ensure that the Podman socket file permissions are set to 660 or more restrictively (Automated)
[INFO] * File not found
....
[INFO] 3.15 - You should run the following command: chown root:podman /var/run/podman.sock. This sets the ownership to root and group ownership to podman for the default Podman socket file. Remediation Impact: None.
[INFO] 3.16 - You should run the following command: chmod 660 /var/run/podman.sock. This sets the file permissions of the Podman socket file to 660. Remediation Impact: None.
```
The file podman.sock is created on this path.
```
root@docker-host:/var/run/podman# ls -la
total 0
drwx------ 2 root root 60 Nov 8 15:11 .
drwxr-xr-x 34 root root 1040 Nov 8 17:38 ..
srw-rw---- 1 root root 0 Nov 8 15:11 podman.sock
root@docker-host:/var/run/podman# pwd
/var/run/podman
root@docker-host:/var/run/podman#
```
Version
```
node@docker-host:~$ podman version
Client: Podman Engine
Version: 4.9.3
API Version: 4.9.3
Go Version: go1.22.2
Built: Thu Jan 1 00:00:00 1970
OS/Arch: linux/amd64
node@docker-host:~$ podman info
host:
arch: amd64
buildahVersion: 1.33.7
cgroupControllers:
- cpu
- memory
- pids
cgroupManager: systemd
cgroupVersion: v2
conmon:
package: conmon_2.1.10+ds1-1build2_amd64
path: /usr/bin/conmon
version: 'conmon version 2.1.10, commit: unknown'
cpuUtilization:
idlePercent: 97.08
systemPercent: 1.33
userPercent: 1.6
cpus: 2
databaseBackend: sqlite
distribution:
codename: noble
distribution: ubuntu
version: "24.04"
eventLogger: journald
freeLocks: 2032
hostname: docker-host
idMappings:
gidmap:
- container_id: 0
host_id: 1002
size: 1
- container_id: 1
host_id: 165536
size: 65536
uidmap:
- container_id: 0
host_id: 1001
size: 1
- container_id: 1
host_id: 165536
size: 65536
kernel: 6.8.0-48-generic
linkmode: dynamic
logDriver: journald
memFree: 1997520896
memTotal: 8327790592
networkBackend: netavark
networkBackendInfo:
backend: netavark
dns:
package: aardvark-dns_1.4.0-5_amd64
path: /usr/lib/podman/aardvark-dns
version: aardvark-dns 1.4.0
package: netavark_1.4.0-4_amd64
path: /usr/lib/podman/netavark
version: netavark 1.4.0
ociRuntime:
name: crun
package: crun_1.14.1-1_amd64
path: /usr/bin/crun
version: |-
crun version 1.14.1
commit: de537a7965bfbe9992e2cfae0baeb56a08128171
rundir: /run/user/1001/crun
spec: 1.0.0
+SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +WASM:wasmedge +YAJL
os: linux
pasta:
executable: /usr/bin/pasta
package: passt_0.0~git20240220.1e6f92b-1_amd64
version: |
pasta unknown version
Copyright Red Hat
GNU General Public License, version 2 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
remoteSocket:
exists: true
path: /run/user/1001/podman/podman.sock
security:
apparmorEnabled: false
capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
rootless: true
seccompEnabled: true
seccompProfilePath: /usr/share/containers/seccomp.json
selinuxEnabled: false
serviceIsRemote: false
slirp4netns:
executable: /usr/bin/slirp4netns
package: slirp4netns_1.2.1-1build2_amd64
version: |-
slirp4netns version 1.2.1
commit: 09e31e92fa3d2a1d3ca261adaeb012c8d75a8194
libslirp: 4.7.0
SLIRP_CONFIG_VERSION_MAX: 4
libseccomp: 2.5.5
swapFree: 32209858560
swapTotal: 32211181568
uptime: 2h 37m 17.00s (Approximately 0.08 days)
variant: ""
plugins:
authorization: null
log:
- k8s-file
- none
- passthrough
- journald
network:
- bridge
- macvlan
- ipvlan
volume:
- local
registries: {}
store:
configFile: /home/node/.config/containers/storage.conf
containerStore:
number: 12
paused: 0
running: 12
stopped: 0
graphDriverName: overlay
graphOptions: {}
graphRoot: /home/node/.local/share/containers/storage
graphRootAllocated: 63090503680
graphRootUsed: 23360323584
graphStatus:
Backing Filesystem: extfs
Native Overlay Diff: "true"
Supports d_type: "true"
Supports shifting: "false"
Supports volatile: "true"
Using metacopy: "false"
imageCopyTmpDir: /tmp/user/1001
imageStore:
number: 29
runRoot: /tmp/user/1001/containers-user-1001/containers
transientStore: false
volumePath: /home/node/.local/share/containers/storage/volumes
version:
APIVersion: 4.9.3
Built: 0
BuiltTime: Thu Jan 1 00:00:00 1970
GitCommit: ""
GoVersion: go1.22.2
Os: linux
OsArch: linux/amd64
Version: 4.9.3
node@docker-host:~$
```
Expected behavior
A clear and concise description of what you expected to happen.
The test should look for the file in the correct path
https://github.com/containers/podman-security-bench/blob/main/tests/3_podman_configuration_files.sh
Contributor guide
Assessment
This issue has not been assessed yet.