blabla1337 / skf-flask

Security Knowledge Framework (SKF) Python Flask / Angular project
https://www.securityknowledgeframework.org
Apache License 2.0
807 stars 308 forks source link

Review OPENID implementation in Keycloak/Krakend #784

Open RiieCco opened 2 years ago

RiieCco commented 2 years ago

In the skf-flask soo branch we have the implementation of Keycloak and Krakend for authentication/authorization. To run SKF with these services you need to run the following docker-compose file:

https://github.com/blabla1337/skf-flask/blob/soo/docker-compose-extended.yml

Running this compose file wil provide you with the following architecture:

Screenshot 2022-07-01 at 14 04 48

Keycloak

Keycloak settings are already imported as you can see from the compose file and create a realm called "Krakend" pre configured. JSON file with settings is here:

https://github.com/blabla1337/skf-flask/tree/soo/keycloak

Krakend

Here we see all the endpoints mapped from the SKF-API to the gateway and the attributes needed to call to different endpoints:

https://github.com/blabla1337/skf-flask/tree/soo/krakend/config

Angular

The docker-compose-extended.yml also deploys a different "version" of the SKF Angular front-end that includes the OpenID part responsible for the redirects.

Nginx

This configuration wil also load a different Nginx config file for routing to the gateway instead of directly to the API

https://github.com/blabla1337/skf-flask/blob/soo/Docker/compose/extended-site.conf