/
Authentication.rst
227 lines (168 loc) · 20.7 KB
/
Authentication.rst
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
Centralized authentication on the cluster
==========================================
The security feature allows users to set up FreeIPA and LDAP to help authenticate into HPC clusters.
Configuring FreeIPA/LDAP security
________________________________
**Pre requisites**
* Run ``local_repo.yml`` to create offline repositories of FreeIPA or OpenLDAP. If both were downloaded, ensure that the non-required system is removed from ``input/software_config.json`` before running ``security.yml``. For more information, `click here <../../InstallationGuides/LocalRepo/index.html>`_.
* Enter the following parameters in ``input/security_config.yml``.
.. csv-table:: Parameters for Authentication
:file: ../../Tables/security_config.csv
:header-rows: 1
:keepspace:
.. csv-table:: Parameters for OpenLDAP configuration
:file: ../../Tables/security_config_ldap.csv
:header-rows: 1
:keepspace:
.. csv-table:: Parameters for FreeIPA configuration
:file: ../../Tables/security_config_freeipa.csv
:header-rows: 1
:keepspace:
.. [1] Boolean parameters do not need to be passed with double or single quotes.
Create a new user on OpenLDAP
-----------------------------
1. Create an LDIF file (eg: ``create_user.ldif``) on the auth server containing the following information:
* DN: The distinguished name that indicates where the user will be created.
* objectClass: The object class specifies the mandatory and optional attributes that can be associated with an entry of that class. Here, the values are ``inetOrgPerson``, ``posixAccount``, and ``shadowAccount``.
* UID: The username of the replication user.
* sn: The surname of the intended user.
* cn: The given name of the intended user.
Below is a sample file: ::
# User Creation
dn: uid=ldapuser,ou=People,dc=omnia,dc=test
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: shadowAccount
cn: ldapuser
sn: ldapuser
loginShell:/bin/bash
uidNumber: 2000
gidNumber: 2000
homeDirectory: /home/ldapuser
shadowLastChange: 0
shadowMax: 0
shadowWarning: 0
# Group Creation
dn: cn=ldapuser,ou=Group,dc=omnia,dc=test
objectClass: posixGroup
cn: ldapuser
gidNumber: 2000
memberUid: ldapuser
.. note:: Avoid whitespaces when using an LDIF file for user creation. Extra spaces in the input data may be encrypted by OpenLDAP and cause access failures.
2. Run the command ``ldapadd -D <enter admin binddn > -w < bind_password > -f create_user.ldif`` to execute the LDIF file and create the account.
3. To set up a password for this account, use the command ``ldappasswd -D <enter admin binddn > -w < bind_password > -S <user_dn>``. The value of ``user_dn`` is the distinguished name that indicates where the user was created. (In this example, ``ldapuser,ou=People,dc=omnia,dc=test``)
Configuring login node security
________________________________
**Prerequisites**
* Run ``local_repo.yml`` to create an offline repository of all utilities used to secure the login node. For more information, `click here. <../../InstallationGuides/LocalRepo/SecureLoginNode.html>`_
Enter the following parameters in ``input/login_node_security_config.yml``.
+--------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Variable | Details |
+==========================+================================================================================================================================================================================+
| **max_failures** | The number of login failures that can take place before the account is locked out. |
| ``integer`` | |
| Optional | **Default values**: ``3`` |
+--------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|**failure_reset_interval**| Period (in seconds) after which the number of failed login attempts is reset. Min value: 30; Max value: 60. |
| ``integer`` | |
| Optional | **Default values**: ``60`` |
+--------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| **lockout_duration** | Period (in seconds) for which users are locked out. Min value: 5; Max value: 10. |
| ``integer`` | |
| Optional | **Default values**: ``10`` |
+--------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|**session_timeout** | User sessions that have been idle for a specific period can be ended automatically. Min value: 90; Max value: 180. |
| ``integer`` | |
| Optional | **Default values**: ``180`` |
+--------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|**alert_email_address** | Email address used for sending alerts in case of authentication failure. When blank, authentication failure alerts are disabled. Currently, only one email ID is accepted. |
| ``string`` | |
| Optional | |
+--------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|**user** | Access control list of users. Accepted formats are username@ip (root@1.2.3.4) or username (root). Multiple users can be separated using whitespaces. |
| ``string`` | |
| Optional | |
+--------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|**allow_deny** | This variable decides whether users are to be allowed or denied access. Ensure that AllowUsers or DenyUsers entries on sshd configuration file are not commented. |
| ``string`` | |
| Optional | Choices: |
| | |
| | * ``allow`` <- Default |
| | * ``deny`` |
+--------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| restrict_program_support | This variable is used to disable services. Root access is mandatory. |
| ``boolean`` | |
| Optional | Choices: |
| | |
| | * ``false`` <- Default |
| | * ``true`` |
+--------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|**restrict_softwares** | List of services to be disabled (Comma-separated). Example: 'telnet,lpd,bluetooth' |
| ``string`` | |
| Optional | Choices: |
| | |
| | * ``telnet`` |
| | * ``lpd`` |
| | * ``bluetooth`` |
| | * ``rlogin`` |
| | * ``rexec`` |
+--------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Installing LDAP Client
________________________
.. caution:: No users/groups will be created by Omnia.
FreeIPA installation on the NFS node
-------------------------------------
IPA services are used to provide account management and centralized authentication.
To customize your installation of FreeIPA, enter the following parameters in ``input/security_config.yml``.
+-------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
| Input Parameter | Definition | Variable value |
+=========================+=================================================================+=======================================================================================================================================================+
| kerberos_admin_password | "admin" user password for the IPA server on Rocky OS and RedHat.| The password can be found in the file ``input/security_config.yml`` . |
+-------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
| ipa_server_hostname | The hostname of the IPA server | The hostname can be found on the control plane. |
+-------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
| domain_name | Domain name | The domain name can be found in the file ``input/security_config.yml``. |
+-------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
| ipa_server_ipadress | The IP address of the IPA server | The IP address can be found on the IPA server on the control plane using ``ip a``. This IP address should be accessible from the NFS node. |
+-------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
To set up IPA services for the NFS node in the target cluster, run the following command from the ``utils/cluster`` folder on the control plane: ::
cd utils/cluster
ansible-playbook install_ipa_client.yml -i inventory -e kerberos_admin_password="" -e ipa_server_hostname="" -e domain_name="" -e ipa_server_ipadress=""
.. include:: ../../Appendices/hostnamereqs.rst
.. note::
* Use the format specified under `NFS inventory in the Sample Files <../../samplefiles.html#nfs-server-inventory-file>`_ for inventory.
* Omnia only supports ``/home`` as the ``homeDirectory``.
Running the security role
--------------------------
Run: ::
cd security
ansible-playbook security.yml -i inventory
The inventory should contain auth_server as per the inventory file in `samplefiles <../../samplefiles.html#inventory-file>`_. The inventory file is case-sensitive. Follow the format provided in the sample file link.
* Do not include the IP of the control plane or local host in the auth_server group in the passed inventory.
* To customize the security features on the login node, fill out the parameters in ``input/login_node_security_config.yml``.
* If a subsequent run of ``security.yml`` fails, the ``security_config.yml`` file will be unencrypted.
.. caution:: No users will be created by Omnia.
Setting up Passwordless SSH
----------------------------
Once user accounts are created, admins can enable passwordless SSH for users to run HPC jobs on the cluster nodes.
.. note:: Once user accounts are created on the auth server, use the accounts to login to the cluster nodes to reset the password and create a corresponding home directory.
To customize your setup of passwordless ssh, input parameters in ``input/passwordless_ssh_config.yml``.
+-----------------------+--------------------------------------------------------------------------------------------------------------------+
| Parameter | Details |
+=======================+====================================================================================================================+
| user_name | The list of users that requires password-less SSH. Separate the list of users using a comma. |
| ``string`` | Eg: ``user1,user2,user3`` |
| Required | |
+-----------------------+--------------------------------------------------------------------------------------------------------------------+
| authentication_type | Indicates whether LDAP or FreeIPA is in use on the cluster. |
| ``string`` | |
| Required | Choices: |
| | |
| | * ``freeipa`` |
| | |
| | * ``ldap`` <- Default |
+-----------------------+--------------------------------------------------------------------------------------------------------------------+
Use the below command to enable passwordless SSH: ::
ansible-playbook user_passwordless_ssh.yml -i inventory
Where inventory follows the format defined under inventory file in the provided `Sample Files. <../../samplefiles.html>`_ The inventory file is case-sensitive. Follow the format provided in the sample file link.
.. caution:: Do not run ssh-keygen commands after passwordless SSH is set up on the nodes.