|
| 1 | +--- |
| 2 | +- name: "(Install: SELinux) Install Required CentOS Dependencies" |
| 3 | + package: |
| 4 | + name: policycoreutils-python, setools |
| 5 | + state: present |
| 6 | + |
| 7 | +- name: "(Install: SELinux) Permissive SELinux" |
| 8 | + selinux: |
| 9 | + state: permissive |
| 10 | + policy: targeted |
| 11 | + when: nginx_selinux |
| 12 | + |
| 13 | +- name: "(Install: SELinux: Booleans) Allow HTTP network connection" |
| 14 | + seboolean: |
| 15 | + name: httpd_can_network_connect |
| 16 | + state: yes |
| 17 | + persistent: yes |
| 18 | + |
| 19 | +- name: "(Install: SELinux: Booleans) Allow HTTP relay connection" |
| 20 | + seboolean: |
| 21 | + name: httpd_can_network_relay |
| 22 | + state: yes |
| 23 | + persistent: yes |
| 24 | + |
| 25 | +- name: "(Install: SELinux: Booleans) Allow HTTP mod auth pam" |
| 26 | + seboolean: |
| 27 | + name: httpd_mod_auth_pam |
| 28 | + state: yes |
| 29 | + persistent: yes |
| 30 | + |
| 31 | +- name: "(Install: SELinux: Booleans) enable NIS" |
| 32 | + seboolean: |
| 33 | + name: nis_enabled |
| 34 | + state: yes |
| 35 | + persistent: yes |
| 36 | + |
| 37 | +- name: "(Install: SELinux: Contexts) App Protect Logs" |
| 38 | + sefcontext: |
| 39 | + target: '/var/log/app_protect(/.*)?' |
| 40 | + setype: httpd_log_t |
| 41 | + state: present |
| 42 | + |
| 43 | +- name: "(Install: SELinux: Contexts) App Protect Opt" |
| 44 | + sefcontext: |
| 45 | + target: '/opt/app_protect(/.*)?' |
| 46 | + setype: httpd_var_run_t |
| 47 | + state: present |
| 48 | + |
| 49 | +- name: "(Install: SELinux: Contexts) App Protect Pipe" |
| 50 | + sefcontext: |
| 51 | + target: '/opt/app_protect/pipe(/.*)?' |
| 52 | + setype: httpd_initrc_exec_t |
| 53 | + state: present |
| 54 | + |
| 55 | +- name: "(Install: SELinux: Contexts) App Protect Config" |
| 56 | + sefcontext: |
| 57 | + target: '/opt/app_protect/config(/.*)?' |
| 58 | + setype: httpd_config_t |
| 59 | + state: present |
| 60 | + |
| 61 | +- name: "(Install: SELinux: Contexts) App Protect bin" |
| 62 | + sefcontext: |
| 63 | + target: '/opt/app_protect/bin(/.*)?' |
| 64 | + setype: httpd_exec_t |
| 65 | + state: present |
| 66 | + |
| 67 | +- name: "(Install: SELinux: Contexts) App Protect lock" |
| 68 | + sefcontext: |
| 69 | + target: '/opt/app_protect/lock(/.*)?' |
| 70 | + setype: httpd_lock_t |
| 71 | + state: present |
| 72 | + |
| 73 | +- name: "(Install: SELinux: Contexts) App Protect Temp" |
| 74 | + sefcontext: |
| 75 | + target: '/opt/app_protect/temp(/.*)?' |
| 76 | + setype: httpd_tmp_t |
| 77 | + state: present |
| 78 | + |
| 79 | +- name: "(Install: SELinux: Contexts) App Protect Tmp" |
| 80 | + sefcontext: |
| 81 | + target: '/opt/app_protect/tmp(/.*)?' |
| 82 | + setype: httpd_tmp_t |
| 83 | + state: present |
| 84 | + |
| 85 | +- name: "(Install: SELinux: Contexts) Apply contexts to opt" |
| 86 | + command: restorecon -iRv /opt/app_protect |
| 87 | + |
| 88 | +- name: "(Install: SELinux: Contexts) Apply contexts to log" |
| 89 | + command: restorecon -iRv /var/log/app_protect |
| 90 | + |
| 91 | +- name: "(Install: SELinux: Custom) Generate policy" |
| 92 | + shell: |
| 93 | + cmd: cat /var/log/audit/audit.log | audit2allow -M local |
| 94 | + chdir: /tmp/ |
| 95 | + args: |
| 96 | + executable: /bin/bash |
| 97 | + |
| 98 | +- name: "(Install: SELinux: Custom) Apply local policy" |
| 99 | + command: semodule -i /tmp/local.pp |
| 100 | + |
| 101 | +- name: "(Install: SELinux) Enforce SELinux" |
| 102 | + selinux: |
| 103 | + state: enforcing |
| 104 | + policy: targeted |
0 commit comments