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

Added a blog post about adding integrity checking to an existing filesystem realm using the elytron tool #2037

Merged
merged 1 commit into from
Nov 2, 2023

Conversation

PrarthonaPaul
Copy link
Contributor

@PrarthonaPaul PrarthonaPaul commented Oct 20, 2023

@PrarthonaPaul PrarthonaPaul force-pushed the develop branch 2 times, most recently from af3a853 to a269bf5 Compare October 25, 2023 16:43
@PrarthonaPaul PrarthonaPaul changed the title Added an example to deploy an OIDC secured application to OpenShift Added a blog post about adding integrity checking to an existing filesystem realm using the elytron tool Oct 25, 2023
@PrarthonaPaul PrarthonaPaul force-pushed the develop branch 2 times, most recently from 2f64fce to 4cd6d7a Compare October 25, 2023 16:53
:toc: macro
:toc-title:

WildFly 27 included the ability to add integrity on FileSystem realms. This uses an asymmetric keyPair that has a private and public key to secure the filesystem realm. In the filesystem realm, each identity will be signed using the private key. This makes it possible to verify that identities in the realm haven't been tampered with.
Copy link
Contributor

@fjuma fjuma Oct 25, 2023

Choose a reason for hiding this comment

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

s/integrity on FileSystem realms/integrity checking support to filesystem realms

Copy link
Contributor

Choose a reason for hiding this comment

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

s/keyPair/key pair

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!


toc::[]

https://wildfly-security.github.io/wildfly-elytron/blog/filesystem-integrity/[A previous blog post] demonstrates how to create a filesystem realm and secure it using the elytron subsystem. This blog post will demonstrate how to take an existing filesystem realm and add integrity checking to it using the WildFly Elytron Tool. In this post we will go through an example of converting an unencrypted filesystem realm to one with integrity enabled and then we will try accessing a web application that is secured with the new filesystem realm.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/create a filesystem realm and secure it using the elytron subsystem/create a filesystem realm with encryption enabled using the Elytron subsystem

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be good to move this block above the toc so it's part of the intro section.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!
I changed it to "demonstrates how to enable integrity support on a filesystem realm using the Elytron subsystem" since I was talking about this (https://wildfly-security.github.io/wildfly-elytron/blog/filesystem-integrity/) blog.

Now we can deploy and access the application and log in using the credentials for quickstartUser. However, without any integrity checking, anyone with access to the contents of the filesystem realm can tamper with it. So, let's add integrity checking for this filesystem realm.

== Adding Integrity Checking
In order to access the elytron tool, we can use the following command:
Copy link
Contributor

Choose a reason for hiding this comment

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

To create a new filesystem realm based off our existing one but with the integrity support enabled, we can use the following Elytron Tool command:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed!

./bin/elytron-tool.sh filesystem-realm-integrity --input-location WILDFLY_HOME/standalone/configuration/fs-realm --output-location WILDFLY_HOME/standalone/configuration/fsRealmWithIntegrity --keystore PATH/TO/KEYSTORE/FILE --password password --key-pair key --summary
```

Here the `input-location` option refers to the path to the filesystem realm directory, the `output-location` refers to the new filesystem realm to be created. The `keystore` option specifies the location for the keystore file, `password` refers to the password for the keystore and `key-pair` refers to the alias of the key that uniquely identified the key pair we are looking for inside the keystore. The `summary` option is added so that when the new filesystem is created, we can see the details of what is being done. The keystore can be created in one of two ways:
Copy link
Contributor

Choose a reason for hiding this comment

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

input-location option refers to the path to the existing filesystem

Copy link
Contributor

Choose a reason for hiding this comment

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

s/identified/identifies

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed!


== Summary

This blog post shows how to add integrity checking to an existing filesystem realm using an asymmetrical keypair and the WildFly Elytron tool. We also looked at how we can convert multiple filesystem realms using the `bulk-convert` option. Please note that in addition to elytron-tool.sh, the WildFly package also comes with `elytron-tool.bat` and `elytron-tool.ps1` scripts. For more information on the different options available for the elytron-tool, you can use the `--help` option. To learn more about the filesystem-security-realm, please refer to the https://docs.wildfly.org/30/WildFly_Elytron_Security.html#filesystem-security-realm[WildFly documentation].
Copy link
Contributor

Choose a reason for hiding this comment

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

s/shows/has shown

Copy link
Contributor

Choose a reason for hiding this comment

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

s/the WildFly package/WildFly also ships with

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed!
Thanks for going through it and for adding the comments!

Copy link
Contributor

@fjuma fjuma left a comment

Choose a reason for hiding this comment

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

Great post @PrarthonaPaul! I've added some small comments.

@fjuma fjuma requested a review from Skyllarr October 25, 2023 19:39
@PrarthonaPaul PrarthonaPaul force-pushed the develop branch 2 times, most recently from fc26857 to fb1817f Compare October 25, 2023 19:44

The successful login indicates that integrity has been configured correctly.

In order to further verify that these features are being used correctly we can navigate to the identity file and check the contents. The file should be located at WILDFLY_HOME/standalone/configuration/fs-realm/q/u/quickstartuser-<hashed username>.xml if the same filesystem realm and identity configuration was used.
Copy link
Contributor

@Skyllarr Skyllarr Oct 26, 2023

Choose a reason for hiding this comment

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

Hi @PrarthonaPaul , I think this realm named fs-realm with path WILDFLY_HOME/standalone/configuration/fs-realm was not modified to have integrity check right? The identities with integrity check are in path WILDFLY_HOME/standalone/configuration/fsRealmWithIntegrity and not WILDFLY_HOME/standalone/configuration/fs-realm/q/u/...

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean if a person follows this blog post then the identities with integrity signature are in the fsRealmWithIntegrity subfolder

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh yes, you are right.
I have updated it. Thanks for catching it!


== Summary

This blog post has shown how to add integrity checking to an existing filesystem realm using an asymmetrical key pair and the WildFly Elytron tool. We also looked at how we can convert multiple filesystem realms using the `bulk-convert` option. Please note that in addition to elytron-tool.sh, WildFly also ships with `elytron-tool.bat` and `elytron-tool.ps1` scripts. For more information on the different options available for the elytron-tool, you can use the `--help` option. To learn more about the filesystem-security-realm, please refer to the https://docs.wildfly.org/30/WildFly_Elytron_Security.html#filesystem-security-realm[WildFly documentation].
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a minor, s/filesystem-security-realm/filesystem-realm or s/filesystem-security-realm/filesystem security realm

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!
Thank you!

@PrarthonaPaul PrarthonaPaul force-pushed the develop branch 2 times, most recently from 9364c2a to 7562c9b Compare October 26, 2023 19:19
Copy link
Contributor

@Skyllarr Skyllarr left a comment

Choose a reason for hiding this comment

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

Thanks @PrarthonaPaul !

title: 'Adding Support for Integrity Checking to an Existing
Filesystem Realm'
date: 2023-10-24
tags: filesystem integrity filesystem-realm
Copy link
Contributor

Choose a reason for hiding this comment

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

@PrarthonaPaul Just a total minor, we can add the tag tool as well, so it shows here: https://prarthonapaul.github.io/wildfly-elytron/blog/tag/tool/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!
Thank you for pointing it out.

@PrarthonaPaul PrarthonaPaul force-pushed the develop branch 2 times, most recently from 6bbe001 to d93271b Compare October 30, 2023 13:50
@fjuma
Copy link
Contributor

fjuma commented Oct 30, 2023

Thanks for the updates @PrarthonaPaul!

@Skyllarr Please review, thanks!

layout: post
title: 'Adding Support for Integrity Checking to an Existing
Filesystem Realm'
date: 2023-10-30
Copy link
Contributor

Choose a reason for hiding this comment

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

@PrarthonaPaul just a minor, please put a today's date here and I will merge. Thanks!

@Skyllarr Skyllarr merged commit 373f4d7 into wildfly-security:develop Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants