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

docs: ADR for AuthN/AuthZ in multi-tenancy #537

Merged
1 commit merged into from
Jun 1, 2023

Conversation

ghost
Copy link

@ghost ghost commented May 27, 2023

Overview

Adds an architectural decision record - ready for review - for the research conducted in ATL-4362

Checklist

My PR contains...

  • No code changes (changes to documentation, CI, metadata, etc.)
  • Bug fixes (non-breaking change which fixes an issue)
  • Improvements (misc. changes to existing features)
  • Features (non-breaking change which adds functionality)

My changes...

  • are breaking changes
  • are not breaking changes
  • If yes to above: I have updated the documentation accordingly

Documentation

  • My changes do not require a change to the project documentation
  • My changes require a change to the project documentation
  • If yes to above: I have updated the documentation accordingly

Tests

  • My changes can not or do not need to be tested
  • My changes can and should be tested by unit and/or integration tests
  • If yes to above: I have added tests to cover my changes
  • If yes to above: I have taken care to cover edge cases in my tests

@ghost ghost force-pushed the feature/atl-4362-authn-authz-multi-tenancy-adr branch from c2e35fa to 8dee09a Compare May 27, 2023 22:01
@github-actions
Copy link
Contributor

Atala PRISM Test Results

  50 files    50 suites   32s ⏱️
372 tests 372 ✔️ 0 💤 0
373 runs  373 ✔️ 0 💤 0

Results for commit 8dee09a.

@github-actions
Copy link
Contributor

Atala PRISM Code Coverage

File Coverage
All files 22%

Minimum allowed coverage is 12%

Generated by 🐒 cobertura-action against 8dee09a

@github-actions
Copy link
Contributor

E2E Test Results

10 files  ±0  10 suites  ±0   5m 30s ⏱️ +7s
19 tests ±0  19 ✔️ ±0  0 💤 ±0  0 ±0 
30 runs  ±0  30 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit 8dee09a. ± Comparison against base commit fe5920b.

@mkbreuningIOHK mkbreuningIOHK requested a review from mineme0110 May 29, 2023 11:41
- Possible increased latency due to JWT verification at both APISIX and application layers.
- Reupidation threat minimised by short OIDC access token lifetime but not fully mitigated as no digital signature implemented.

## Pros and Cons of the Options
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What alternatives to IAM were considered?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't include any other alternatives when writing. The reason for this is that I'm not aware of any other open source FAPI grade IAM components that can run self-hosted and in cloud. If you know of any I would love to do a quick comparison. My research in the past shows that there are many libraries for use on the application layer but very little full solutions that aren't propertiety cloud venodrs [like Okta, AD etc]

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yuiry has suggested we compare it to the Hashicorp Vault access management capabilities so I plan to do that

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another one I did hear mentioned was https://goauthentik.io/ so I can include this as well

Copy link
Member

@yshyn-iohk yshyn-iohk May 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm exploring Hashicorp Vault, and it also can be configured as an authentication service with different auth methods.
I would consider using it and use AppRole for the Prism Agent authentication and JWT/OIDC method for web/mobile application authentication (when we switch to multi-tenancy)
I think we need a PoC to test how it works and if it fits our needs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... the Vault also includes an identity management functionality
... and the integration between the Vault and APISIX can be configured using jwt-auth plugin

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yshyn-iohk I've read through everything again but I fear that the links you've provided cover authenticating to Vault only - it can't act as an IdP or PAP/PDP etc

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We propose to defer this topic until a couple of weeks - merge this ADR and sanitise the decision before implementation on Keycloak begins.

In order to not block progress - we can start building in the applicaiton layer assuming that a tenant string is available at the point a request is processed - we can later adapt this abstraction to work with IAM tool

Copy link
Member

@yshyn-iohk yshyn-iohk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ADR is suitable but covers the integration with Keycloak only
I propose keeping it and discovering if the Vault can provide the same functionality.
The main motivations for using Vault:

  • same service for secret management, authentication, and authorization, IAM
  • fewer components to integrate and lower cost of support

Currently, it's hard to say which solution should be adopted. We need a PoC to test the capability of the Vault.

@ghost ghost merged commit ab9d2b8 into main Jun 1, 2023
@ghost ghost deleted the feature/atl-4362-authn-authz-multi-tenancy-adr branch June 1, 2023 11:56
ghost pushed a commit that referenced this pull request Aug 17, 2023
…epo subject to the Developer Certificate of Origin (DCO), Version 1.1.

40a0578 fix: consumer variable nesting correction (#606)
d0372f1 fix: include helm Chart.yaml in git commit for release process (#604)
63f38d4 feat: add helm-chart for agent  (#603)
ab9d2b8 docs: ADR for AuthN/AuthZ in multi-tenancy (#537)
7d603f0 feat: restore JVM metrics endpoint capability (#527)
9b1558f feat: migrate issue endpoint to tapir (#516)
4ee0943 feat: Allow override of network name (#295)
6d3e5a0 feat(prism-agent): add JVM metrics endpoint, add health/version endpoint (#390)
2f60f22 Fix/e2e test fixes (#381)
198643e feat(prism-agent): set OAS version to 0.41.0 (#386)
3b348ac fix(infra): set local PRISM_AGENT_VERSION to 0.40.0 (#379)
32787ad ci(shared): added manual feedback for linting and changed linting config (#303)
dcb6b51 ci(shared): enable megalinter checks on pullrequests (#300)
405f367 fix(prism-agent): didcomm endpoint now exposed in docker file and with correct path (#241)
2dcf5e3 fix(infra): change didcomm endpoint - remove suffix (#240)
32e33f1 feat(infra): switch to single instance of postgres for running locally (#203)
e3a1aa6 feat(infra): switch to APISIX for local running instead of HAProxy (#196)
df24ad9 feat(infra): improved scripts for runinng locally or develping locally (#153)
dc641b1 chore(shared): move api folder into runnable and reset build settings for dockerRepository and version.sbt (#152)
775880a feat(shared): set OAS servers to `k8s-dev.atalaprism.io` and add API Key auth method - also update local docker-compose implementation (#126)
67bd340 feat(prism-agent): implement Flyway migrations from castor and pollux library and call on agent startup (#117)
cd11493 feat(shared): add Flyway Migrations and expose in ZIO Layer to be used in consuming service (#115)
a5b583f feat(shared): Add environmnet configuration for Iris DB and bump scala version in other components to enable build (#96)
6e388b3 [ATL-1869] docs: Bootstrap ADR decision log using log4brains, RFC-0016 (#34)

Signed-off-by: David Poltorak <[email protected]>
antonbaliasnikov pushed a commit that referenced this pull request Aug 21, 2023
…epo subject to the Developer Certificate of Origin (DCO), Version 1.1.

40a0578 fix: consumer variable nesting correction (#606)
d0372f1 fix: include helm Chart.yaml in git commit for release process (#604)
63f38d4 feat: add helm-chart for agent  (#603)
ab9d2b8 docs: ADR for AuthN/AuthZ in multi-tenancy (#537)
7d603f0 feat: restore JVM metrics endpoint capability (#527)
9b1558f feat: migrate issue endpoint to tapir (#516)
4ee0943 feat: Allow override of network name (#295)
6d3e5a0 feat(prism-agent): add JVM metrics endpoint, add health/version endpoint (#390)
2f60f22 Fix/e2e test fixes (#381)
198643e feat(prism-agent): set OAS version to 0.41.0 (#386)
3b348ac fix(infra): set local PRISM_AGENT_VERSION to 0.40.0 (#379)
32787ad ci(shared): added manual feedback for linting and changed linting config (#303)
dcb6b51 ci(shared): enable megalinter checks on pullrequests (#300)
405f367 fix(prism-agent): didcomm endpoint now exposed in docker file and with correct path (#241)
2dcf5e3 fix(infra): change didcomm endpoint - remove suffix (#240)
32e33f1 feat(infra): switch to single instance of postgres for running locally (#203)
e3a1aa6 feat(infra): switch to APISIX for local running instead of HAProxy (#196)
df24ad9 feat(infra): improved scripts for runinng locally or develping locally (#153)
dc641b1 chore(shared): move api folder into runnable and reset build settings for dockerRepository and version.sbt (#152)
775880a feat(shared): set OAS servers to `k8s-dev.atalaprism.io` and add API Key auth method - also update local docker-compose implementation (#126)
67bd340 feat(prism-agent): implement Flyway migrations from castor and pollux library and call on agent startup (#117)
cd11493 feat(shared): add Flyway Migrations and expose in ZIO Layer to be used in consuming service (#115)
a5b583f feat(shared): Add environmnet configuration for Iris DB and bump scala version in other components to enable build (#96)
6e388b3 [ATL-1869] docs: Bootstrap ADR decision log using log4brains, RFC-0016 (#34)

Signed-off-by: David Poltorak <[email protected]>
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants