-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from iquzart/development
Development
- Loading branch information
Showing
28 changed files
with
2,961 additions
and
218 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 |
---|---|---|
@@ -1,39 +1,74 @@ | ||
CIS - CentOs | ||
CIS - RHEL 8 Based Systems | ||
========= | ||
|
||
Asible role to apply CIS Benchmark on RHEL 8 based systems (Under Development) | ||
Asible role to apply CIS Benchmark on RHEL 8 based systems. | ||
|
||
|
||
Requirements | ||
------------ | ||
|
||
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. | ||
Create below partitions at the time of installation. The role will not create any of these partitions. | ||
|
||
``` | ||
1.1.6 | Ensure separate partition exists for /var (Scored) | ||
1.1.7 | Ensure separate partition exists for /var/tmp (Scored) | ||
1.1.11 | Ensure separate partition exists for /var/log (Scored) | ||
1.1.12 | Ensure separate partition exists for /var/log/audit (Scored) | ||
1.1.13 | Ensure separate partition exists for /home (Scored) | ||
``` | ||
|
||
Support Matrix | ||
-------------- | ||
|
||
| Destro | Status | | ||
| --- | --- | | ||
| CentOS 8 | Supported (Tested) | | ||
| RHEL 8 | Supported (Tested) | | ||
| Oracle Linux 8 | Supported (Under Testing) | | ||
|
||
|
||
Role Variables | ||
-------------- | ||
|
||
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. | ||
deafult/main.yml variables are pretty self explanatory. | ||
|
||
Dependencies | ||
------------ | ||
|
||
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. | ||
Notes | ||
------ | ||
|
||
|
||
The role will setup Authselect with a custom profile when you enable CIS rules 5.3.1, 5.3.2, 5.4.2, 5.4.3, 5.4.4. | ||
|
||
The recommended approch to join the node to an Active Directory domain with 'realmd' | ||
|
||
Update realmd-distro conf (/usr/lib/realmd/realmd-distro.conf) with below. | ||
``` | ||
[commands] | ||
sssd-enable-logins = /usr/bin/sh -c "/usr/bin/systemctl enable oddjobd.service | ||
&& /usr/bin/systemctl start oddjobd.service" | ||
sssd-disable-logins = /bin/true | ||
``` | ||
Example Playbook | ||
---------------- | ||
|
||
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: | ||
``` | ||
- name: CIS Baseline Setup | ||
hosts: cis | ||
remote_user: vagrant | ||
become: yes | ||
- hosts: servers | ||
roles: | ||
- { role: username.rolename, x: 42 } | ||
roles: | ||
- cis-centos | ||
``` | ||
|
||
License | ||
------- | ||
|
||
BSD | ||
MIT | ||
|
||
Author Information | ||
------------------ | ||
|
||
An optional section for the role authors to include contact information, or a website (HTML is not allowed). | ||
Muhammed Iqbal <[email protected]> |
Large diffs are not rendered by default.
Oops, something went wrong.
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,49 @@ | ||
#!/sbin/nft -f | ||
|
||
# This nftables.rules config should be saved as /etc/nftables/nftables.rules | ||
|
||
# flush nftables rulesset | ||
flush ruleset | ||
|
||
# Load nftables ruleset | ||
|
||
# nftables config with inet table named filter | ||
|
||
table inet filter { | ||
# Base chain for input hook named input (Filters inbound network packets) | ||
chain input { | ||
type filter hook input priority 0; policy drop; | ||
|
||
# Ensure loopback traffic is configured | ||
iif "lo" accept | ||
ip saddr 127.0.0.0/8 counter packets 0 bytes 0 drop | ||
ip6 saddr ::1 counter packets 0 bytes 0 drop | ||
|
||
# Ensure established connections are configured | ||
ip protocol tcp ct state established accept | ||
ip protocol udp ct state established accept | ||
ip protocol icmp ct state established accept | ||
|
||
# Accept port 22(SSH) traffic from anywhere | ||
tcp dport ssh accept | ||
|
||
# Accept ICMP and IGMP from anywhere | ||
icmpv6 type { destination-unreachable, packet-too-big, time-exceeded, parameter-problem, mld-listener-query, mld-listener-report, mld-listener-done, nd-router-solicit, nd-router-advert, nd-neighbor-solicit, nd-neighbor-advert, ind-neighbor-solicit, ind-neighbor-advert, mld2-listener-report } accept | ||
icmp type { destination-unreachable, router-advertisement, router-solicitation, time-exceeded, parameter-problem } accept | ||
ip protocol igmp accept | ||
} | ||
|
||
# Base chain for hook forward named forward (Filters forwarded network packets) | ||
chain forward { | ||
type filter hook forward priority 0; policy drop; | ||
} | ||
|
||
# Base chain for hook output named output (Filters outbount network packets) | ||
chain output { | ||
type filter hook output priority 0; policy drop; | ||
# Ensure outbound and established connections are configured | ||
ip protocol tcp ct state established,related,new accept | ||
ip protocol udp ct state established,related,new accept | ||
ip protocol icmp ct state established,related,new accept | ||
} | ||
} |
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
Oops, something went wrong.