Unit 3 Lab - User Access and System Integration
Info
If you are unable to finish the lab in the ProLUG lab environment we ask you reboot the machine from the command line so that other students will have the intended environment.
Required Materials
- Putty or other connection tool Lab Server
- Root or sudo command access
- STIG Viewer 2.18 (download from https://public.cyber.mil/stigs/downloads/ )
Downloads
The lab has been provided below. The document(s) can be transposed to
the desired format so long as the content is preserved. For example, the .docx
could be transposed to a .md file.
EXERCISES (Warmup to quickly run through your system and familiarize yourself)
Pre-Lab Warm-Up
Download the STIG Viewer 2.18 from - https://public.cyber.mil/stigs/downloads/
Download the STIG for RHEL 9 and the import it into your STIG viewer
Create a checklist from the opened STIG for RHEL 9
Lab 🧪
This lab is designed to have the engineer practice securing a Linux server or service against a set of configuration standards. These standards are sometimes called benchmarks, checklists, or guidelines. The engineer will be using STIG Viewer 2.18 to complete this lab.
PAM configuration
Connect to a hammer server
Filter by pam and see how many STIGS you have. (Why is it really only 16?)
Examine STIG V-257986
What is the problem?
What is the fix?
What type of control is being implemented?
Is it set properly on your system?
Can you remediate this finding?
Check and remediate STIG V-258055
What is the problem?
What is the fix?
What type of control is being implemented?
Are there any major implications to think about with this change on your system? Why or why not?
Is it set properly on your system?
How would you go about remediating this on your system?
Check and remediate STIG V-258098
What is the problem?
What is the fix?
What type of control is being implemented?
Is it set properly on your system?
Filter by "password complexity"
How many are there?
What are the password complexity rules?
Are there any you haven't seen before?
Filter by sssd
How many STIGS do you see?
What do these STIGS appear to be trying to do? What types of controls are they?
OpenLDAP Setup
You will likely not build an LDAP server in a real world environment. We are doing it for understanding and ability to complete the lab. In a normal corporate environment this is likely Active Directory.
To simplify some of the typing in this lab, there is a file located at
/lab_work/identity_and_access_management.tar.gz that you can pull down to your system with the correct .ldif files.
Install and configure OpenLDAP
1. Stop the warewulf client
2. Edit your /etc/hosts file
Look for and edit the line that has your current server
Entry for hammer1 for example:
192.168.200.151 hammer1 hammer1-default ldap.prolug.lan ldap
3. Setup dnf repo
4. Start slapd systemctl
5. Allow ldap through the firewall
6. Generate a password
(Our example uses testpassword) This will return a salted SSHA password. Save this password and salted hash for later input
Output:
New password: Re-enter new password: {SSHA}wpRvODvIC/EPYf2GqHUlQMDdsFIW5yig
7. Change the password
dn: olcDatabase={0}config,cn=config
changetype: modify
replace: olcRootPW
olcRootPW: {SSHA}vKobSZO1HDGxp2OElzli/xfAzY4jSDMZ
Output:
SASL/EXTERNAL authentication started SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth SASL SSF: 0 modifying entry "olcDatabase={0}config,cn=config"
8. Generate basic schemas
9. Set up the domain
(USE THE PASSWORD YOU GENERATED EARLIER)
dn: olcDatabase={1}monitor,cn=config
changetype: modify
replace: olcAccess
olcAccess: {0}to * by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth"
read by dn.base="cn=Manager,dc=prolug,dc=lan" read by * none
dn: olcDatabase={2}mdb,cn=config
changetype: modify
replace: olcSuffix
olcSuffix: dc=prolug,dc=lan
dn: olcDatabase={2}mdb,cn=config
changetype: modify
replace: olcRootDN
olcRootDN: cn=Manager,dc=prolug,dc=lan
dn: olcDatabase={2}mdb,cn=config
changetype: modify
add: olcRootPW
olcRootPW: {SSHA}s4x6uAxcAPZN/4e3pGnU7UEIiADY0/Ob
dn: olcDatabase={2}mdb,cn=config
changetype: modify
add: olcAccess
olcAccess: {0}to attrs=userPassword,shadowLastChange by
dn="cn=Manager,dc=prolug,dc=lan" write by anonymous auth by self write by * none
olcAccess: {1}to dn.base="" by * read
olcAccess: {2}to * by dn="cn=Manager,dc=prolug,dc=lan" write by * read
10. Run it
Output:
SASL/EXTERNAL authentication started SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth SASL SSF: 0 modifying entry "olcDatabase={1}monitor,cn=config" modifying entry "olcDatabase={2}mdb,cn=config" modifying entry "olcDatabase={2}mdb,cn=config" modifying entry "olcDatabase={2}mdb,cn=config" modifying entry "olcDatabase={2}mdb,cn=config"
11. Search and verify the domain is working.
Output:
dn: namingContexts: dc=prolug,dc=lan
12. Add the base group and organization.
dn: dc=prolug,dc=lan
objectClass: top
objectClass: dcObject
objectclass: organization
o: My prolug Organisation
dc: prolug
dn: cn=Manager,dc=prolug,dc=lan
objectClass: organizationalRole
cn: Manager
description: OpenLDAP Manager
dn: ou=People,dc=prolug,dc=lan
objectClass: organizationalUnit
ou: People
dn: ou=Group,dc=prolug,dc=lan
objectClass: organizationalUnit
ou: Group
13. Verifying
14. Add a user
Generate a password (use testuser1234)
dn: uid=testuser,ou=People,dc=prolug,dc=lan
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: shadowAccount
cn: testuser
sn: temp
userPassword: {SSHA}yb6e0ICSdlZaMef3zizvysEzXRGozQOK
loginShell: /bin/bash
uidNumber: 15000
gidNumber: 15000
homeDirectory: /home/testuser
shadowLastChange: 0
shadowMax: 0
shadowWarning: 0
dn: cn=testuser,ou=Group,dc=prolug,dc=lan
objectClass: posixGroup
cn: testuser
gidNumber: 15000
memberUid: testuser
16. Verify that your user is in the system.
17. Secure the system with TLS (accept all defaults)
Output:
-rw-r--r--. 1 ldap ldap 1224 Apr 12 18:23 /etc/pki/tls/ldapserver.crt -rw-------. 1 ldap ldap 1704 Apr 12 18:22 /etc/pki/tls/ldapserver.key
dn: cn=config
changetype: modify
add: olcTLSCACertificateFile
olcTLSCACertificateFile: /etc/pki/tls/ldapserver.crt
add: olcTLSCertificateKeyFile
olcTLSCertificateKeyFile: /etc/pki/tls/ldapserver.key
add: olcTLSCertificateFile
olcTLSCertificateFile: /etc/pki/tls/ldapserver.crt
18. Fix the /etc/openldap/ldap.conf to allow for certs
SSSD Configuration and Realmd join to LDAP
SSSD can connect a server to a trusted LDAP system and authenticate users for access to local resources. You will likely do this during your career and it is a valuable skill to work with.
1. Install sssd, configure, and validate that the user is seen by the system
2. Uncomment and fix the lines in /etc/openldap/ldap.conf
Output:
BASE dc=prolug,dc=lan URI ldap://ldap.ldap.lan/
3. Edit the sssd.conf file
[domain/default]
id_provider = ldap
autofs_provider = ldap
auth_provider = ldap
chpass_provider = ldap
ldap_uri = ldap://ldap.prolug.lan/
ldap_search_base = dc=prolug,dc=lan
#ldap_id_use_start_tls = True
#ldap_tls_cacertdir = /etc/openldap/certs
cache_credentials = True
#ldap_tls_reqcert = allow
[sssd]
services = nss, pam, autofs
domains = default
[nss]
homedir_substring = /home
4. Validate that the user can be seen
Output:
uid=15000(testuser) gid=15000 groups=15000
Congratulations! Look at you, doing all the Linux.
Info
Be sure to reboot the lab machine from the command line when you are done.





