Skip to content

Commit

Permalink
Add security opt no-new-privileges:true to all compose files
Browse files Browse the repository at this point in the history
Also enabling pre-commit hook to check that.
  • Loading branch information
claha committed Nov 5, 2023
1 parent dc59202 commit fe9eb01
Show file tree
Hide file tree
Showing 21 changed files with 42 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ repos:
- \\n

- repo: https://github.com/claha/docker-compose-check
rev: v0.2.0
rev: v0.3.0
hooks:
- id: check-registry
- id: check-socket
- id: check-no-new-privileges

- repo: https://github.com/iamthefij/docker-pre-commit
rev: v3.0.1
Expand Down
2 changes: 2 additions & 0 deletions roles/autorestic/templates/compose.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ services:
autorestic:
image: docker.io/cupcakearmy/autorestic:1.7.9
container_name: autorestic
security_opt:
- no-new-privileges:true
volumes:
- {{ services_path }}:{{ services_path }}
- ./autorestic.yaml:/root/.autorestic.yaml:ro
Expand Down
2 changes: 2 additions & 0 deletions roles/dashdot/templates/compose.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ services:
image: docker.io/mauricenino/dashdot:5.2.3
container_name: dashdot
privileged: true
security_opt:
- no-new-privileges:true
environment:
DASHDOT_SHOW_HOST: "true"
DASHDOT_CUSTOM_HOST: "{{ ansible_hostname }}"
Expand Down
2 changes: 2 additions & 0 deletions roles/doku/templates/compose.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ services:
doku:
image: docker.io/amerkurev/doku:v0.0.16
container_name: doku
security_opt:
- no-new-privileges:true
ports:
- 9090:9090
volumes:
Expand Down
2 changes: 2 additions & 0 deletions roles/dozzle/templates/compose.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ services:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- proxy
security_opt:
- no-new-privileges:true
environment:
DOZZLE_LEVEL: debug
restart: unless-stopped
Expand Down
2 changes: 2 additions & 0 deletions roles/duckdns/templates/compose.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ services:
duckdns:
image: lscr.io/linuxserver/duckdns:256b24bf-ls147
container_name: duckdns
security_opt:
- no-new-privileges:true
environment:
- SUBDOMAINS={{ duckdns_domain }}
- TOKEN={{ duckdns_token }}
Expand Down
2 changes: 2 additions & 0 deletions roles/gatus/templates/compose.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ services:
networks:
- {{ gatus_healthchecks_network }}
{% endif %}
security_opt:
- no-new-privileges:true
ports:
- 8080:8080
volumes:
Expand Down
2 changes: 2 additions & 0 deletions roles/github_deploy/templates/compose.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ services:
container_name: github-deploy
build:
context: .
security_opt:
- no-new-privileges:true
environment:
- "GITHUB_ACCESS_TOKEN={{ github_token }}"
volumes:
Expand Down
2 changes: 2 additions & 0 deletions roles/glances/templates/compose.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ services:
glances:
image: docker.io/nicolargo/glances:3.4.0.3-full
container_name: glances
security_opt:
- no-new-privileges:true
pid: host
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
Expand Down
2 changes: 2 additions & 0 deletions roles/healthchecks/templates/compose.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ services:
networks:
- {{ healthchecks_network }}
{% endif %}
security_opt:
- no-new-privileges:true
ports:
- 8000:8000
environment:
Expand Down
2 changes: 2 additions & 0 deletions roles/homeassistant/templates/compose.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ services:
environment:
TZ: Europe/Stockholm
network_mode: host
security_opt:
- no-new-privileges:true
volumes:
- ./config:/config
privileged: true
Expand Down
2 changes: 2 additions & 0 deletions roles/homepage/templates/compose.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ services:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- proxy
security_opt:
- no-new-privileges:true
restart: unless-stopped
labels:
- traefik.enable=true
Expand Down
2 changes: 2 additions & 0 deletions roles/monocker/templates/compose.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ services:
monocker:
image: docker.io/petersem/monocker:latest
container_name: monocker
security_opt:
- no-new-privileges:true
environment:
SERVER_LABEL: "{{ ansible_hostname }}"
MESSAGE_PLATFORM: "telegram@{{ telegram_token }}@{{ telegram_chatids }}"
Expand Down
2 changes: 2 additions & 0 deletions roles/mosquitto/files/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ services:
mosquitto:
container_name: mosquitto
image: docker.io/eclipse-mosquitto:2.0.18
security_opt:
- no-new-privileges:true
environment:
TZ: Europe/Stockholm
user: 1000:1000
Expand Down
2 changes: 2 additions & 0 deletions roles/pihole/files/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ services:
hostname: pihole
environment:
TZ: Europe/Stockholm
security_opt:
- no-new-privileges:true
ports:
- 53:53/tcp
- 53:53/udp
Expand Down
2 changes: 2 additions & 0 deletions roles/piper/files/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ services:
piper:
image: docker.io/rhasspy/wyoming-piper:1.4.0
container_name: piper
security_opt:
- no-new-privileges:true
ports:
- 10200:10200
volumes:
Expand Down
2 changes: 2 additions & 0 deletions roles/speedtest/templates/compose.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ services:
- ./config:/config
networks:
- proxy
security_opt:
- no-new-privileges:true
environment:
- PUID=1000
- PGID=1000
Expand Down
2 changes: 2 additions & 0 deletions roles/tailscale/templates/compose.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ services:
image: docker.io/tailscale/tailscale:v1.52.0
container_name: tailscaled
network_mode: host
security_opt:
- no-new-privileges:true
volumes:
- /var/lib:/var/lib
- /dev/net/tun:/dev/net/tun
Expand Down
2 changes: 2 additions & 0 deletions roles/traefik/templates/compose.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ services:
container_name: traefik
networks:
- proxy
security_opt:
- no-new-privileges:true
extra_hosts:
- host.docker.internal:172.21.0.1
ports:
Expand Down
2 changes: 2 additions & 0 deletions roles/whisper/files/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ services:
whisper:
image: docker.io/rhasspy/wyoming-whisper:1.0.0
container_name: whisper
security_opt:
- no-new-privileges:true
ports:
- 10300:10300
volumes:
Expand Down
2 changes: 2 additions & 0 deletions roles/zigbee2mqtt/files/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ services:
platform: linux/arm/v6
environment:
- TZ=Europe/Stockholm
security_opt:
- no-new-privileges:true
network_mode: host
volumes:
- ./data:/app/data
Expand Down

0 comments on commit fe9eb01

Please sign in to comment.