-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
13aa8b5
commit b490faf
Showing
1 changed file
with
34 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Practical 5: Security and Compliance | ||
|
||
- name: Apply security patches | ||
hosts: target_hosts | ||
tasks: | ||
- name: Update package cache | ||
apt: | ||
update_cache: yes | ||
|
||
- name: Upgrade packages | ||
apt: | ||
upgrade: safe | ||
|
||
- name: Enforce security configurations | ||
hosts: target_hosts | ||
tasks: | ||
- name: Copy security configuration file | ||
copy: | ||
src: files/security.conf | ||
dest: /etc/security.conf | ||
owner: root | ||
group: root | ||
mode: 0644 | ||
|
||
- name: Restart service | ||
service: | ||
name: my_service | ||
state: restarted | ||
|
||
- name: Perform compliance audits | ||
hosts: target_hosts | ||
tasks: | ||
- name: Run compliance audit script | ||
command: /usr/bin/compliance_audit.sh |