mirror of
https://github.com/trailofbits/algo.git
synced 2025-06-06 15:13:56 +02:00
CPU and memory limitations of the services #63
This commit is contained in:
parent
5ecd23c59c
commit
19797bc020
9 changed files with 51 additions and 4 deletions
|
@ -7,9 +7,6 @@ easyrsa_cert_expire: 3650
|
||||||
# If True re-init all existing certificates. (True or False)
|
# If True re-init all existing certificates. (True or False)
|
||||||
easyrsa_reinit_existent: False
|
easyrsa_reinit_existent: False
|
||||||
|
|
||||||
# Strongswan cgroup limitations
|
|
||||||
ipsec_memory_limit: 67108864
|
|
||||||
|
|
||||||
vpn_network: 10.19.48.0/24
|
vpn_network: 10.19.48.0/24
|
||||||
vpn_network_ipv6: 'fd9d:bc11:4020::/48'
|
vpn_network_ipv6: 'fd9d:bc11:4020::/48'
|
||||||
# https://www.sixxs.net/tools/whois/?fd9d:bc11:4020::/48
|
# https://www.sixxs.net/tools/whois/?fd9d:bc11:4020::/48
|
||||||
|
|
|
@ -15,6 +15,17 @@
|
||||||
- name: Enforce the dnsmasq AppArmor policy
|
- name: Enforce the dnsmasq AppArmor policy
|
||||||
shell: aa-enforce usr.sbin.dnsmasq
|
shell: aa-enforce usr.sbin.dnsmasq
|
||||||
|
|
||||||
|
- name: Ensure that the dnsmasq service directory exist
|
||||||
|
file: path=/etc/systemd/system/dnsmasq.service.d/ state=directory mode=0755 owner=root group=root
|
||||||
|
|
||||||
|
- name: Setup the cgroup limitations for the ipsec daemon
|
||||||
|
template: src=100-CustomLimitations.conf.j2 dest=/etc/systemd/system/dnsmasq.service.d/100-CustomLimitations.conf
|
||||||
|
notify:
|
||||||
|
- daemon-reload
|
||||||
|
- restart dnsmasq
|
||||||
|
|
||||||
|
- meta: flush_handlers
|
||||||
|
|
||||||
- name: Dnsmasq configured
|
- name: Dnsmasq configured
|
||||||
template: src=dnsmasq.conf.j2 dest=/etc/dnsmasq.conf
|
template: src=dnsmasq.conf.j2 dest=/etc/dnsmasq.conf
|
||||||
notify:
|
notify:
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
[Service]
|
||||||
|
MemoryLimit=16777216
|
||||||
|
CPUAccounting=true
|
||||||
|
CPUQuota=5%
|
|
@ -1,6 +1,9 @@
|
||||||
- name: restart privoxy
|
- name: restart privoxy
|
||||||
service: name=privoxy state=restarted
|
service: name=privoxy state=restarted
|
||||||
|
|
||||||
|
- name: daemon-reload
|
||||||
|
shell: systemctl daemon-reload
|
||||||
|
|
||||||
- name: restart apparmor
|
- name: restart apparmor
|
||||||
service: name=apparmor state=restarted
|
service: name=apparmor state=restarted
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,17 @@
|
||||||
- name: Enforce the privoxy AppArmor policy
|
- name: Enforce the privoxy AppArmor policy
|
||||||
shell: aa-enforce usr.sbin.privoxy
|
shell: aa-enforce usr.sbin.privoxy
|
||||||
|
|
||||||
|
- name: Ensure that the privoxy service directory exist
|
||||||
|
file: path=/etc/systemd/system/privoxy.service.d/ state=directory mode=0755 owner=root group=root
|
||||||
|
|
||||||
|
- name: Setup the cgroup limitations for the privoxy daemon
|
||||||
|
template: src=privoxy_100-CustomLimitations.conf.j2 dest=/etc/systemd/system/privoxy.service.d/100-CustomLimitations.conf
|
||||||
|
notify:
|
||||||
|
- daemon-reload
|
||||||
|
- restart privoxy
|
||||||
|
|
||||||
|
- meta: flush_handlers
|
||||||
|
|
||||||
- name: Privoxy enabled and started
|
- name: Privoxy enabled and started
|
||||||
service: name=privoxy state=started enabled=yes
|
service: name=privoxy state=started enabled=yes
|
||||||
|
|
||||||
|
@ -59,3 +70,14 @@
|
||||||
template: src=ports.conf.j2 dest=/etc/apache2/ports.conf
|
template: src=ports.conf.j2 dest=/etc/apache2/ports.conf
|
||||||
notify:
|
notify:
|
||||||
- restart apache2
|
- restart apache2
|
||||||
|
|
||||||
|
- name: Ensure that the apache2 service directory exist
|
||||||
|
file: path=/etc/systemd/system/apache2.service.d/ state=directory mode=0755 owner=root group=root
|
||||||
|
|
||||||
|
- name: Setup the cgroup limitations for the apache2 daemon
|
||||||
|
template: src=apache2_100-CustomLimitations.conf.j2 dest=/etc/systemd/system/apache2.service.d/100-CustomLimitations.conf
|
||||||
|
notify:
|
||||||
|
- daemon-reload
|
||||||
|
- restart apache2
|
||||||
|
|
||||||
|
- meta: flush_handlers
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
[Service]
|
||||||
|
MemoryLimit=134217728
|
||||||
|
CPUAccounting=true
|
||||||
|
CPUQuota=15%
|
|
@ -0,0 +1,4 @@
|
||||||
|
[Service]
|
||||||
|
MemoryLimit=33554432
|
||||||
|
CPUAccounting=true
|
||||||
|
CPUQuota=15%
|
|
@ -35,6 +35,8 @@
|
||||||
- daemon-reload
|
- daemon-reload
|
||||||
- restart strongswan
|
- restart strongswan
|
||||||
|
|
||||||
|
- meta: flush_handlers
|
||||||
|
|
||||||
- name: Setup the strongswan.conf file from our template
|
- name: Setup the strongswan.conf file from our template
|
||||||
template: src=strongswan.conf.j2 dest=/etc/strongswan.conf owner=root group=root mode=0644
|
template: src=strongswan.conf.j2 dest=/etc/strongswan.conf owner=root group=root mode=0644
|
||||||
notify:
|
notify:
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
[Service]
|
[Service]
|
||||||
MemoryLimit={{ ipsec_memory_limit }}
|
MemoryLimit=16777216
|
||||||
|
|
Loading…
Add table
Reference in a new issue