Skip to content

Commit

Permalink
Added test for firewalls
Browse files Browse the repository at this point in the history
  • Loading branch information
pyllyukko committed Dec 18, 2024
1 parent 28f12e1 commit 7c6a8a1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/ansible-playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,3 +267,25 @@ jobs:
with:
name: lynis-storage.log
path: /var/log/lynis.log
firewalls:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Lynis
run: |
ansible-playbook harden.yml --tags lynis --skip-tags slackware,centos
echo 'skip-upgrade-test=yes' | sudo tee -a /etc/lynis/custom.prf
- name: Run Lynis (pre-harden)
run: sudo lynis audit system --skip-plugins --tests-from-group firewalls
- name: Run Ansible playbook for network
run: ansible-playbook harden.yml --tags firewall --skip-tags slackware
- name: Run Lynis
run: sudo lynis audit system --skip-plugins --tests-from-group firewalls
- name: chmod Lynis log
run: sudo chmod -c 644 /var/log/lynis.log
- name: Archive Lynis log
uses: actions/upload-artifact@v4
with:
name: lynis-firewalls.log
path: /var/log/lynis.log
4 changes: 2 additions & 2 deletions tasks/network.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# TCP wrappers
- name: Install TCP wrappers library and nftables (Debian)
when: ansible_distribution == "Debian" or ansible_distribution == "Kali"
when: ansible_distribution == "Debian" or ansible_distribution == "Kali" or ansible_distribution == "Ubuntu"
become: true
ansible.builtin.apt:
update_cache: true
Expand Down Expand Up @@ -109,7 +109,7 @@
- network
- debian
become: true
when: ansible_distribution == "Debian" or ansible_distribution == "Kali"
when: ansible_distribution == "Debian" or ansible_distribution == "Kali" or ansible_distribution == "Ubuntu"
block:
- name: Copy nftables.conf
ansible.builtin.template:
Expand Down

0 comments on commit 7c6a8a1

Please sign in to comment.