문제: 공개 경로 스냅숏(publicPathSnapshotTest)은 config/security.yml의 기본값 한 줄만 읽었다. 문서(docs/build.md, gates.md 「공개 경로·보안 체인」)는 보안 체인 전체를 지킨다고 했다. 그래서 둘이 검사를 지나갔다. - application-local.yml이 public-paths를 /api/healthcheck로 덮는다. - web-notification의 callback chain이 /internal/notification/callbacks/**를 anyRequest().permitAll()로 연다. actuator chain의 health·info·prometheus도 같다. docs/build.md는 지운 PublicPathSnapshotPlugin.java와 없는 updatePublicPathSnapshot 태스크를 승인 방법으로 적었다. 관리 포트도 문서와 compose가 갈렸다. 관리 포트가 컨테이너 loopback에 묶인 뒤(MANAGEMENT_SERVER_ADDRESS 기본 127.0.0.1) compose.yaml·dev lane의 127.0.0.1:9001 publish는 아무것도 답하지 않는 줄이 됐고, service-runtime README·Dockerfile은 Kubernetes 프로브가 닿는다고 적었다. dev lane은 원격 JMX(9999)를 인증·TLS 없이, jmxremote.host 없이 열었다(주석은 「localhost only」). 고른 방법: - 스냅숏에 두 절을 더한다. profile 파일이 public-paths를 리터럴로 덮으면 그 값, 모든 leaf 운영 코드에서 Spring Security를 import한 파일의 permitAll·securityMatcher 문장(파일 경로와 함께, 정렬). 그 소스와 baseline을 lane 입력으로 선언해 캐시가 변경을 놓치지 않게 했다. - 기동한 SecurityFilterChain의 matcher를 reflection으로 읽는 안은 버렸다. matcher가 Spring의 private 필드에 있어 버전마다 깨진다. 문장 글자만 보므로 상수로 만든 matcher의 값은 못 본다. 그 한계를 docs/build.md에 적었다. - 관리 포트 publish 줄과 dev lane JMX를 지웠다. 컨테이너 안에서 읽는 명령 (docker compose exec app wget …, jcmd)을 주석에 적었다. Kubernetes는 MANAGEMENT_SERVER_ADDRESS를 바꾸거나 sidecar로 읽어야 한다고 service-runtime README·Dockerfile·docs/build.md에 적었다. 위험·한계: 파생 서비스가 자기 chain이나 profile 덮어쓰기를 두었다면 merge 뒤 스냅숏이 실패한다. 읽고 승인하면 된다(upgrade 안내 1). dev lane에서 원격 JMX로 보던 사람은 jcmd로 바꾼다(안내 4). 검증(desktop, --no-build-cache): - RED: 기준 a7e38c10에 permitAll chain을 더한 탐침 트리에서 기존 publicPathSnapshotTest가 통과했다(rc=0) — 틈이 있다. - GREEN: spotlessApply 뒤 :app-bootstrap:test --tests '*PublicPathSnapshotTest' (새 렌더링 시험 둘), :app-bootstrap:publicPathSnapshotTest, repositoryContractTest, spotlessCheck, :verifyComposeProfiles(18 lane) — 67건 실패 0, skip 1, rc=0. - 변이: 새 스냅숏을 커밋한 트리에서 callback chain의 securityMatcher를 "/internal/**"로 넓히면 publicPathSnapshotTest가 실패한다. BREAKING CHANGE: 공개 경로 스냅숏이 profile 덮어쓰기와 모든 모듈의 permitAll·securityMatcher 문장을 본다. compose가 관리 포트 9001과 dev lane JMX 9999를 publish하지 않는다. 할 일은 docs/upgrade/2026-11-round9-public-surface.md.
16 lines
1.7 KiB
Plaintext
16 lines
1.7 KiB
Plaintext
# feature-security-operational-baseline D5 — deny-by-default public path snapshot.
|
|
# SSOT: app.security.public-paths default in src/bootstrap/app/src/main/resources/config/security.yml
|
|
# -> SecurityConfig permitAll(); anyRequest authenticated. An operator's own SECURITY_PUBLIC_PATHS
|
|
# overrides it at run time and is outside this snapshot.
|
|
# Update only after review with: ./gradlew verifyPublicPathSnapshot -PapprovePublicPathChange
|
|
/v1/healthcheck
|
|
# Profile overrides of app.security.public-paths
|
|
profile local: /api/healthcheck
|
|
# Filter-chain statements that permit requests without authentication
|
|
src/adapter/inbound/web-notification/src/main/java/dev/caskeleton/adapter/inbound/web/notification/platform/callback/CallbackMvcSecurityConfiguration.java: .authorizeHttpRequests(requests -> requests.anyRequest().permitAll())
|
|
src/adapter/inbound/web-notification/src/main/java/dev/caskeleton/adapter/inbound/web/notification/platform/callback/CallbackMvcSecurityConfiguration.java: return http.securityMatcher("/internal/notification/callbacks/**")
|
|
src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/auth/SecurityConfig.java: auth.dispatcherTypeMatchers(DispatcherType.ERROR).permitAll();
|
|
src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/auth/SecurityConfig.java: auth.requestMatchers(publicPaths).permitAll();
|
|
src/bootstrap/service-runtime/src/main/java/dev/caskeleton/composition/runtime/management/security/ManagementSecurityConfig.java: .requestMatchers(EndpointRequest.to("health", "info", "prometheus")) .permitAll()
|
|
src/bootstrap/service-runtime/src/main/java/dev/caskeleton/composition/runtime/management/security/ManagementSecurityConfig.java: http.securityMatcher(EndpointRequest.toAnyEndpoint())
|