florianutz / Ubuntu1804-CIS

Ubuntu CIS Hardening Ansible Role
MIT License
212 stars 127 forks source link

Check iptables service isn't a service #51

Closed andrefecto closed 4 years ago

andrefecto commented 5 years ago

When running task 3.6.1 to check if the iptables service is enabled, it will fail. This is because (from what I've found about Ubuntu) iptables is not a service that gets installed with CIS documentation. (You have to install package for it.)

Task:

- name: "SCORED | 3.6.1 | PATCH | Ensure iptables is installed and started"
  service:
      name: iptables
      state: started
      enabled: true
  when:
      - ubuntu1804cis_firewall == "iptables"
      - ubuntu1804cis_setup_firewall
  tags:
      - level1
      - scored
      - patch
      - rule_3.6.1

The error that you get:

FAILED! => {"changed": false, "msg": "Could not find the requested service iptables: host"}
florianutz commented 4 years ago

Should be fixed by #64