Skip to content

Commit b85d16f

Browse files
committed
docs: Update instructions for latest Kanidm security requirements
Also general doc updates and better formatting for readability.
1 parent 8c1d6ec commit b85d16f

File tree

1 file changed

+27
-13
lines changed

1 file changed

+27
-13
lines changed

README.md

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
i.e. How to connect legacy web apps that only support SAML to be backed by Kanidm OIDC. While the configs in this repo can be educational for rolling your own SATOSA setup, an opinionated ENV configurable container image is also provided.
44

55
> [!CAUTION]
6-
> This is an early version that only supports a 1:1 proxy config where a single SAML supporting web service auths via a single OIDC endpoint.
7-
> The intent is to morph into a "v2" that allows a dynamic mapping of multiple systems to multiple OIDC endpoints via a single SAML proxy. The simpler version will be preserved for educational purposes but is intended to become "legacy".
6+
> This example on purpose only supports a 1:1 proxy config where a single SAML supporting web service auths via a single OIDC endpoint. To limit blast radius, just deploy multiple if you have multiple SAML-only services.
87
98
## TODO items on the roadmap
109
1. Get rid of the idpyoidc git build once there's a release that contains ES256 support.
@@ -15,7 +14,7 @@ i.e. How to connect legacy web apps that only support SAML to be backed by Kanid
1514
The container built at `ghcr.io/jinnatar/satosa-saml-proxy:latest` is a proof of concept using the SATOSA configs in the repo. The guides below will assume you are using it, but nothing prevents you from using the same configs and ENV config with any other supported SATOSA installation method. I am using the container myself in my environment and have a vested interest in keeping it going and tested.
1615

1716
The caveats with the container and/or trying to go without it:
18-
- While recent releases of SATOSA support PKCE, they depend on the Python library `idpyoidc` for this. Unfortunately it has an issue that prevents using ES256 for signing with released versions. The container thus uses [a branch from git](https://github.com/IdentityPython/idpy-oidc/tree/issuer_metadata) that contains the fix for this. Once a full release is made with said fix that will be used specifically. Once SATOSA requires a high enough release of `idpyoidc` that contains a fix, we can stop with this nonsense altogether.
17+
- While recent releases of SATOSA support PKCE, they depend on the Python library `idpyoidc` for this. Unfortunately it has an issue that prevents using `ES256` for signing with released versions. The container thus uses [a branch from git](https://github.com/IdentityPython/idpy-oidc/tree/issuer_metadata) that contains the fix for this. Once a full release is made with said fix that will be used specifically. Once SATOSA requires a high enough release of `idpyoidc` that contains a fix, we can stop with this nonsense altogether.
1918
- The containers are now version tagged as per SATOSA upstream versions. However, due to the above nonsense those tags will be updated later when better build provenance is available.
2019

2120
### Container config options
@@ -67,23 +66,35 @@ SAML is a bit *involved* so we need to prep a persistent certificate and provide
6766
### Practical example: Ceph SSO via Kanidm
6867
1. Pre-create your users in Ceph to give them the correct authz. In this example we'll use short usernames for simplicity so that needs to match.
6968
1. Create your Kanidm OIDC configuration the usual way, no need to disable PKCE!
70-
```
71-
kanidm system oauth2 create ceph Ceph https://saml.example.com # **Important**, give the proxy URL here.
72-
kanidm system oauth2 prefer-short-username ceph # Use short usernames for convenience
73-
kanidm system oauth2 update-scope-map ceph ceph_admins openid profile email # Create the scope map, don't forget to create the group and add your Ceph admins to it.
74-
kanidm system oauth2 show-basic-secret ceph # Get your client_secret for use later on.
69+
```shell
70+
# **Important** give the upstream Ceph landing page URL here:
71+
kanidm system oauth2 create ceph Ceph https://ceph.example.com
72+
73+
# **Important** give the proxy callback URL here. The full value depends on $OIDC_NAME:
74+
kanidm system oauth2 add-redirect-url ceph https://ceph-saml.example.com/oidc_ceph
75+
76+
# Use short usernames for convenience
77+
kanidm system oauth2 prefer-short-username ceph
78+
79+
# Create the scope map, don't forget to create the group and add your Ceph admins to it.
80+
kanidm system oauth2 update-scope-map ceph ceph_admins openid profile email
81+
82+
# Get your client_secret for use later on:
83+
kanidm system oauth2 show-basic-secret ceph
7584
```
7685
1. Create your SAML2 certs and set their permissions as per the generic steps above, nothing special here.
7786
1. We can't get Ceph to spit out it's metadata XML before the proxy is functioning so we skip ahead.
7887
1. Config your ENV variables into a new env file, `ceph.env`. If you don't change the ENCRYPTION_KEY value you deserve everything you get as a result.
7988
```shell
80-
LOG_LEVEL=debug # Enables debug logging for troubleshooting. Change this to "info" when everything works!
89+
# Enables debug logging for troubleshooting. Change this to "info" when everything works!
90+
LOG_LEVEL=debug
8191
ENCRYPTION_KEY=+OSDGTYdWxesiUwcMEzaGzwCx81YHhzOFgsitMn9A/c=
8292
OIDC_CLIENT_ID=ceph
83-
OIDC_CLIENT_SECRET=# You got this above from kanidm
93+
# The client secret you got in a previous step:
94+
OIDC_CLIENT_SECRET=
8495
OIDC_ISSUER_URL=https://idm.example.com/oauth2/openid/ceph
8596
OIDC_NAME=oidc_ceph
86-
PROXY_BASE_URL=https://saml.example.com
97+
PROXY_BASE_URL=https://ceph-saml.example.com
8798
SAML_METADATA=dummy-metadata.xml
8899
SAML_NAME=saml_ceph
89100
```
@@ -96,7 +107,10 @@ SAML is a bit *involved* so we need to prep a persistent certificate and provide
96107
```
97108
1. Register the proxy with Ceph, giving it the Ceph URL, SAML metadata endpoint and an attribute field name to expect for the username.
98109
```shell
99-
ceph dashboard sso setup saml2 https://ceph.example.com https://saml.example.com/saml_ceph/metadata.xml urn:oid:0.9.2342.19200300.100.1.1
110+
ceph dashboard sso setup saml2 \
111+
https://ceph.example.com \
112+
https://ceph-saml.example.com/saml_ceph/metadata.xml \
113+
urn:oid:0.9.2342.19200300.100.1.1
100114
```
101115
1. Assuming registration was succesful, we can now get the Ceph side SAML metadata:
102116
```shell
@@ -111,4 +125,4 @@ SAML is a bit *involved* so we need to prep a persistent certificate and provide
111125
ghcr.io/jinnatar/satosa-saml-proxy:latest
112126
```
113127

114-
1. Restart the proxy and go test Ceph SSO!
128+
1. Restart the proxy and go test Ceph SSO! Once it's all working, amend your env one more time to set `LOG_LEVEL=info`!

0 commit comments

Comments
 (0)