-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated self-check tasks on a few roles
- Loading branch information
Andre Rodier
committed
Feb 19, 2024
1 parent
3ff96b9
commit b845cdb
Showing
19 changed files
with
80 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
--- | ||
|
||
- name: Check that opendkim is running in enforced mode | ||
- name: Check that postfix kbinary is running in enforced mode | ||
register: aa_status | ||
ansible.builtin.shell: >- | ||
set -o pipefail; | ||
aa-status --json | jq '.profiles["{{ sogo_binary }}"]' | ||
aa-status --json | jq '.profiles["{{ postfix_binary }}"]' | ||
changed_when: false | ||
loop: '{{ sogo_binaries }}' | ||
args: | ||
executable: /bin/bash | ||
loop: '{{ postfix_binaries }}' | ||
loop_control: | ||
loop_var: sogo_binary | ||
loop_var: postfix_binary | ||
failed_when: > | ||
aa_status.stdout | trim('"') != "enforce" | ||
tags: apparmor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
--- | ||
|
||
- name: Load prometheus home page | ||
- name: Ensure prometheus is not publicly accessible | ||
delegate_to: localhost | ||
become: false | ||
ansible.builtin.uri: | ||
url: https://prometheus.{{ network.domain }}/ | ||
return_content: true | ||
status_code: [ 401 ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,19 @@ | ||
--- | ||
|
||
- name: Check that every user is in the system, with the correct attributes | ||
ansible.builtin.shell: >- | ||
set -o pipefail ; | ||
getent passwd {{ user.uid }} | ||
changed_when: false | ||
args: | ||
executable: /bin/bash | ||
- name: Check that every user is in the system | ||
ansible.builtin.getent: | ||
key: '{{ user.uid }}' | ||
service: ldap | ||
database: passwd | ||
loop: '{{ users }}' | ||
loop_control: | ||
loop_var: user | ||
|
||
- name: Check that every user has a specific group | ||
ansible.builtin.getent: | ||
key: '{{ user.uid }}' | ||
service: ldap | ||
database: group | ||
loop: '{{ users }}' | ||
loop_control: | ||
loop_var: user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,9 @@ | ||
--- | ||
|
||
- name: Check if the autodiscover site is active | ||
- name: Ensure the server is not in public access | ||
ansible.builtin.uri: | ||
url: 'https://autodiscover.{{ network.domain }}/' | ||
url: 'https://webdav.{{ network.domain }}/' | ||
method: HEAD | ||
body: '' | ||
status_code: 200 | ||
status_code: 401 | ||
return_content: true | ||
|
||
- name: Download the XML autodiscover file | ||
vars: | ||
email: 'postmaster@{{ network.domain }}' | ||
ansible.builtin.uri: | ||
url: 'https://autodiscover.{{ network.domain }}/autodiscover/autodiscover.xml' | ||
method: POST | ||
body: '' | ||
status_code: 200 | ||
dest: /tmp/autodiscover.xml | ||
|
||
- name: Check the autodiscover answer is valid | ||
ansible.builtin.shell: xmllint /tmp/autodiscover.xml | ||
changed_when: false | ||
|
||
- name: Remove the downloaded file | ||
ansible.builtin.file: | ||
path: /tmp/autodiscover.xml | ||
state: absent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
|
||
- name: Check the DNS entry | ||
- name: Check that the DNS entry exists | ||
ansible.builtin.getent: | ||
database: hosts | ||
key: 'www.{{ network.domain }}' |