Przejdź do treści
Biblioteka skilli
Bezpieczeństwo · Przegląd i audyt

security-audit-logging

/security-audit-logging

Projektuje lub przegląda zdarzenia bezpieczeństwa w Spring Boot: redakcję, trwały zapis i politykę awarii.

Licencja
MIT
Ostatnia zmiana repozytorium
11.11.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
5
Skrypty
1
Komentarze HTML
0
Adresy URL w SKILL.md
3
Przestarzałość

Brak sygnałów. Repozytorium zmienione 11.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co sprawdzić przed instalacją
  • 1 skrypt w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.

Skrypty: templates/SecurityAuditRecord.java

Co robi i kiedy

Projektuje lub przegląda zdarzenia bezpieczeństwa w Spring Boot: redakcję, trwały zapis i politykę awarii.

Oryginalny opis (EN)

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.

Jak działa

  1. Version boundary
  2. Event contract
  3. Delivery and access policy
  4. Verification and output
  5. Gotchas
  6. Official sources
Sekcje z nagłówków SKILL.md, w oryginale · 72 linii, 563 słów
Podgląd SKILL.md
---
name: security-audit-logging
description: >
  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.
---

# Security Audit Logging

## Version boundary

Target Spring Boot 4 with Spring Framework 7 and Spring Security 7. Check the selected release's Actuator audit APIs before wiring listeners.
The shipped Java 17 record has no Boot/Jackson dependency and is shared across both trees.

## Event contract

Choose events needed for the requested security or business requirement: authentication
decisions, access denial, privilege changes, sensitive exports and administrative actions.
Separate attempted, denied, successful and failed operations. Do not log SUCCESS before
the authoritative transaction commits.

Prefer typed fields: event ID, UTC time, verified actor ID, tenant ID, action, target ID,
outcome and server-generated correlation ID. Unauthenticated events may have no actor;
do not mislabel a supplied username as verified identity. Record only identifiers needed
for the investigation, with controlled access and retention.

[SecurityAuditRecord](templates/SecurityAuditRecord.java) demonstrates bounded typed fields
and a restricted correlation identifier. It intentionally has no arbitrary message, headers,
token, request body or exception field. This is an event contract, not a durable audit sink.
Use a structured serializer, never concatenate JSON or interpolate untrusted text into lines.
The sample assumes tenant-scoped operations and UUID identities. Adapt those types and the
success invariant to the application's actual identity model; do not invent tenants for a
single-tenant system. Correlation IDs must be server-generated, not arbitrary caller text.

## Delivery and access policy

- Keep credentials, cookies, bearer tokens, passwords, session secrets, sensitive prompts,
  private documents and full configuration out of audit records. Sanitize controls and bound
  any separately approved free-text fields. Hashing arbitrary identifiers is not automatic anonymization.
- Spring Boot's in-memory audit repository is for development, not durable evidence.
  Authentication events alone do not capture every business authorization decision.
- For committed mutations requiring durable audit, use an atomic outbox alongside the business
  transaction. Deliver idempotently by event ID; handle duplicate delivery, backpressure, retention
  and retries. An after-commit listener can still lose events on process failure.
- Explicitly choose failure behavior by operation. A required audit write may need to prevent
  a privileged mutation; optional read-event loss may instead trigger bounded buffering and alerts.
  Do not globally fail every request or silently drop required audit events.
- Separate application write permissions from investigator read and retention/delete permissions.
  Define export controls, clock synchronization, access auditing and integrity checks.
  Append-only configuration alone is not proof of tamper resistance.
- Do not publish Actuator auditevents, env or configprops to solve an investigation.
  Collection and external export require approved scope and a redacted handoff.

## Verification and output

Exercise malformed/oversized correlation IDs, missing fields, all outcomes and stable event IDs.
The local fixture tests record construction, not a production logging backend.
Application integration tests must also prove rollback emits no committed-success event,
outbox retry deduplicates, and sink failures follow the selected policy.

Provide a field inventory, access/retention policy, delivery semantics, failure matrix and
tests run. Label evidence **confirmed**, **suspected**, or **not verified** rather than
claiming compliance from the mere presence of log statements.
See [good design](examples/good-audit.md) and [bad design](examples/bad-audit.md).

## Gotchas

- Agent logs request headers or principal.toString - select typed non-secret identifiers.
- Agent writes SUCCESS before commit - tie success evidence to the committed operation.
- Agent uses in-memory events as a production ledger - choose durable, access-controlled storage.
- Agent swallows sink failures - implement the operation's documented audit failure policy.

## Official sources

- [Boot auditing](https://docs.spring.io/spring-boot/reference/actuator/auditing.html)
- [OWASP logging guidance](https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html)
- [Spring transaction-bound events](https://docs.spring.io/spring-framework/reference/data-access/transaction/event.html)
Pliki w paczce (5)
  • SKILL.md 5 KB
  • agents/openai.yaml 1 KB
  • examples/bad-audit.md 1 KB
  • examples/good-audit.md 1 KB
  • templates/SecurityAuditRecord.java 1 KB

Wersje

RepozytoriumWynikLicencja
Ta strona · rrezartprebreza/spring-boot-skills100MIT
rrezartprebreza/spring-boot-skills100MIT

Migawka bazy z 13.11.2026 · wersja paczki 012a1d9ce70d (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100spring-boot-security
    Konfiguruje Spring Security 6+ z Lambda DSL, JWT i regułami hardeningu, także dla OAuth2.
  • 100304-frameworks-spring-boot-security
    Projektuje i sprawdza bezpieczeństwo aplikacji Spring Boot: filtry, OAuth2 i JWT, CSRF, CORS, nagłówki i bezpieczne logowanie.
  • 100java-security
    Opisuje wzorce bezpieczeństwa Java i Spring Boot: Spring Security, audyt zależności, praktyki bezpiecznego kodowania i OWASP dla ekosystemu Javy.
  • 100spring-security
    Wspiera uwierzytelnianie JWT w Spring Security dla Spring Boot 3: SecurityFilterChain, filtr JWT, autoryzacja, CORS, limity zapytań i nagłówki bezpieczeństwa.
  • 100spring-boot-observability
    Instrumentuje Spring Boot metrykami Micrometer, rozproszonym śledzeniem i logowaniem strukturalnym.
  • 100spring-boot-security-jwt
    Wspiera uwierzytelnianie i autoryzację JWT w Spring Boot 3.5.x: generowanie tokenów w JJWT, Bearer i cookie, integrację z bazą i OAuth2 oraz RBAC w Spring Security 6.x.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.