-
-
Notifications
You must be signed in to change notification settings - Fork 105
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 #21 from alivx/ali_JanFix
General improvement ⚡️
- Loading branch information
Showing
9 changed files
with
172 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,18 @@ set_root_password: yes | |
root_password: r00tP4ssw0rd | ||
|
||
# Section 2 Settings | ||
|
||
#Setting for systemd-timesyncd | ||
enable_systemdtimesyncd: no #If you enable this make sure to disable NTP below, only one time service must be run in the server | ||
timesync_timezone: Etc/UTC | ||
timesync_fallback_ntp_hosts: | ||
- 0.pool.ntp.org | ||
- 1.pool.ntp.org | ||
- 2.pool.ntp.org | ||
- 3.pool.ntp.org | ||
|
||
#Setting for NTP | ||
enableNTP: yes | ||
time_synchronization_package_name: ntp | ||
time_synchronization_servers: | ||
- uri: "time1.google.com" | ||
|
@@ -29,6 +41,19 @@ time_synchronization_servers: | |
config: "iburst" | ||
- uri: "time4.google.com" | ||
config: "iburst" | ||
|
||
# Setting for chrony | ||
chronyEnable: no | ||
chrony_driftfile: /var/lib/chrony/chrony.drift | ||
chronyservers_preferred: [] | ||
chronyservers: | ||
- 0.pool.ntp.org | ||
- 1.pool.ntp.org | ||
- 2.pool.ntp.org | ||
- 3.pool.ntp.org | ||
chrony_keys: /etc/chrony/chrony.keys | ||
chrony_log_dir: /var/log/chrony | ||
|
||
web_server_name: nginx | ||
remove_HTTPserver: no | ||
remove_xinetd: yes | ||
|
@@ -87,7 +112,7 @@ ssh_MACs: "[email protected],[email protected],hmac-sha2 | |
## 5.2.14 Ensure only strong Key Exchange algorithms are used | ||
ssh_key_algorithms: "curve25519-sha256,[email protected],diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256" | ||
## 5.2.17 Ensure SSH access is limited | ||
allowed_users: ali saleh baker root #Put None or list of users space between each user | ||
allowed_users: ubuntu root #Put None or list of users space between each user | ||
allowed_groups: None | ||
deny_users: None | ||
deny_groups: None | ||
|
@@ -101,7 +126,7 @@ pass_warn_age: 7 | |
pass_min_days: 1 | ||
## 5.4.1.1 Ensure password expiration is 365 days or less | ||
list_of_os_users: | ||
- ali | ||
- ubuntu | ||
## 5.4.1.4 Ensure inactive password lock is 30 days or less | ||
##Note: A value of -1 would disable this setting | ||
account_inactive: 30 | ||
|
@@ -111,7 +136,7 @@ shell_timeout_sec: 900 | |
# Section 6 | ||
withoutOwnerFileDirOwner: root | ||
withoutGroupFilesDirGroup: root | ||
outputfiles: /home/ali/ #Output dir of some command | ||
outputfiles: /root/ #Output dir of some command | ||
disable_autofs: true | ||
disable_usb: true | ||
install_apparmor: true | ||
|
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,59 @@ | ||
# {{ ansible_managed }} | ||
|
||
driftfile {{ chrony_driftfile }} | ||
|
||
{% for server in chronyservers_preferred %} | ||
{% if server is search('pool') %} | ||
pool {{ server }} iburst prefer | ||
{% else %} | ||
server {{ server }} iburst prefer | ||
{% endif %} | ||
{% endfor %} | ||
{% for server in chronyservers %} | ||
{% if server is search('pool') %} | ||
pool {{ server }} iburst | ||
{% else %} | ||
server {{ server }} iburst | ||
{% endif %} | ||
{% endfor %} | ||
|
||
# Ignore stratum in source selection. | ||
stratumweight 0 | ||
|
||
# Record the rate at which the system clock gains/losses time. | ||
driftfile {{ chrony_driftfile }} | ||
|
||
# Enable kernel RTC synchronization. | ||
rtcsync | ||
|
||
# This directive tells 'chronyd' to parse the 'adjtime' file to find out if the | ||
# real-time clock keeps local time or UTC. It overrides the 'rtconutc' directive. | ||
hwclockfile /etc/adjtime | ||
|
||
# In first three updates step the system clock instead of slew | ||
# if the adjustment is larger than 10 seconds. | ||
makestep 10 3 | ||
|
||
# Stop bad estimates upsetting machine clock. | ||
maxupdateskew 100.0 | ||
|
||
# Allow NTP client access from local network. | ||
#allow 192.168/16 | ||
|
||
# Listen for commands only on localhost. | ||
bindcmdaddress 127.0.0.1 | ||
bindcmdaddress ::1 | ||
|
||
# Serve time even if not synchronized to any NTP server. | ||
#local stratum 10 | ||
|
||
keyfile {{ chrony_keys }} | ||
|
||
# Disable logging of client accesses. | ||
noclientlog | ||
|
||
# Send a message to syslog if a clock adjustment is larger than 0.5 seconds. | ||
logchange 0.5 | ||
|
||
logdir {{ chrony_log_dir }} | ||
#log measurements statistics tracking |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# {{ ansible_managed }} | ||
[Time] | ||
NTP={{ timesync_ntp_hosts | default("") | join(" ") }} | ||
FallbackNTP={{ timesync_fallback_ntp_hosts | join(" ") }} |
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