Example of implementing a Quarkus extension to mask Ip Addresses in Keycloak logs. Should be easy to build upon to integrate new filters.
Readers should be familiar with Java and Dependency Injection in Java frameworks.
A docker-compose.yml
file has been provided. To run Keycloak with the extension, run the
command docker compose up -d
.
Please create an issue if you have any questions. Contributions are welcome. Most of the code was put together using tutorials/documentation on the Quarkus website, stackoverflow, and reading Quarkus source code/tests.
- https://quarkus.io/guides/building-my-first-extension#description-of-a-quarkus-extension
- https://quarkus.io/guides/logging#add-a-logging-filter-to-your-log-handler
- keycloak/keycloak#10884
- quarkusio/quarkus#25981
- https://stackoverflow.com/questions/68375755/how-to-intercept-logging-messages-with-quarkus-for-testing-purposes
- How do I know that my extension has been loaded ? Check the logs. All the installed extensions ("features") are logged when Keycloak starts.
- How can I create an extension ? Follow tutorial