Blame SOURCES/scap-security-guide-0.1.50-add_rhel7_cis_kickstart_PR_5545.patch

dac76a
From 89f8c585e3eb05dddd95f601df13664335bc4b14 Mon Sep 17 00:00:00 2001
dac76a
From: Vojtech Polasek <vpolasek@redhat.com>
dac76a
Date: Mon, 30 Mar 2020 11:34:38 +0200
dac76a
Subject: [PATCH] add kickstarts for cis into rhel7 and rhel8
dac76a
dac76a
---
dac76a
 rhel7/kickstart/ssg-rhel7-cis-ks.cfg | 147 +++++++++++++++++++++++++++
dac76a
 2 files changed, 293 insertions(+)
dac76a
 create mode 100644 rhel7/kickstart/ssg-rhel7-cis-ks.cfg
dac76a
dac76a
diff --git a/rhel7/kickstart/ssg-rhel7-cis-ks.cfg b/rhel7/kickstart/ssg-rhel7-cis-ks.cfg
dac76a
new file mode 100644
dac76a
index 0000000000..85c592de8a
dac76a
--- /dev/null
dac76a
+++ b/rhel7/kickstart/ssg-rhel7-cis-ks.cfg
dac76a
@@ -0,0 +1,147 @@
dac76a
+# SCAP Security Guide CIS profile kickstart for Red Hat Enterprise Linux 7 Server
dac76a
+# Version: 0.0.1
dac76a
+# Date: 2020-03-30
dac76a
+#
dac76a
+# Based on:
dac76a
+# http://fedoraproject.org/wiki/Anaconda/Kickstart
dac76a
+# https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/sect-kickstart-syntax.html
dac76a
+
dac76a
+# Install a fresh new system (optional)
dac76a
+install
dac76a
+
dac76a
+# Specify installation method to use for installation
dac76a
+# To use a different one comment out the 'url' one below, update
dac76a
+# the selected choice with proper options & un-comment it
dac76a
+#
dac76a
+# Install from an installation tree on a remote server via FTP or HTTP:
dac76a
+# --url		the URL to install from
dac76a
+#
dac76a
+# Example:
dac76a
+#
dac76a
+# url --url=http://192.168.122.1/image
dac76a
+#
dac76a
+# Modify concrete URL in the above example appropriately to reflect the actual
dac76a
+# environment machine is to be installed in
dac76a
+#
dac76a
+# Other possible / supported installation methods:
dac76a
+# * install from the first CD-ROM/DVD drive on the system:
dac76a
+#
dac76a
+# cdrom
dac76a
+#
dac76a
+# * install from a directory of ISO images on a local drive:
dac76a
+#
dac76a
+# harddrive --partition=hdb2 --dir=/tmp/install-tree
dac76a
+#
dac76a
+# * install from provided NFS server:
dac76a
+#
dac76a
+# nfs --server=<hostname> --dir=<directory> [--opts=<nfs options>]
dac76a
+#
dac76a
+
dac76a
+# Set language to use during installation and the default language to use on the installed system (required)
dac76a
+lang en_US.UTF-8
dac76a
+
dac76a
+# Set system keyboard type / layout (required)
dac76a
+keyboard us
dac76a
+
dac76a
+# Configure network information for target system and activate network devices in the installer environment (optional)
dac76a
+# --onboot	enable device at a boot time
dac76a
+# --device	device to be activated and / or configured with the network command
dac76a
+# --bootproto	method to obtain networking configuration for device (default dhcp)
dac76a
+# --noipv6	disable IPv6 on this device
dac76a
+#
dac76a
+# NOTE: Usage of DHCP will fail CCE-27021-5 (DISA FSO RHEL-06-000292). To use static IP configuration,
dac76a
+#       "--bootproto=static" must be used. For example:
dac76a
+# network --bootproto=static --ip=10.0.2.15 --netmask=255.255.255.0 --gateway=10.0.2.254 --nameserver 192.168.2.1,192.168.3.1
dac76a
+#
dac76a
+network --onboot yes --device eth0 --bootproto dhcp --noipv6
dac76a
+
dac76a
+# Set the system's root password (required)
dac76a
+# Plaintext password is: server
dac76a
+# Refer to e.g. http://fedoraproject.org/wiki/Anaconda/Kickstart#rootpw to see how to create
dac76a
+# encrypted password form for different plaintext password
dac76a
+rootpw --iscrypted $6$rhel6usgcb$aS6oPGXcPKp3OtFArSrhRwu6sN8q2.yEGY7AIwDOQd23YCtiz9c5mXbid1BzX9bmXTEZi.hCzTEXFosVBI5ng0
dac76a
+
dac76a
+# The selected profile will restrict root login
dac76a
+# Add a user that can login and escalate privileges
dac76a
+# Plaintext password is: admin123
dac76a
+user --name=admin --groups=wheel --password=$6$Ga6ZnIlytrWpuCzO$q0LqT1USHpahzUafQM9jyHCY9BiE5/ahXLNWUMiVQnFGblu0WWGZ1e6icTaCGO4GNgZNtspp1Let/qpM7FMVB0 --iscrypted
dac76a
+
dac76a
+# Configure firewall settings for the system (optional)
dac76a
+# --enabled	reject incoming connections that are not in response to outbound requests
dac76a
+# --ssh		allow sshd service through the firewall
dac76a
+firewall --enabled --ssh
dac76a
+
dac76a
+# Set up the authentication options for the system (required)
dac76a
+# --enableshadow	enable shadowed passwords by default
dac76a
+# --passalgo		hash / crypt algorithm for new passwords
dac76a
+# See the manual page for authconfig for a complete list of possible options.
dac76a
+authconfig --enableshadow --passalgo=sha512
dac76a
+
dac76a
+# State of SELinux on the installed system (optional)
dac76a
+# Defaults to enforcing
dac76a
+selinux --enforcing
dac76a
+
dac76a
+# Set the system time zone (required)
dac76a
+timezone --utc America/New_York
dac76a
+
dac76a
+# Specify how the bootloader should be installed (required)
dac76a
+# Plaintext password is: password
dac76a
+# Refer to e.g. http://fedoraproject.org/wiki/Anaconda/Kickstart#rootpw to see how to create
dac76a
+# encrypted password form for different plaintext password
dac76a
+bootloader --location=mbr --append="crashkernel=auto rhgb quiet" --password=$6$rhel6usgcb$kOzIfC4zLbuo3ECp1er99NRYikN419wxYMmons8Vm/37Qtg0T8aB9dKxHwqapz8wWAFuVkuI/UJqQBU92bA5C0
dac76a
+
dac76a
+# Initialize (format) all disks (optional)
dac76a
+zerombr
dac76a
+
dac76a
+# The following partition layout scheme assumes disk of size 20GB or larger
dac76a
+# Modify size of partitions appropriately to reflect actual machine's hardware
dac76a
+#
dac76a
+# Remove Linux partitions from the system prior to creating new ones (optional)
dac76a
+# --linux	erase all Linux partitions
dac76a
+# --initlabel	initialize the disk label to the default based on the underlying architecture
dac76a
+clearpart --linux --initlabel
dac76a
+
dac76a
+# Create primary system partitions (required for installs)
dac76a
+part /boot --fstype=xfs --size=512
dac76a
+part pv.01 --grow --size=1
dac76a
+
dac76a
+# Create a Logical Volume Management (LVM) group (optional)
dac76a
+volgroup VolGroup --pesize=4096 pv.01
dac76a
+
dac76a
+# Create particular logical volumes (optional)
dac76a
+logvol / --fstype=xfs --name=LogVol06 --vgname=VolGroup --size=11264 --grow
dac76a
+# Ensure /home Located On Separate Partition
dac76a
+logvol /home --fstype=xfs --name=LogVol02 --vgname=VolGroup --size=1024 --fsoptions="nodev"
dac76a
+# Ensure /tmp Located On Separate Partition
dac76a
+logvol /tmp --fstype=xfs --name=LogVol01 --vgname=VolGroup --size=1024 --fsoptions="nodev,noexec,nosuid"
dac76a
+# Ensure /var/tmp Located On Separate Partition
dac76a
+logvol /var/tmp --fstype=xfs --name=LogVol7 --vgname=VolGroup --size=1024 --fsoptions="nodev,nosuid,noexec"
dac76a
+# Ensure /var Located On Separate Partition
dac76a
+logvol /var --fstype=xfs --name=LogVol03 --vgname=VolGroup --size=2048
dac76a
+# Ensure /var/log Located On Separate Partition
dac76a
+logvol /var/log --fstype=xfs --name=LogVol04 --vgname=VolGroup --size=1024
dac76a
+# Ensure /var/log/audit Located On Separate Partition
dac76a
+logvol /var/log/audit --fstype=xfs --name=LogVol05 --vgname=VolGroup --size=512
dac76a
+logvol swap --name=lv_swap --vgname=VolGroup --size=2016
dac76a
+
dac76a
+
dac76a
+
dac76a
+# Harden installation with CIS profile
dac76a
+# For more details and configuration options see command %addon org_fedora_oscap in
dac76a
+# https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/installation_guide/sect-kickstart-syntax#sect-kickstart-commands
dac76a
+%addon org_fedora_oscap
dac76a
+        content-type = scap-security-guide
dac76a
+        profile = xccdf_org.ssgproject.content_profile_cis
dac76a
+%end
dac76a
+
dac76a
+# Packages selection (%packages section is required)
dac76a
+%packages
dac76a
+
dac76a
+# Require @Base
dac76a
+@Base
dac76a
+
dac76a
+%end # End of %packages section
dac76a
+
dac76a
+# Reboot after the installation is complete (optional)
dac76a
+# --eject	attempt to eject CD or DVD media before rebooting
dac76a
+reboot --eject