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

feat: allow disabling systemd hardening #74

Merged
merged 1 commit into from
Jan 7, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
libretime_allow_restart: true
libretime_migrate: true
libretime_systemd_hardening: true

# libretime_config_template:
libretime_public_url: "http://localhost:{{ libretime_listen_port }}/"
Expand Down
2 changes: 2 additions & 0 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ provisioner:
libretime_playout_systemd_override: |
[Service]
Environment=LIBRETIME_LOG_LEVEL=debug
libretime_systemd_hardening: false
instance2:
libretime_public_url: http://localhost:{{ libretime_listen_port }}/
libretime_listen_port: 9002
libretime_api_key: hackme
libretime_secret_key: hackme
libretime_systemd_hardening: false

verifier:
name: testinfra
2 changes: 2 additions & 0 deletions templates/systemd/libretime-analyzer.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Description=LibreTime Media Analyzer Service
PartOf=libretime.target

[Service]
{%- if libretime_systemd_hardening %}
NoNewPrivileges=true
CapabilityBoundingSet=
PrivateDevices=true
Expand All @@ -16,6 +17,7 @@ ProtectKernelModules=true
ProtectKernelTunables=true
ProtectProc=invisible
ProtectSystem=full
{%- endif %}

Environment=PATH={{ libretime_venv_dir }}/bin:/usr/local/bin:/usr/bin:/bin
Environment=LIBRETIME_CONFIG_FILEPATH={{ libretime_config_filepath }}
Expand Down
2 changes: 2 additions & 0 deletions templates/systemd/libretime-api.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Requires=libretime-api.socket
PartOf=libretime.target

[Service]
{%- if libretime_systemd_hardening %}
NoNewPrivileges=true
CapabilityBoundingSet=
PrivateDevices=true
Expand All @@ -17,6 +18,7 @@ ProtectKernelModules=true
ProtectKernelTunables=true
ProtectProc=invisible
ProtectSystem=full
{%- endif %}

Environment=PATH={{ libretime_venv_dir }}/bin:/usr/local/bin:/usr/bin:/bin
Environment=LIBRETIME_CONFIG_FILEPATH={{ libretime_config_filepath }}
Expand Down
2 changes: 2 additions & 0 deletions templates/systemd/libretime-liquidsoap.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Description=LibreTime Liquidsoap Service
PartOf=libretime.target

[Service]
{%- if libretime_systemd_hardening %}
NoNewPrivileges=true
CapabilityBoundingSet=
PrivateDevices=true
Expand All @@ -16,6 +17,7 @@ ProtectKernelModules=true
ProtectKernelTunables=true
ProtectProc=invisible
ProtectSystem=full
{%- endif %}

Environment=PATH={{ libretime_venv_dir }}/bin:/usr/local/bin:/usr/bin:/bin
Environment=LIBRETIME_CONFIG_FILEPATH={{ libretime_config_filepath }}
Expand Down
2 changes: 2 additions & 0 deletions templates/systemd/libretime-playout.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Wants=libretime-liquidsoap.service
After=libretime-liquidsoap.service

[Service]
{%- if libretime_systemd_hardening %}
NoNewPrivileges=true
CapabilityBoundingSet=
PrivateDevices=true
Expand All @@ -18,6 +19,7 @@ ProtectKernelModules=true
ProtectKernelTunables=true
ProtectProc=invisible
ProtectSystem=full
{%- endif %}

Environment=PATH={{ libretime_venv_dir }}/bin:/usr/local/bin:/usr/bin:/bin
Environment=LIBRETIME_CONFIG_FILEPATH={{ libretime_config_filepath }}
Expand Down
2 changes: 2 additions & 0 deletions templates/systemd/libretime-worker.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Description=LibreTime Worker Service
PartOf=libretime.target

[Service]
{%- if libretime_systemd_hardening %}
NoNewPrivileges=true
CapabilityBoundingSet=
PrivateDevices=true
Expand All @@ -16,6 +17,7 @@ ProtectKernelModules=true
ProtectKernelTunables=true
ProtectProc=invisible
ProtectSystem=full
{%- endif %}

Environment=PATH={{ libretime_venv_dir }}/bin:/usr/local/bin:/usr/bin:/bin
Environment=LIBRETIME_CONFIG_FILEPATH={{ libretime_config_filepath }}
Expand Down