content:serverbasics:docker-authentik
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
| Beide Seiten, vorherige ÜberarbeitungVorherige ÜberarbeitungNächste Überarbeitung | Vorherige Überarbeitung | ||
| content:serverbasics:docker-authentik [2025/03/29 20:19] – [Sync of FreeIPA/LDAP] obel1x | content:serverbasics:docker-authentik [2025/06/05 23:25] (aktuell) – [Dockerfile] obel1x | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| ====== Docker: Authentik ====== | ====== Docker: Authentik ====== | ||
| - | Authentik is a middleware expanding the basic authentication- features of FreeIPA by many additional, modern ways of authentication which is used by modern Software. It will make SSO possible (Single-Sign-On: | + | Authentik is a middleware expanding the basic authentication- features of FreeIPA by many additional, modern ways of authentication which is used by modern Software. It will make SSO possible (Single-Sign-On: |
| - | + | ||
| - | TODO | + | |
| ===== Dockerfile ===== | ===== Dockerfile ===== | ||
| Zeile 63: | Zeile 61: | ||
| volumes: | volumes: | ||
| - authentik_pgsql_data:/ | - authentik_pgsql_data:/ | ||
| + | - authentik_backup:/ | ||
| #Defined in .env | #Defined in .env | ||
| # environment: | # environment: | ||
| Zeile 147: | Zeile 146: | ||
| volumes: | volumes: | ||
| authentik_pgsql_data: | authentik_pgsql_data: | ||
| + | authentik_backup: | ||
| authentik_media: | authentik_media: | ||
| authentik_custom_templates: | authentik_custom_templates: | ||
| Zeile 155: | Zeile 155: | ||
| | | ||
| | | ||
| + | # Still needs to be defined while without it won't enable ipv6 | ||
| + | default: | ||
| + | driver: bridge | ||
| + | enable_ipv6: | ||
| </ | </ | ||
| Carefully look at each line to fit your needs. | Carefully look at each line to fit your needs. | ||
| + | |||
| ===== Caddy ===== | ===== Caddy ===== | ||
| Zeile 172: | Zeile 177: | ||
| </ | </ | ||
| + | |||
| ===== First start ===== | ===== First start ===== | ||
| Zeile 179: | Zeile 185: | ||
| and set the Password for the admin user '' | and set the Password for the admin user '' | ||
| - | ===== Additional Doings | + | ===== Backup PostgresSQL Database |
| + | |||
| + | This is really VERY Important! The reason is, that every PostgresDB- Version has it own Database- File- Format and if you update Postgres from on Major Version to the next, you WILL NOT BE ABLE to start your DB with the old Volume- Data! | ||
| + | |||
| + | You NEED to have the DB-Backed up and restored to the next Version! | ||
| + | |||
| + | Create a File in your Docker- Dir named e.g. '' | ||
| + | < | ||
| + | |||
| + | # | ||
| + | # Make Postgres-Backup of Authentik | ||
| + | echo " | ||
| + | / | ||
| + | echo "Done Backup of Authentik-DB." | ||
| + | |||
| + | </ | ||
| + | |||
| + | Now add this script to '' | ||
| Don't forget to extend your '' | Don't forget to extend your '' | ||
| + | |||
| + | If you Update the Major- Version, make sure to create a new Volume for your pgsql- data. | ||
| + | |||
| ===== Configuring ===== | ===== Configuring ===== | ||
| Zeile 190: | Zeile 216: | ||
| Don't use Kerberos-Sync, | Don't use Kerberos-Sync, | ||
| - | To Sync FreeIPA with Authentik, follow this Guide: https:// | + | To Sync FreeIPA with Authentik, follow this Guide: |
| + | |||
| + | When the Sync has been configured, all FreeIPA- Users should show up in Authentik. | ||
| + | |||
| + | After SVC- user is created, use the following commands to modify password reset as written in the doc: | ||
| + | < | ||
| + | |||
| + | ldapmodify -x -D " | ||
| + | dn: cn=ipa_pwd_extop, | ||
| + | changetype: modify | ||
| + | add: passSyncManagersDNs | ||
| + | passSyncManagersDNs: | ||
| + | |||
| + | </ | ||
| + | |||
| + | At the next line, hit CTRL+D and the modification should be set, check with: | ||
| + | |||
| + | < | ||
| + | ldapsearch -xv -Z -W -H ldap:// | ||
| + | |||
| + | </ | ||
| + | |||
| + | which should show the entry for '' | ||
| + | === Secure LDAP- Users with TOTP === | ||
| + | |||
| + | Now any User can login with its FreeIPA- Password, also if SPNEGO/ kerberos as beneath is not setup yet. | ||
| + | |||
| + | This is quite insecure, so you shoul add a second factor for that type of Login (for SPNEGO the second factor is your integrated Machine, which has the key stored already). | ||
| + | |||
| + | To do so, in the Autentik Admin- Panel go to Stages and edit the Stage " | ||
| + | Change "Not configured action" | ||
| + | At " | ||
| + | |||
| + | The Next time you are logging in with User and Password in Authentik, it will ask to setup a TOTP- Device. You can for example use [[https:// | ||
| + | |||
| + | Hint: There is also an default Flow for this to import in Authentik here [[https:// | ||
| + | |||
| + | == Current Bug == | ||
| + | |||
| + | At the time of writing this, there was a bug here: https:// | ||
| + | |||
| + | So if you have to enter the OTP twice, than go to Flows, click on '' | ||
| ==== Attaching SPNEGO ==== | ==== Attaching SPNEGO ==== | ||
| Zeile 196: | Zeile 264: | ||
| With SPNEGO, you gain access to SSO in Authentik. | With SPNEGO, you gain access to SSO in Authentik. | ||
| - | Here is the lonk to the Docs: [[https:// | + | Here is the link to the Docs: [[https:// |
| You need to logon to FreeIPA as Admin and do the following: | You need to logon to FreeIPA as Admin and do the following: | ||
| * Go to Hosts, add Host '' | * Go to Hosts, add Host '' | ||
| - | * Go to Services, Add an new HTTP- Service for that Host | + | * Go to Services, Add an new HTTP- Service for that Host, called HTTP/ |
| + | * Add the Ipa- User admin to the " | ||
| - | After that, you need to Console into the running FreeIPA-Container and use the commands there: | + | After that, you need to the Docker- |
| < | < | ||
| + | #~> docker exec -it servername-ipa-1 bash | ||
| # Logon as Admin | # Logon as Admin | ||
| kinit admin | kinit admin | ||
| Zeile 215: | Zeile 285: | ||
| </ | </ | ||
| - | This is the Keytab that you will use for SPNEGO. | + | This is the Keytab |
| - | Use the Servicename '' | + | Use the Servicename '' |
| Important: Use "User matching mode" = "Link to User with identical Username. …“ - otherwise Kerberos may fail! | Important: Use "User matching mode" = "Link to User with identical Username. …“ - otherwise Kerberos may fail! | ||
| Than activate Kerberos in Flows and Stages > Stages > default-authentication-identification > Source settings | Than activate Kerberos in Flows and Stages > Stages > default-authentication-identification > Source settings | ||
| + | |||
| + | Make sure, that your client is able to login with FreeIPA using SSSD/ | ||
content/serverbasics/docker-authentik.1743275996.txt.gz · Zuletzt geändert: von obel1x
