Files
kubernetes/authelia/postgresql-ca.crt
Dustin C. Hatch b07e141fa3 authelia: Convert to a stateless service
By default, Authelia uses a local SQLite database for persistent data
(e.g. authenticator keys, TOTP secrets, etc.) and keeps session data in
memory.  Together, these have some undesirable side effects.  First,
since needing access to the filesystem to store the SQLite database
means that the pod has to be managed by a StatefulSet.  Restarting
StatefulSet pods means stopping them all and then starting them back up,
which causes downtime.  Additionally, the SQLite database file needs to
be backed up, which I never got around to setting up.  Further, any time
the service is restarted, all sessions are invalidated, so users have to
sign back in.

All of these issues can be resolved by configuring Authelia to store all
of its state externally.  The persistent data can be stored in a
PostgreSQL database and the session state can be stored in Redis.  Using
a database managed by the existing Postgres Operator infrastructure
automaticaly enables high availability and backups as well.

To migrate the contents of the database, I used [pgloader].  With
Authelia shut down, I ran the migration job.  Authelia's database schema
is pretty simple, so there were no problems with the conversion.
Authelia started back up with the new database configuration without any
issues.

Session state are still stored only in memory of the Redis process.
This is probably fine, since Redis will not need restarted often, except
for updates.  At least restarting Authelia to adjust its configuration
will not log everyone out.

[pgloader]: https://pgloader.readthedocs.io/en/latest/ref/sqlite.html
2023-10-19 07:12:02 -05:00

46 lines
2.0 KiB
Plaintext

Certificate:
Data:
Version: 3 (0x2)
Serial Number:
05:09:51:c6:62:f6:1e:54:45:6a:0c:66:6b:5f:d0:b7
Signature Algorithm: ecdsa-with-SHA256
Issuer: CN = PostgreSQL CA
Validity
Not Before: Oct 18 16:23:46 2023 GMT
Not After : Oct 15 16:23:46 2034 GMT
Subject: CN = PostgreSQL CA
Subject Public Key Info:
Public Key Algorithm: id-ecPublicKey
Public-Key: (256 bit)
pub:
04:64:33:c3:cc:09:7a:3b:e2:06:18:35:d9:9e:dc:
e7:ba:08:2f:d9:26:0f:8e:03:a8:9e:78:c9:54:5c:
fa:32:cb:ae:c3:87:dc:ce:6d:29:a4:cc:7b:73:3f:
73:49:4e:35:91:42:bf:09:5f:0b:a3:8b:92:40:61:
6e:f7:bf:cd:9c
ASN1 OID: prime256v1
NIST CURVE: P-256
X509v3 extensions:
X509v3 Key Usage: critical
Digital Signature, Key Encipherment, Certificate Sign
X509v3 Basic Constraints: critical
CA:TRUE
X509v3 Subject Key Identifier:
F1:84:E9:B9:96:86:8F:DF:58:61:AA:E4:31:B3:E3:E0:4D:AF:BD:DA
Signature Algorithm: ecdsa-with-SHA256
Signature Value:
30:44:02:20:42:2f:2b:b2:76:56:13:bf:3f:60:92:a8:ed:48:
85:aa:cf:69:68:f0:a7:a5:52:0b:d2:1a:40:69:ac:ee:a0:ff:
02:20:56:0b:92:3e:42:f3:5c:ff:0a:6f:d4:95:d9:b8:5b:f8:
27:55:8b:1c:32:5e:5c:18:30:84:7c:33:92:9b:d3:1b
-----BEGIN CERTIFICATE-----
MIIBbzCCARagAwIBAgIQBQlRxmL2HlRFagxma1/QtzAKBggqhkjOPQQDAjAYMRYw
FAYDVQQDEw1Qb3N0Z3JlU1FMIENBMB4XDTIzMTAxODE2MjM0NloXDTM0MTAxNTE2
MjM0NlowGDEWMBQGA1UEAxMNUG9zdGdyZVNRTCBDQTBZMBMGByqGSM49AgEGCCqG
SM49AwEHA0IABGQzw8wJejviBhg12Z7c57oIL9kmD44DqJ54yVRc+jLLrsOH3M5t
KaTMe3M/c0lONZFCvwlfC6OLkkBhbve/zZyjQjBAMA4GA1UdDwEB/wQEAwICpDAP
BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTxhOm5loaP31hhquQxs+PgTa+92jAK
BggqhkjOPQQDAgNHADBEAiBCLyuydlYTvz9gkqjtSIWqz2lo8KelUgvSGkBprO6g
/wIgVguSPkLzXP8Kb9SV2bhb+CdVixwyXlwYMIR8M5Kb0xs=
-----END CERTIFICATE-----