Seminar/Linux/SELinux: Unterschied zwischen den Versionen
Erscheinungsbild
| Zeile 49: | Zeile 49: | ||
= TMP = | = TMP = | ||
== Tag 1: Grundlagen == | |||
== Grundlagen & Security Context | Grundlagen & Security Context | ||
=== Ziel === | === Ziel === | ||
| Zeile 59: | Zeile 59: | ||
=== Inhalte === | === Inhalte === | ||
* Einführung in SELinux – Nutzen und typische Einsatzszenarien | |||
* Einführung in SELinux – Nutzen und typische Einsatzszenarien | * Security Context auf Dateien und Verzeichnissen | ||
* Security Context auf Dateien und Verzeichnissen | * Interpretation des SELinux Context Types | ||
* Interpretation des SELinux Context Types | * Extended (File) Attributes (xattr) – Namespaces, Verwaltung mit getfattr/setfattr | ||
* Extended (File) Attributes (xattr) – Namespaces, Verwaltung mit getfattr/setfattr | * Syscall-Analyse mit strace (stat, fstat, getxattr, …) | ||
* Syscall-Analyse mit strace (stat, fstat, getxattr, …) | |||
* Standardverhalten bei mv und cp | * Standardverhalten bei mv und cp | ||
* Einfluss von restorecond auf Labels | * Einfluss von restorecond auf Labels | ||
* SELinux Optionen bei mv, cp, mkdir, tar, rsync | * SELinux Optionen bei mv, cp, mkdir, tar, rsync | ||
== File Context Verwaltung & Security Context Policies | == Tag 2: Context und Policies == | ||
File Context Verwaltung & Security Context Policies | |||
=== Ziel === | === Ziel === | ||
| Zeile 77: | Zeile 77: | ||
File Contexts korrekt setzen, Policies anpassen und fehlerhafte Labels systematisch reparieren. | File Contexts korrekt setzen, Policies anpassen und fehlerhafte Labels systematisch reparieren. | ||
* Context setzen mit chcon, semanage, setfiles, fixfiles | === Inhalte == | ||
* File Context Regeln – Aufbau, Regex, Prioritätsregeln | * Context setzen mit chcon, semanage, setfiles, fixfiles | ||
* Context Expressions und matchpathcon | * File Context Regeln – Aufbau, Regex, Prioritätsregeln | ||
* Reparieren von falsch gesetzten Labels mit restorecon (inkl. SHA256 digests) | * Context Expressions und matchpathcon | ||
* Reparieren von falsch gesetzten Labels mit restorecon (inkl. SHA256 digests) | |||
* Äquivalenzregeln definieren | * Äquivalenzregeln definieren | ||
* Named File Transition Rules | * Named File Transition Rules | ||
* Mount-Optionen für SELinux (context=, defcontext=, fscontext=, rootcontext=) | * Mount-Optionen für SELinux (context=, defcontext=, fscontext=, rootcontext=) | ||
* Systemd und temporäre Verzeichnisse – Context via systemd-tmpfiles | * Systemd und temporäre Verzeichnisse – Context via systemd-tmpfiles | ||
* Lokale Änderungen exportieren/importieren mit semanage | * Lokale Änderungen exportieren/importieren mit semanage | ||
== Benutzer, Rollen, Container | == Tag 3: Benutzer, Rollen, Container und Automatisierung == | ||
=== Ziel === | === Ziel === | ||
| Zeile 95: | Zeile 96: | ||
=== Inhalte === | === Inhalte === | ||
* SELinux User & Role Mapping im Detail | |||
* SELinux User & Role Mapping im Detail | * Linux User - SELinux User Zuordnung | ||
* Linux User | |||
* Erstellen eigener SELinux User | * Erstellen eigener SELinux User | ||
* Arbeiten mit SELinux Roles (newrole, sudo, runcon) | * Arbeiten mit SELinux Roles (newrole, sudo, runcon) | ||
* Verwalten von MCS Categories (chcat, setrans, mcstransd) | * Verwalten von MCS Categories (chcat, setrans, mcstransd) | ||
* Pluggable Authentication Modules (PAM): pam_selinux, pam_sepermit, pam_namespace | * Pluggable Authentication Modules (PAM): pam_selinux, pam_sepermit, pam_namespace | ||
* Prozess Context, Domain Transitions, Memory Protection, NNP | * Prozess Context, Domain Transitions, Memory Protection, NNP | ||
* SELinux & Ansible – native Module, Custom Policy verteilen | * SELinux & Ansible – native Module, Custom Policy verteilen | ||
* SELinux & Salt – native Module, Custom Policy verteilen | * SELinux & Salt – native Module, Custom Policy verteilen | ||
* SELinux & Container – Podman, MCS, Volumes, udica | * SELinux & Container – Podman, MCS, Volumes, udica | ||
* Eigene Container Policy mit udica erstellen | * Eigene Container Policy mit udica erstellen | ||
Version vom 20. März 2026, 11:54 Uhr
Übersicht
| Kapitel | Thema | Gewichtung |
|---|---|---|
| 01 | Einführung | 1 |
| 02 | Security Context auf Dateien und Verzeichnissen | 1 |
| 03 | Extended File Attributes | 1 |
| 04 | Security Context | 1 |
| 05 | File Context | 1 |
| 06 | Context Expressions | 1 |
| 07 | Security Context von Datei | 1 |
| 08 | Named File Transitions Rules | 1 |
| 09 | Systemd und Temporäre Verzeichnisse | 1 |
| 10 | strace context printing | 1 |
| 11 | Benutzer Login | 1 |
| 12 | Kategorien | 1 |
| 13 | Rollen | 1 |
| 14 | PAM | 1 |
| 15 | Prozess Context | 1 |
| 16 | SELinux und Ansible | 1 |
| 17 | SELinux und Salt | 1 |
| 18 | SELinux und Container | 1 |
TMP
Tag 1: Grundlagen
Grundlagen & Security Context
Ziel
Verstehen, wie SELinux funktioniert und wie Kontexte aufgebaut sind
Ergebnis
Aufbau von SELinux-Kontexten verstehen , lesen und interpretieren
Inhalte
- Einführung in SELinux – Nutzen und typische Einsatzszenarien
- Security Context auf Dateien und Verzeichnissen
- Interpretation des SELinux Context Types
- Extended (File) Attributes (xattr) – Namespaces, Verwaltung mit getfattr/setfattr
- Syscall-Analyse mit strace (stat, fstat, getxattr, …)
- Standardverhalten bei mv und cp
- Einfluss von restorecond auf Labels
- SELinux Optionen bei mv, cp, mkdir, tar, rsync
Tag 2: Context und Policies
File Context Verwaltung & Security Context Policies
Ziel
Kontexte gezielt setzen, verwalten und reparieren
Ergebnis
File Contexts korrekt setzen, Policies anpassen und fehlerhafte Labels systematisch reparieren.
= Inhalte
- Context setzen mit chcon, semanage, setfiles, fixfiles
- File Context Regeln – Aufbau, Regex, Prioritätsregeln
- Context Expressions und matchpathcon
- Reparieren von falsch gesetzten Labels mit restorecon (inkl. SHA256 digests)
- Äquivalenzregeln definieren
- Named File Transition Rules
- Mount-Optionen für SELinux (context=, defcontext=, fscontext=, rootcontext=)
- Systemd und temporäre Verzeichnisse – Context via systemd-tmpfiles
- Lokale Änderungen exportieren/importieren mit semanage
Tag 3: Benutzer, Rollen, Container und Automatisierung
Ziel
SELinux in realen Betriebsumgebungen professionell einsetzen
Ergebnis
Inhalte
- SELinux User & Role Mapping im Detail
- Linux User - SELinux User Zuordnung
- Erstellen eigener SELinux User
- Arbeiten mit SELinux Roles (newrole, sudo, runcon)
- Verwalten von MCS Categories (chcat, setrans, mcstransd)
- Pluggable Authentication Modules (PAM): pam_selinux, pam_sepermit, pam_namespace
- Prozess Context, Domain Transitions, Memory Protection, NNP
- SELinux & Ansible – native Module, Custom Policy verteilen
- SELinux & Salt – native Module, Custom Policy verteilen
- SELinux & Container – Podman, MCS, Volumes, udica
- Eigene Container Policy mit udica erstellen