I stumbled over an article about SIEM in a German IT magazine and found out about Wazuh, an open-source security platform. I immediately wanted to try it with Quarkus and understand what a Java application needs to tell a SIEM, short for security information and event management.
Trying this taught me to look beyond the request itself. An HTTP access log can tell us that an export endpoint returned 403, and OpenTelemetry traces can add context. For a security investigation, we also need to know which authenticated user was denied, what the application tried to authorize, and whether another user completed the export shortly afterwards. The application has that information when it makes the decision. We need to record and retain it deliberately, because sampled traces alone can't give us a complete audit history.
Quarkus gives us a starting point through its CDI authentication and authorization events. We'll collect those decisions without adding logging to every resource method, then add an explicit event for a completed business action. Authenticating an administrator tells us who they are; we still need the application to tell us whether they completed an export.
We'll write these events as one JSON object per line to a dedicated file. Wazuh's manager reads the file through a local container mount and applies our rules, then forwards the alerts to an indexer so we can search them in its dashboard. Quarkus continues to enforce the permissions throughout. Wazuh lets us follow the resulting events and connect repeated failures from the same source.
Prepare the local environment
The companion uses Java 21, Quarkus 3.40.1 LTS and Wazuh 4.14.8. You'll need a JDK to run the application, Podman with a Compose V2 provider for Wazuh, and Bash, curl and jq for the scripts and requests below. Maven comes with the project wrapper.
Wazuh's container deployment guide recommends at least four CPU cores, 8 GB RAM and 50 GB disk capacity for a single-node deployment. On a Mac, allocate the memory to the Podman Linux VM where the indexer runs; free memory elsewhere on the host won't help it start.
Check the container environment before opening the project:
podman info
podman compose version --shortThe version output must show a 2.x provider. Because podman compose delegates to an external executable, check which provider it runs. Follow the Podman Desktop Compose setup if you need to install it, then select the installed standalone Compose V2 binary explicitly if necessary:
export PODMAN_COMPOSE_PROVIDER=/absolute/path/to/docker-compose
podman compose version --shortThe indexer also needs vm.max_map_count of at least 262144 on its Linux host. On macOS, check that inside the same Podman VM:
podman machine ssh sysctl vm.max_map_countIf the value is smaller, set it with podman machine ssh sudo sysctl -w vm.max_map_count=262144 and configure persistence inside the VM if your setup resets it on reboot. Quarkus will start the containers for us, so Java also needs access to Podman's container API socket. The companion README explains how to set DOCKER_HOST for rootless Linux and macOS installations without the usual socket forwarding.
Keep this lab on your own machine. The application and dashboard bind to loopback, and we're using public development passwords and a local self-signed certificate for the dashboard.
Start from the companion
Let's start the application and Wazuh together, then go through how the events reach the index. Clone the article repository and run these commands from the companion directory:
git clone https://github.com/myfear/the-main-thread.git
cd the-main-thread/quarkus-wazuh-siem
./mvnw test
./scripts/bootstrap-wazuh.sh
./mvnw quarkus:devThe first Maven command runs the Java tests without starting Wazuh. Bootstrap then creates target/siem/security-events.jsonl before the manager mounts the directory and runs the pinned Wazuh certificate generator if required files are missing. Generated certificates and private keys stay outside Git. On macOS, the script also handles the generator's shared-mount ownership problem, as explained in the companion README.
With those files in place, Quarkus dev mode starts the manager, indexer and dashboard through Compose Dev Services. Allow a few minutes for the first image pulls and health checks. Once startup completes, the application listens at http://127.0.0.1:8088 and the dashboard at https://localhost:8443.
You can also create the application from scratch with the Quarkus CLI and add the files as we go:
quarkus create app com.example.siem:quarkus-wazuh-siem \
--platform-bom=io.quarkus.platform:quarkus-bom:3.40.1 \
--java=21 \
--extensions=rest-jackson,elytron-security-properties-file,observability-devservices \
--no-codeQuarkus REST with Jackson handles our JSON endpoints, while the properties-file extension supplies two fake identities for development and tests. This REST-only application also needs the Compose deployment infrastructure, which the observability Dev Services extension brings in. We'll disable its default telemetry stack and let Compose start the three Wazuh services. Use the companion's Wazuh configuration files together; they are adapted from the official 4.14.8 single-node release and need to match that layout.
Separate security decisions from completed actions
We'll use a profile endpoint to follow authentication and a simulated administrative export to follow a business action. The profile only needs to return the authenticated user's identity, so start with src/main/java/com/example/siem/ProfileResource.java:
package com.example.siem;
import jakarta.annotation.security.RolesAllowed;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import io.quarkus.security.identity.SecurityIdentity;
@ApplicationScoped
@Path("/api/profile")
public class ProfileResource {
private final SecurityIdentity identity;
public ProfileResource(SecurityIdentity identity) {
this.identity = identity;
}
@GET
@RolesAllowed("user")
public Profile profile() {
return new Profile(identity.getPrincipal().getName(), "authenticated");
}
public record Profile(String principal, String status) {
}
}Quarkus checks the role before allowing the request into this method. A valid identity with user can retrieve the profile; a request without that permission is rejected. We can collect authentication and failed authorization decisions through framework events, leaving the resource method focused on returning the profile.
For the export, we also need to record when the operation completes. Passing its role check only allows the method to run. For now, the export is simulated by creating a result with an export ID, a completed status and zero records. Add src/main/java/com/example/siem/AdminExportResource.java:
package com.example.siem;
import java.util.UUID;
import jakarta.annotation.security.RolesAllowed;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import io.quarkus.security.identity.SecurityIdentity;
import io.vertx.ext.web.RoutingContext;
@ApplicationScoped
@Path("/api/admin/export")
public class AdminExportResource {
private final SecurityIdentity identity;
private final RoutingContext context;
private final AuditNormalizer normalizer;
private final AuditRecorder recorder;
public AdminExportResource(SecurityIdentity identity, RoutingContext context,
AuditNormalizer normalizer, AuditRecorder recorder) {
this.identity = identity;
this.context = context;
this.normalizer = normalizer;
this.recorder = recorder;
}
@POST
@RolesAllowed("admin")
public ExportResult export() {
// Creating this result is the entire simulated operation; no real records are exported.
var result = new ExportResult(UUID.randomUUID().toString(), "completed", 0);
recorder.record(normalizer.normalize(SecurityAuditRecord.EventType.SENSITIVE_OPERATION_COMPLETED,
identity, context));
return result;
}
public record ExportResult(String exportId, String status, int records) {
}
}An authenticated alice has no admin role, so Quarkus rejects her request before this method runs. An authenticated operator can enter it, create the result and reach the audit call. Later, we'll be able to distinguish Alice's denied export from the operator's completed one. In a real export, emit the completion event after the business operation succeeds. If a transaction can still roll back afterwards, the event would describe the wrong outcome; a transactional outbox is one way to connect it to the committed change.
Give the events one contract
These events carry different properties, and some arrive without an authenticated identity or an HTTP context. To send them through the same file, we'll normalize what is available into a common record with flat fields that Wazuh rules can check directly. Put that contract in src/main/java/com/example/siem/SecurityAuditRecord.java:
package com.example.siem;
import com.fasterxml.jackson.annotation.JsonProperty;
public record SecurityAuditRecord(
@JsonProperty("schema_version") int schemaVersion,
@JsonProperty("event_id") String eventId,
String timestamp,
String service,
@JsonProperty("audit_event_type") EventType eventType,
Outcome outcome,
String principal,
@JsonProperty("source_ip") String sourceIp,
String method,
String path,
@JsonProperty("request_id") String requestId) {
public enum EventType {
AUTHENTICATION_SUCCESS, AUTHENTICATION_FAILURE, AUTHORIZATION_FAILURE, SENSITIVE_OPERATION_COMPLETED
}
public enum Outcome {
SUCCESS, FAILURE, DENIED
}
}The first version called the event field event_type, which Wazuh's built-in Suricata rules also recognize in JSON. Our records landed in Suricata grouping rule 86600 before reaching the application rules. Renaming it to audit_event_type let us keep the built-in JSON decoder and send the records through our own rules.
With the field names settled, the normalizer can supply IDs and a UTC timestamp and select the information we want to retain. Add src/main/java/com/example/siem/AuditNormalizer.java:
package com.example.siem;
import java.time.Instant;
import java.util.UUID;
import jakarta.enterprise.context.ApplicationScoped;
import io.quarkus.security.identity.SecurityIdentity;
import io.vertx.ext.web.RoutingContext;
@ApplicationScoped
public class AuditNormalizer {
private static final String REQUEST_ID = AuditNormalizer.class.getName() + ".request-id";
public SecurityAuditRecord normalize(SecurityAuditRecord.EventType type, SecurityIdentity identity,
RoutingContext context) {
String principal = null;
if (type != SecurityAuditRecord.EventType.AUTHENTICATION_FAILURE
&& identity != null && !identity.isAnonymous() && identity.getPrincipal() != null) {
principal = bounded(identity.getPrincipal().getName(), 128);
}
var outcome = switch (type) {
case AUTHENTICATION_FAILURE -> SecurityAuditRecord.Outcome.FAILURE;
case AUTHORIZATION_FAILURE -> SecurityAuditRecord.Outcome.DENIED;
default -> SecurityAuditRecord.Outcome.SUCCESS;
};
String source = null;
String method = null;
String path = null;
String requestId = UUID.randomUUID().toString();
if (context != null) {
synchronized (context) {
String existing = context.get(REQUEST_ID);
if (existing == null) {
context.put(REQUEST_ID, requestId);
context.response().putHeader("X-Audit-Request-ID", requestId);
} else {
requestId = existing;
}
}
var request = context.request();
if (request.remoteAddress() != null) {
source = bounded(request.remoteAddress().hostAddress(), 64);
}
method = request.method().name();
// Retain only the two known routes; arbitrary URLs can contain personal data.
path = switch (request.path()) {
case "/api/profile" -> "/api/profile";
case "/api/admin/export" -> "/api/admin/export";
default -> "<other>";
};
}
return new SecurityAuditRecord(1, UUID.randomUUID().toString(), Instant.now().toString(),
"quarkus-siem-demo", type, outcome, principal, source, method, path, requestId);
}
private static String bounded(String value, int limit) {
return value == null || value.length() <= limit ? value : value.substring(0, limit);
}
}A failed authentication leaves the principal null, even if a caller passes an identity to the normalizer. We haven't validated who sent that request, so decoding a claimed username from the Basic header would give the record an identity we cannot trust. The source address comes from the request's peer, with proxy address forwarding disabled. If you put this behind a proxy later, configure which proxies to trust before using the address to group failures.
We also generate the request ID on the server and reuse it for events from the same routing context. Returning it as X-Audit-Request-ID lets us follow the request through the local file and Wazuh; a client-supplied ID won't replace it. We keep only the two known paths and leave out query strings. Arbitrary paths can contain personal data just as request bodies can, so decide which route information to retain when you add endpoints.
Now we can pass the three framework events through that normalizer. Add their observers in src/main/java/com/example/siem/SecurityEventObserver.java:
package com.example.siem;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.context.ContextNotActiveException;
import jakarta.enterprise.event.Observes;
import jakarta.enterprise.inject.Instance;
import io.quarkus.security.spi.runtime.AuthenticationFailureEvent;
import io.quarkus.security.spi.runtime.AuthenticationSuccessEvent;
import io.quarkus.security.spi.runtime.AuthorizationFailureEvent;
import io.quarkus.security.spi.runtime.SecurityEvent;
import io.vertx.ext.web.RoutingContext;
import org.jboss.logging.Logger;
@ApplicationScoped
public class SecurityEventObserver {
private static final Logger LOG = Logger.getLogger(SecurityEventObserver.class);
private final AuditNormalizer normalizer;
private final AuditRecorder recorder;
private final Instance<RoutingContext> currentContext;
public SecurityEventObserver(AuditNormalizer normalizer, AuditRecorder recorder,
Instance<RoutingContext> currentContext) {
this.normalizer = normalizer;
this.recorder = recorder;
this.currentContext = currentContext;
}
void authenticationFailure(@Observes AuthenticationFailureEvent event) {
emit(SecurityAuditRecord.EventType.AUTHENTICATION_FAILURE, event);
}
void authenticationSuccess(@Observes AuthenticationSuccessEvent event) {
emit(SecurityAuditRecord.EventType.AUTHENTICATION_SUCCESS, event);
}
void authorizationFailure(@Observes AuthorizationFailureEvent event) {
emit(SecurityAuditRecord.EventType.AUTHORIZATION_FAILURE, event);
}
private void emit(SecurityAuditRecord.EventType type, SecurityEvent event) {
try {
recorder.record(normalizer.normalize(type, event.getSecurityIdentity(), routingContext(event)));
} catch (RuntimeException failure) {
LOG.warn("Security event normalization failed");
}
}
private RoutingContext routingContext(SecurityEvent event) {
Object context = event.getEventProperties().get(RoutingContext.class.getName());
if (context instanceof RoutingContext routingContext) {
return routingContext;
}
try {
return currentContext.isResolvable() ? currentContext.get() : null;
} catch (ContextNotActiveException unavailable) {
return null;
}
}
}The observer first looks for a RoutingContext in the event properties, where Quarkus can attach it under the context class name. If it isn't there, we try the current CDI context. Sometimes neither is available, and the normalizer then leaves the HTTP fields null so a security decision outside an HTTP request can still be recorded. The Quarkus security customization guide explains where these events are emitted.
The observers are synchronous, so serialization and logging add to request handling. If that processing fails, the observer and recorder catch their own errors and log a fixed warning. This keeps exception messages and event-property maps out of both logs and avoids an exception response that could expose request data. It also lets a request succeed without a retained audit event, a choice you'll need to revisit if every completed action must be audited.
Write one JSON object per line
Both the observer and export method pass their records to one recorder, where Jackson serializes them for the audit logger. Add src/main/java/com/example/siem/AuditRecorder.java:
package com.example.siem;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.enterprise.context.ApplicationScoped;
import org.jboss.logging.Logger;
@ApplicationScoped
public class AuditRecorder {
private static final Logger AUDIT = Logger.getLogger("com.example.siem.audit");
private static final Logger LOG = Logger.getLogger(AuditRecorder.class);
private final ObjectMapper mapper;
public AuditRecorder(ObjectMapper mapper) {
this.mapper = mapper;
}
public String serialize(SecurityAuditRecord record) throws JsonProcessingException {
return mapper.writer().without(com.fasterxml.jackson.databind.SerializationFeature.INDENT_OUTPUT)
.writeValueAsString(record);
}
public void record(SecurityAuditRecord record) {
try {
AUDIT.info(serialize(record));
} catch (JsonProcessingException | RuntimeException failure) {
// Do not include exception messages, event properties, or request credentials.
LOG.warn("Security audit emission failed");
}
}
}Wazuh reads this file one line at a time, so the writer disables indentation even if the application's shared mapper enables it. Jackson also escapes line breaks inside values, keeping a principal with a newline inside one JSON record. The fields we selected earlier leave passwords, tokens, cookies, raw bodies, query parameters and exception text out of the schema.
The logger still needs its own file handler, and our endpoints need their development identities. Set src/main/resources/application.properties to the companion configuration:
quarkus.application.name=quarkus-siem-demo
# Brings in the Compose deployment infrastructure; no LGTM stack is started.
quarkus.observability.enabled=false
quarkus.http.host=127.0.0.1
%dev.quarkus.http.port=8088
quarkus.http.proxy.proxy-address-forwarding=false
# Fake accounts exist only in development and test profiles.
%dev.quarkus.http.auth.basic=true
%test.quarkus.http.auth.basic=true
%dev.quarkus.security.users.embedded.enabled=true
%test.quarkus.security.users.embedded.enabled=true
%dev.quarkus.security.users.embedded.plain-text=true
%test.quarkus.security.users.embedded.plain-text=true
%dev.quarkus.security.users.embedded.users.alice=alice-dev-only
%test.quarkus.security.users.embedded.users.alice=alice-dev-only
%dev.quarkus.security.users.embedded.roles.alice=user
%test.quarkus.security.users.embedded.roles.alice=user
%dev.quarkus.security.users.embedded.users.operator=operator-dev-only
%test.quarkus.security.users.embedded.users.operator=operator-dev-only
%dev.quarkus.security.users.embedded.roles.operator=user,admin
%test.quarkus.security.users.embedded.roles.operator=user,admin
quarkus.log.handler.file.audit.enabled=true
quarkus.log.handler.file.audit.path=target/siem/security-events.jsonl
%test.quarkus.log.handler.file.audit.path=target/test-siem/security-events.jsonl
%prod.quarkus.log.handler.file.audit.path=target/prod-siem/security-events.jsonl
quarkus.log.handler.file.audit.format=%s%n
quarkus.log.handler.file.audit.rotation.max-file-size=10M
quarkus.log.handler.file.audit.rotation.max-backup-index=3
quarkus.log.handler.file.audit.rotation.rotate-on-boot=false
quarkus.log.category."com.example.siem.audit".level=INFO
quarkus.log.category."com.example.siem.audit".handlers=audit
quarkus.log.category."com.example.siem.audit".use-parent-handlers=false
%dev.quarkus.compose.devservices.enabled=${WAZUH_COMPOSE_ENABLED:true}
%dev.quarkus.compose.devservices.files=infra/wazuh/compose.yml
%dev.quarkus.compose.devservices.project-name=quarkus-wazuh-siem
%dev.quarkus.compose.devservices.startup-timeout=5m
%dev.quarkus.compose.devservices.stop-timeout=30s
%dev.quarkus.compose.devservices.remove-volumes=false
%dev.quarkus.compose.devservices.ryuk-enabled=false
%dev.quarkus.compose.devservices.env-variables.PODMAN_COMPOSE_PROVIDER=${PODMAN_COMPOSE_PROVIDER:docker-compose}
%test.quarkus.compose.devservices.enabled=falseThe account settings apply only to %dev and %test. When you package the application, it refuses these development identities; the companion's @QuarkusIntegrationTest checks that boundary. For production, replace the embedded accounts and Basic authentication with your identity provider. Basic sends reusable credentials in the request, and these sample accounts are stored directly in configuration.
The audit category sends its messages to a named file handler without propagating them to parent handlers. Its %s%n format writes the serialized JSON followed by a newline, so the file contains exactly the format Wazuh expects, without an application-log prefix or another JSON envelope. Rotation keeps each file around 10 MB and retains three backups. Test and production profiles use separate paths, and boot rotation is disabled so starting a packaged test won't rotate the dev application's open file.
Rotation bounds the local storage, but an old file can disappear before the collector has read all its records. We'll also keep Wazuh's state volumes on normal shutdown so previous alerts remain available after a restart, and only-future-events=no lets the manager reread retained input. That rereading can produce duplicates; these settings don't give us exactly-once delivery.
Let Wazuh collect and classify the stream
To let Wazuh read the file, the manager mounts ../../target/siem read-only at /var/log/quarkus. That host path is relative to infra/wazuh/compose.yml, which keeps the official manager, indexer and dashboard service names. We only need to reach the dashboard from the host, so it is published on 127.0.0.1:8443; the manager and indexer communicate over the internal Compose network.
The mount makes the file available inside the manager. To have its collector read the JSON lines, add this entry in infra/wazuh/config/wazuh_cluster/wazuh_manager.conf:
<localfile>
<location>/var/log/quarkus/security-events.jsonl</location>
<log_format>json</log_format>
<only-future-events>no</only-future-events>
</localfile>The image imports this configuration through /wazuh-config-mount/etc/ossec.conf and provides a corresponding import path for custom rules. This avoids binding individual rules over files in the manager's persistent /var/ossec/etc volume. The volume also retains existing rule files on restart, so editing a host file alone won't activate the change. Run the companion's reload-wazuh-config.sh to copy the versioned configuration into this sample's manager and restart its processes.
With collection configured, we can tell Wazuh which records should become alerts. Put the custom rules in infra/wazuh/rules/quarkus_rules.xml:
<group name="quarkus,application_security,">
<rule id="100100" level="0">
<decoded_as>json</decoded_as>
<field name="service" type="pcre2">^quarkus-siem-demo$</field>
<field name="schema_version" type="pcre2">^1$</field>
<description>Quarkus application security event</description>
</rule>
<rule id="100101" level="5">
<if_sid>100100</if_sid>
<field name="audit_event_type" type="pcre2">^AUTHENTICATION_FAILURE$</field>
<field name="outcome" type="pcre2">^FAILURE$</field>
<description>Quarkus authentication failed from $(source_ip)</description>
</rule>
<rule id="100102" level="8">
<if_sid>100100</if_sid>
<field name="audit_event_type" type="pcre2">^AUTHORIZATION_FAILURE$</field>
<field name="outcome" type="pcre2">^DENIED$</field>
<field name="path" type="pcre2">^/api/admin/export$</field>
<description>Quarkus admin export denied for $(principal)</description>
</rule>
<rule id="100103" level="10" frequency="5" timeframe="60">
<if_matched_sid>100101</if_matched_sid>
<field name="source_ip" type="pcre2">^(?!null$).+$</field>
<same_field>source_ip</same_field>
<description>Quarkus repeated authentication failures from $(source_ip)</description>
</rule>
<rule id="100104" level="3">
<if_sid>100100</if_sid>
<field name="audit_event_type" type="pcre2">^SENSITIVE_OPERATION_COMPLETED$</field>
<field name="outcome" type="pcre2">^SUCCESS$</field>
<field name="path" type="pcre2">^/api/admin/export$</field>
<description>Quarkus simulated admin export completed by $(principal)</description>
</rule>
</group>The level-zero parent first checks that a record belongs to our service and schema. Its children then look for failed authentication, denied administrative access and completed exports, while an ordinary authentication success doesn't produce an alert. Failed authentication gets level five, which also keeps it eligible for the correlation rule. That rule groups five matches within 60 seconds using the same dynamic source_ip field. Five failures from five different sources won't trigger it, and records without a source address are excluded too.
Treat that alert as a reason to investigate. A failed authentication can be an ordinary mistake, and several users behind a proxy can share the same peer address. Keep that context when choosing the source field and threshold for your application. Wazuh's rule syntax reference explains how if_matched_sid, frequency, timeframe and same_field combine.
Compose checks the manager's analysis and collection processes, Filebeat's connection to the indexer, the indexer's cluster status and the dashboard API during startup. Those checks let Quarkus wait for the services to become ready. To find out whether they are reading our file and applying our rules, we'll now send requests through the application and follow their alerts into the index.
Follow real requests into the index
Open a second terminal in the companion directory. We'll retrieve Alice's profile, try an invalid password, then request an export as Alice and as the operator:
curl -i -u alice:alice-dev-only http://127.0.0.1:8088/api/profile
curl -i -u alice:wrong-password http://127.0.0.1:8088/api/profile
curl -i -u alice:alice-dev-only -X POST http://127.0.0.1:8088/api/admin/export
curl -i -u operator:operator-dev-only -X POST http://127.0.0.1:8088/api/admin/exportYou should get 200, 401, 403 and 200, in that order. The invalid password produces an authentication-failure record with a null principal because the application couldn't validate the identity. Alice's denied export has a validated principal and an authorization-failure record: Quarkus knows who she is but rejects the operation because she lacks the role. The operator's request produces authentication success and a separate completion record. Follow these by request ID, since a request can produce more than one framework event.
Copy the server's X-Audit-Request-ID response header, then look for that ID in the current local file:
jq -c . target/siem/security-events.jsonlOnce you can see the JSON locally, check how Wazuh interprets it. You can pass a small failed-authentication record directly to logtest to inspect the decoder and rule match:
podman compose -p quarkus-wazuh-siem -f infra/wazuh/compose.yml \
exec -T wazuh.manager /var/ossec/bin/wazuh-logtest <<'JSON'
{"schema_version":1,"service":"quarkus-siem-demo","audit_event_type":"AUTHENTICATION_FAILURE","outcome":"FAILURE","source_ip":"192.0.2.10"}
JSONThis record matches custom rule 100101 at level five. Passing it directly to logtest lets us inspect the rule without appending anything to the application's file. To follow events from real HTTP requests through collection and indexing as well, run:
./scripts/simulate-attacks.sh
./scripts/verify-wazuh.shThe Java verifier sends fresh requests and follows their IDs through the manager's alert stream into the indexer search results. You'll find denied exports under rule 100102 at level eight, completed exports under 100104 at level three, and repeated failures under 100103 at level ten. It also sends sequences to separate logtest sessions, checking that the fifth failure from one source triggers correlation while failures from different sources do not.
The verifier then stops the manager, completes an export and starts it again. Quarkus still accepts the request and appends the event locally during that short interruption; after restart, the manager reads the retained record and the alert reaches the index. This depends on the file still being there. A host failure, a full disk or an outage beyond local retention can lose events.
To browse those alerts, open https://localhost:8443, review the self-signed certificate warning and sign in with admin / SecretPassword. In Threat hunting, choose a recent time range and search rule.groups:quarkus. You can also search data.request_id for an ID from target/wazuh-verification/receipt.json to follow one of the verifier's requests. Wazuh puts our application fields under data, including the principal. In this release it decodes a null principal as the string "null", so treat that value as an unknown identity.
Keep the local experiment's limits clear
The local file lets us recover from that short manager outage, but we still have to decide how much loss the application can tolerate. A synchronous handler doesn't put the event in the business transaction or promise durable storage. Moving the observer to an asynchronous path can shorten request handling while leaving another opportunity to lose events on abrupt shutdown. If every completed operation must have an audit record, use a durable log pipeline or a transactional outbox and define what the business operation should do when auditing fails.
Because the records contain identities and addresses, limit their contents and set retention and access controls. Event IDs can help a downstream process recognize replayed records, though this sample doesn't deduplicate Wazuh alerts. When interpreting correlation, remember that it groups events by ingestion timing and source identity; its count isn't a transactional count of failed requests.
When you've finished, press Ctrl+C in the dev terminal and let the stack stop. The named volumes remain for the next run so you can return to the alerts. To remove this sample's Wazuh state after dev mode has stopped, run:
./scripts/cleanup-wazuh.sh --resetThe reset leaves the local audit files and generated certificates in place, which means a new manager may reread the old input. Remove the sample's audit files separately if you want an empty event history. Wait until dev mode has stopped before using mvn clean too, because it removes the directory mounted into the manager.
You'll find the setup, configuration reload, rollover and cleanup commands in the companion README. The source is in The Main Thread repository, including the upstream provenance.
Trying Wazuh with Quarkus taught me to be more deliberate about what the application records: who was authenticated, which operation was denied and when a business action actually completed. OpenTelemetry can add context around those requests, while these explicit events give us the security history to collect and retain. Start with one action you need to investigate in your own application and follow it from the security decision to the indexed alert. You'll see which information the application needs to provide and where it could be lost along the way.


