Oberkorn Authorizator is a module created for having the flexibility to deploy token validation (JWT or whatever token type) in front of any application project deployed
inside a Kubernetes cluster where the access is managed via Ingress.
The Oberkorn authorizator project is made up of several components:
Custom Resource Definitions. The way a Oberkorn authorizator can be deployed is based on kubernetes CRD's. You can see examples in the Oberkorn Authorizator repositories explaning how to build and deploy an authorizator using such CRD's.
Controller. Creating CRD's is a good starting point, but for the CRD's to do something useful, you need to have a controller who can listen for CRD events (resource creation, resource modification and resource deletion). The Oberkorn controller is deployed to kubernetes as a Deployment.
Authorizator. The Authorizator is the component in charge of managing users requests and deciding, according to specs included in the CRD's, where to approve or deny access requests to web resources.
This repo contains everything you need to deploy an Oberkorn Controller.
The Oberkorn controller is the responsible of listening for Oberkorn authorizator operations, that is, the controller listens for cluster events regarding the management of Oberkorn authorizators: creation of new authorizators, deletion of modifications.
When a new Oberkorn authorizator is created, the controller receives an "ADDED" event from the control plane of the kubernetes cluster and performs following tasks:
Validates the request.
Creates a config map containing all the configuration that the authorizator needs for working.
If an nginx-ingress-controller has been specified in the CRD, the controller will update the ingress controller to make him point it's authorization endpoint to the newly created authorizator (see Nginx Ingress Controller annnotations to understand this process).
Creates a deployment with at least 1 replica of the image OBK-Authorizator (this deployment will do the magic for you).
Creates a service to route authorization requests from the ingress controller to the authorizator.
When a deployed authorizator needs to be changed, you can just 'kubectl apply' the changes in a CRD YAML and the controller will update the authorizator configuration accordingly. For this to work properly, the controller will perform this tasks:
Validate the request.
Apply changes to the authorizator's config map.
Apply changes to the authorizator deployment.
If an ingress controller has been specified, then the Oberkorn controller will reconfigure the ingress through annotations.
You create a YAML containing the specs of an Oberkorn Authorizator. See the rest of the documentation on how to uild a YAML like this.
You apply the YAML to create the authorizator: 'kubectl apply -f your-authorizator-code.yaml'.
The controller, which is listening for 'ObkAuthorizator' events receives an 'ADDED' event, so the controller creates all the resources needed to deploy an authorizator (a pod, a service, and, optionally, it configures your ingress to point its authorization needs to the new 'ObkAuthorizator').
You can make changes to your auhtorizator (like changing scale process, modifying the ruleset...), so when you apply a new YAML the controller receives a 'MODIFIED' event and it performs requested changes.
When you no longer need an Authorizator, you can 'kubectl delete' it and the controller will receive a 'DELETED' event and it will deprovision all previously provisioned resources (and optional configuration).
Oberkorn is build around two separate resources: the controller (in charge of the control plane) and the authorizator (repsonsible of the data plane). The architecture of the whole project is depicted below.
Oberkorn provides a web console that is protected using an Oberkorn Authorizator.