This example runs Lynis in a container using the official CISOfy Docker image.
See Docker installation: Docker
The official Lynis Docker image is maintained by CISOfy:
cisofy/lynis:latest# Pull the official Lynis image
docker pull cisofy/lynis:latest
# Run a quick security audit
docker run --rm -v /:/host:ro --privileged cisofy/lynis:latest audit system
# Run specific audit categories
docker run --rm -v /:/host:ro --privileged cisofy/lynis:latest audit system --category security
version: '3.8'
services:
lynis:
image: cisofy/lynis:latest
container_name: lynis-audit
volumes:
- /:/host:ro
- ./lynis-report:/var/log/lynis
privileged: true
command: ["audit", "system"]
--privileged) to perform a complete system audit/host for scanning/var/log/lynis