|
@@ -1,12 +1,17 @@
|
|
|
#cloud-config
|
|
|
preserve_hostname: false
|
|
|
+prefer_fqdn_over_hostname: true
|
|
|
+manage_etc_hosts: true
|
|
|
hostname: ${hostname}
|
|
|
salt-master: ${salt_master}
|
|
|
fqdn: ${fqdn}
|
|
|
|
|
|
+apt:
|
|
|
+ http_proxy: "http://${proxy}:80/"
|
|
|
+ https_proxy: "http://${proxy}:80/"
|
|
|
+
|
|
|
# Ubuntu Advantage - broken? Using cmd.run
|
|
|
#ubuntu_advantage:
|
|
|
-# token: ${ua_key}
|
|
|
# enable:
|
|
|
# - fips
|
|
|
# - cis
|
|
@@ -16,6 +21,12 @@ fqdn: ${fqdn}
|
|
|
|
|
|
# Write files happens early
|
|
|
write_files:
|
|
|
+- content: |
|
|
|
+ http_proxy="http://${proxy}:80/"
|
|
|
+ https_proxy="http://${proxy}:80/"
|
|
|
+ no_proxy=localhost,127.0.0.1,169.254.169.254
|
|
|
+ path: /etc/environment
|
|
|
+ append: true
|
|
|
- content: |
|
|
|
Acquire::http::Proxy "http://${proxy}:80/";
|
|
|
Acquire::https::Proxy "http://${proxy}:80/";
|
|
@@ -34,6 +45,11 @@ write_files:
|
|
|
export http_proxy=$HTTP_PROXY
|
|
|
export no_proxy=$NO_PROXY
|
|
|
path: /etc/profile.d/proxy.sh
|
|
|
+- content: |
|
|
|
+ net.ipv6.conf.eth0.disable_ipv6 = 1
|
|
|
+ permissions: 0644
|
|
|
+ owner: root
|
|
|
+ path: /etc/sysctl.d/10-disable-ipv6.conf
|
|
|
- content: |
|
|
|
${fqdn}
|
|
|
path: /etc/salt/minion_id
|
|
@@ -69,17 +85,20 @@ growpart:
|
|
|
|
|
|
runcmd:
|
|
|
- find /usr/local/lib -type f -exec chmod o+r {} \;
|
|
|
- - ua attach ${ua_key}
|
|
|
+ - export http_proxy=http://${proxy}:80
|
|
|
+ - export https_proxy=http://${proxy}:80
|
|
|
+ - export no_proxy=localhost,127.0.0.1,169.254.169.254
|
|
|
+ - ua auto-attach
|
|
|
- ua enable --assume-yes cis fips fips-updates
|
|
|
- /usr/share/ubuntu-scap-security-guides/cis-hardening/Canonical_Ubuntu_20.04_CIS-harden.sh lvl2_server
|
|
|
- apt update
|
|
|
- apt upgrade -y
|
|
|
- /bin/systemctl restart salt-minion
|
|
|
- /bin/systemctl enable salt-minion
|
|
|
- - /bin/systemctl start amazon-ssm-agent
|
|
|
- - /bin/systemctl enable amazon-ssm-agent
|
|
|
+ - /bin/systemctl start snap.amazon-ssm-agent.amazon-ssm-agent.service
|
|
|
+ - /bin/systemctl enable snap.amazon-ssm-agent.amazon-ssm-agent.service
|
|
|
- /usr/sbin/aide --update --verbose=0
|
|
|
- - /bin/cp /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz
|
|
|
+ - /bin/cp /var/lib/aide/aide.db.new /var/lib/aide/aide.db
|
|
|
|
|
|
# Either final message or power state, but probably not both
|
|
|
#final_message: "The system is up after $UPTIME seconds"
|