-
Notifications
You must be signed in to change notification settings - Fork 64
Add use case and update layered zero trust docs #609
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
Open
gaurav-nelson
wants to merge
1
commit into
validatedpatterns:main
Choose a base branch
from
gaurav-nelson:ztvp-updates-MBP-966
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 103 additions & 0 deletions
103
content/patterns/layered-zero-trust/lzt-secure-multitier.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -0,0 +1,103 @@ | ||||
--- | ||||
title: Secure multi-tier applications | ||||
weight: 20 | ||||
aliases: /layered-zero-trust/lzt-secure-multitier | ||||
--- | ||||
|
||||
:toc: | ||||
:imagesdir: /images | ||||
:_mod-docs-content-type: ASSEMBLY | ||||
include::modules/comm-attributes.adoc[] | ||||
|
||||
[id="lzt-secure-multitier"] | ||||
= Use case: Secure multi-tier applications | ||||
|
||||
This use case demonstrates securing a common application design pattern: a frontend application using a database for persistent storage. | ||||
|
||||
The Layered Zero Trust Pattern includes the `qtodo` application, which demonstrates a secure just-in-time (JIT) credential mechanism. | ||||
|
||||
Instead of relying on static credentials stored within the application, the `qtodo` application uses a JIT method to dynamically fetch database credentials from a central credential store. | ||||
|
||||
[id="lazt-application-architecture"] | ||||
== Application components and architecture | ||||
|
||||
The `qtodo` application consists of the following key components and their security roles: | ||||
|
||||
* The `qtodo` application: A link:https://quarkus.io[Quarkus-based] frontend application protected by OpenID Connect (OIDC) authentication. Users are managed in an external identity store which uses Red{nbsp}Hat Build of Keycloak (RHBK). | ||||
|
||||
* PostgreSQL: The relational database used by the `qtodo` application. Its credentials are dynamically generated and stored within HashiCorp Vault. | ||||
|
||||
* External Identity store: Contains the provisioned users and configured OIDC clients that enable access to the `qtodo` frontend. | ||||
|
||||
* HashiCorp Vault: | ||||
|
||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
* Secrets store: Stores sensitive values for components, including PostgreSQL and RHBK. | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
|
||||
* Workload authentication: Implements Zero Trust Workload Identity (ZTWIM) principles by using JSON Web Token (JWT)-based authentication. It assigns an identity to the `qtodo` application, allowing it to communicate with HashiCorp Vault and obtain the necessary PostgreSQL credentials. | ||||
|
||||
* link:https://github.com/spiffe/spiffe-helper[spiffe-helper]: A supplemental sidecar component for the `qtodo` application used to dynamically fetch JWT-based identities from the SPIFFE Workload API. | ||||
|
||||
[id="lzt-exploring-qtodo"] | ||||
== Exploring the qtodo application | ||||
|
||||
The `qtodo` application is a key component of the Layered Zero Trust Pattern, demonstrating the secure JIT fetching of credentials. To explore how the application implements Zero Trust principles, use the {ocp} web console of the Hub cluster to investigate the resources in the `qtodo` project. | ||||
|
||||
.Procedure | ||||
|
||||
. In the {ocp} web console, navigate to the *Projects* page and select the `qtodo` project. This namespace contains the `qtodo` Quarkus application and the `qtodo-db` PostgreSQL database. | ||||
. Select *Workloads* -> *Pods* from the left-hand navigation bar. Explore both the `qtodo` and `qtodo-db` pods. | ||||
+ | ||||
[NOTE] | ||||
==== | ||||
The `qtodo` pod uses a series of init containers and sidecar containers to supply the application with the credentials required for operation. | ||||
==== | ||||
|
||||
[id="lzt-locate-app"] | ||||
=== Locating the application address | ||||
|
||||
You can access the `qtodo` application through the {ocp} route. | ||||
|
||||
.Procedure | ||||
|
||||
. In the {ocp} web console, navigate to the *Projects* page and select the `qtodo` project. | ||||
. Select *Networking* -> *Routes* from the left-hand navigation bar. Note the URL for the `qtodo` application in the *Location* column. | ||||
. Open a new browser tab and navigate to the `qtodo` application URL. | ||||
. The RHBK login page appears. | ||||
|
||||
[id="lzt-locate-app-credentials"] | ||||
=== Locating the application credentials | ||||
|
||||
The default External Identity Provider, RHBK, is provisioned with two users: `qtodo-admin` and `qtodo-user`. You can find the initial credentials in a Secret within the `keycloak-system` namespace called `keycloak-users`. | ||||
|
||||
.Procedure | ||||
|
||||
. In the {ocp} web console, navigate to the *Projects* page and select the `keycloak-system` project. | ||||
. Select *Workloads* -> *Secrets* from the left-hand navigation bar. | ||||
. Select the `keycloak-users` secret. | ||||
. Click the *Reveal values* link to see the credentials. | ||||
|
||||
[id="lzt-access-qtodo"] | ||||
=== Accessing the application | ||||
|
||||
.Procedure | ||||
|
||||
. Navigate to the RHBK login page, as described in the xref:lzt-locate-app[Locate the application's address] section. | ||||
|
||||
. Enter the username and password for one of the users, using the values found in the xref:lzt-locate-app-credentials[Locate the application credentials] section. | ||||
|
||||
. After you log in, follow the on-screen instructions to change the temporary password. | ||||
|
||||
. Set a new password and confirm the change. | ||||
+ | ||||
After the password change is complete, the `qtodo` application appears. | ||||
|
||||
[id="lzt-verify-integration"] | ||||
=== Verifying integration | ||||
|
||||
The `qtodo` application uses PostgreSQL for persistent storage. You can verify that the application is correctly integrated with the database by creating a new to-do item. | ||||
|
||||
.Procedure | ||||
. In the `qtodo` application, add new items to the list of to-dos and remove existing items. | ||||
. Refresh the page to verify that the items persist. | ||||
|
||||
By successfully modifying the list, you confirm that the integration between the Quarkus application and the PostgreSQL database—using credentials sourced dynamically from HashiCorp Vault—was successful. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.