Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate SAML setup via a new action #1933

Open
peb-adr opened this issue Oct 24, 2023 · 2 comments
Open

Automate SAML setup via a new action #1933

peb-adr opened this issue Oct 24, 2023 · 2 comments
Labels
Milestone

Comments

@peb-adr
Copy link
Member

peb-adr commented Oct 24, 2023

At the moment the following (here relevant) SAML related fields are defined:

  # Saml settings 
  # [...]                                                         
  saml_metadata_idp:                                 
    type: text                                                      
    restriction_mode: A                                                          
  saml_metadata_sp:                       
    type: text                                                   
    restriction_mode: A                                                                                                                                                                                             
  saml_private_key:                                                                                                                                                                                                 
    type: text                                                                                                                                                                                                      
    restriction_mode: A           

As far as I know these are set with a simple organization.update action issued by the client.
This is very error prone and should instead be mostly automated.
It requires the end user to manually generate and input a keypair and metadata for SP (OpenSlides), see OpenSlides/openslides-client#2944.
I think the backend should just provide an action to automatically generate the needed information, like organization.generate_saml_metadata.
This should then generate a x509 key pair and use it's public key and other relevant information from the database (such as URL) to construct saml_metadata_sp.
The organization.update action should then forbid changing saml_metadata_sp and saml_private_key manually.

For implementing this the backend probably should utilize the python3-saml module for which inspiration may be found at https://github.com/OpenSlides/OpenSlides/tree/stable/3.4.x/server/openslides/saml
However OpenSlides 3 did not generate the keypair within the code so this has to be researched.
I am pretty confident though, a good stable library for this exists.
The generated key pair should be equivalent to the output of

openssl req -new -x509 -days 3652 -nodes -out sp.crt -keyout sp.key

Also IdP's usually provide their metadata xml via an http route. So I think it would also be more user-friendly and intuitive to change the saml_metadata_idp to saml_metadata_idp_url, although this is not as important and may also be debatable.
This of course would also implicate that the URL must be queried at some point and I am not sure if the backend should be the one doing that. So maybe - if at all - this should be in the client which would then keep sending the xml to the backend.

@peb-adr peb-adr added the enhancement General enhancement which is neither bug nor feature label Oct 24, 2023
@peb-adr
Copy link
Member Author

peb-adr commented Oct 24, 2023

Another thing I forgot to mention.
Currently only the superadmin has the permission to change SAML related fields.
This should also be changed such that an organization admin can configure SAML on his own.

@jsangmeister jsangmeister added this to the 4.2 milestone Nov 2, 2023
@jsangmeister jsangmeister added feature and removed enhancement General enhancement which is neither bug nor feature labels Nov 2, 2023
@luisa-beerboom
Copy link
Member

Since this issue is a year old and a lot has happend in the SAML field since then, I'd guess it may possibly be a bit out-of-date by now.

@rrenkert @peb-adr How does this issue relate to the current SAML development? Could you arrange to have it updated with current specs if it is outdated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants