Skip to content

rrezartprebreza/spring-boot-skills / skills/spring-boot-3/security-audit-logging

security-audit-logging

Verified

Use when designing or reviewing security audit events, their redaction, durable storage, integrity, or failure policies in Spring Boot. General metrics and debugging logs belong to production observability rather than this security-event workflow.

FileKindSize
SKILL.mdskill md4.6 KB
agents/openai.yamlconfig270 B
examples/bad-audit.mdmarkdown358 B
examples/good-audit.mdmarkdown567 B
templates/SecurityAuditRecord.javaother1.2 KB

templates/SecurityAuditRecord.java

View on GitHub
package com.example.securityaudit;

import java.time.Instant;
import java.util.Objects;
import java.util.UUID;
import java.util.regex.Pattern;

public record SecurityAuditRecord(
        UUID eventId, Instant occurredAt, UUID actorId, UUID tenantId,
        Action action, UUID targetId, Outcome outcome, String correlationId) {
    public enum Action { AUTHENTICATION, DOCUMENT_READ, ROLE_CHANGE, DATA_EXPORT }
    public enum Outcome { ATTEMPTED, DENIED, SUCCESS, FAILURE }

    private static final Pattern CORRELATION_ID = Pattern.compile("[A-Za-z0-9._-]{1,64}");

    public SecurityAuditRecord {
        Objects.requireNonNull(eventId);
        Objects.requireNonNull(occurredAt);
        Objects.requireNonNull(action);
        Objects.requireNonNull(outcome);
        if (correlationId == null || !CORRELATION_ID.matcher(correlationId).matches()) {
            throw new IllegalArgumentException("Invalid correlation ID");
        }
        // Nullable identities support unauthenticated attempts, not unverified caller claims.
        if (outcome == Outcome.SUCCESS && (actorId == null || tenantId == null)) {
            throw new IllegalArgumentException("Successful events require verified actor and tenant");
        }
    }
}
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall