Browse Source

FreeBSD: apache.manage_security

tags/v0.37.4
Alexander Weidinger 8 years ago
parent
commit
0590e43973
3 changed files with 22 additions and 2 deletions
  1. +7
    -0
      apache/files/FreeBSD/apache-2.4.config.jinja
  2. +3
    -0
      apache/files/FreeBSD/security.conf.jinja
  3. +12
    -2
      apache/manage_security.sls

+ 7
- 0
apache/files/FreeBSD/apache-2.4.config.jinja View File

SSLRandomSeed connect builtin SSLRandomSeed connect builtin
</IfModule> </IfModule>


# Default Values
ServerTokens Prod
ServerSignature Off
TraceEnable Off
# Well, IncludeOptional behaved lile Include
IncludeOptional etc/apache24/extra/security.con[f]

Include etc/apache24/Includes/*.conf Include etc/apache24/Includes/*.conf



+ 3
- 0
apache/files/FreeBSD/security.conf.jinja View File

{% for option, value in salt['pillar.get']('apache:security', {}).items() -%}
{{ option }} {{ value }}
{% endfor %}

+ 12
- 2
apache/manage_security.sls View File

{% if grains['os_family']=="Debian" %}

{% from "apache/map.jinja" import apache with context %} {% from "apache/map.jinja" import apache with context %}


include: include:
- apache - apache


{% if grains['os_family']=="Debian" %}

{% if salt['file.file_exists' ]('/etc/apache2/conf-available/security.conf') %} {% if salt['file.file_exists' ]('/etc/apache2/conf-available/security.conf') %}
apache_security-block: apache_security-block:
file.blockreplace: file.blockreplace:


{% endif %} {% endif %}


{% elif grains['os_family']=="FreeBSD" %}
{{ apache.confdir }}/security.conf:
file.managed:
- source: salt://apache/files/{{ salt['grains.get']('os_family') }}/security.conf.jinja
- mode: 644
- template: jinja
- require:
- pkg: apache
- watch_in:
- module: apache-restart
{% endif %} {% endif %}

Loading…
Cancel
Save