You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The group synchronization feature (#38) allows LemonLDAP::NG to manage Unix supplementary groups on target servers. When a user connects via SSH, their Unix groups are synchronized with the groups defined in LLNG.
186
+
187
+
### Configuration
188
+
189
+
In `lemonldap-ng.ini`, configure which groups LLNG should manage for each server group:
190
+
191
+
```perl
192
+
pamAccessManagedGroups = {
193
+
production=>'docker,developers,readonly',
194
+
staging=>'developers,testers',
195
+
bastion=>'operators,auditors',
196
+
default=>''
197
+
}
198
+
```
199
+
200
+
- Groups listed in `pamAccessManagedGroups` will be created automatically on the server if they don't exist
201
+
- Users are added to groups they're assigned to in LLNG
202
+
- Users are removed from managed groups they're no longer assigned to in LLNG
203
+
- Groups NOT in `pamAccessManagedGroups` are never modified (local groups are preserved)
Note over Server: Filter by local whitelist<br/>(if configured)
217
+
Note over Server: Sync groups:<br/>• Add user to "dev", "docker"<br/>• Remove from "qa" (managed but not assigned)
218
+
Server-->>Client: Session established
219
+
```
220
+
221
+
### Security Considerations
222
+
223
+
-**Principle of least privilege**: Don't include privileged groups (sudo, wheel, admin) in `managed_groups`
224
+
-**Audit trail**: All group modifications are logged with event type `GROUP_SYNC`
225
+
-**Offline behavior**: Group sync uses cached group information when LLNG is unreachable
226
+
-**File protection**: Group modifications use system tools (`groupadd`, `gpasswd`) which handle `/etc/group` and `/etc/gshadow` atomically
227
+
228
+
### Local Whitelist (Defense-in-Depth)
229
+
230
+
Administrators can optionally configure a local whitelist of groups allowed to be managed on each server. This provides defense-in-depth by restricting which groups LLNG can actually modify, regardless of what `managed_groups` it sends.
231
+
232
+
In `/etc/open-bastion/openbastion.conf`:
233
+
234
+
```ini
235
+
# Only allow these groups to be managed by LLNG on this server
### R-S13 - Manipulation des groupes Unix via synchronisation LLNG
1247
+
1248
+
| | Score |
1249
+
| --------------- | :---: |
1250
+
| **Probabilité** | 2 |
1251
+
| **Impact** | 3 |
1252
+
1253
+
**Architectures concernées :** A, B, C, D (avec synchronisation de groupes activée)
1254
+
1255
+
**Description :** La fonctionnalité de synchronisation des groupes Unix (#38) permet à LLNG de gérer les groupes supplémentaires des utilisateurs sur les serveurs. Un attaquant pourrait exploiter cette fonctionnalité pour obtenir des privilèges supplémentaires.
1256
+
1257
+
**Vecteurs d'attaque :**
1258
+
1259
+
- Modification des groupes côté LLNG pour obtenir des accès (ex: groupe docker, wheel, admin)
1260
+
- Attaque MITM sur la communication PAM-LLNG pour injecter des groupes
1261
+
- Modification du cache offline pour ajouter des groupes non autorisés
1262
+
- Symlink attack sur /etc/group pendant la modification
1263
+
1264
+
**Conséquence :** Un attaquant pourrait obtenir des privilèges supplémentaires sur le serveur (sudo, docker, accès à des ressources sensibles).
1265
+
1266
+
**Remédiation embarquée (IMPLÉMENTÉE) :**
1267
+
1268
+
Le module PAM implémente plusieurs contrôles de sécurité :
0 commit comments