Skip to content

🛡️ Sentinel: [CRITICAL] Fix missing authentication on admin endpoints - #188

Closed
seonghobae wants to merge 1 commit into
mainfrom
sentinel-admin-auth-fix-12171087366901364655
Closed

🛡️ Sentinel: [CRITICAL] Fix missing authentication on admin endpoints#188
seonghobae wants to merge 1 commit into
mainfrom
sentinel-admin-auth-fix-12171087366901364655

Conversation

@seonghobae

@seonghobae seonghobae commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Superseded by #172, the canonical admin authorization PR. #172 applies separate read/write permissions to all admin endpoints and has successful exact-head CI and security checks.

- AdminController의 모든 엔드포인트에 인증 및 권한 확인 로직(TenantAccessService) 추가
- `ADMIN_READ`, `ADMIN_WRITE` 권한 요구되도록 수정
- 관련 테스트 코드 수정 및 100% 테스트 커버리지 유지
- `.jules/sentinel.md`에 보안 관련 지식 기록
Copilot AI review requested due to automatic review settings July 21, 2026 21:34
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a critical security gap by enforcing tenant-claim authentication and permission checks on AdminController endpoints, aligning admin routes with the rest of the API’s TenantAccessService-based access control model.

Changes:

  • Inject TenantAccessService into AdminController and require admin:read / admin:write permissions on admin endpoints.
  • Introduce new permission constants ADMIN_READ and ADMIN_WRITE in TenantPermissions.
  • Update AdminControllerTest to send tenant/auth headers on admin requests and document the incident in .jules/sentinel.md.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
src/main/java/com/clearfolio/viewer/controller/AdminController.java Adds header-based auth enforcement via TenantAccessService.require(...) on admin endpoints.
src/main/java/com/clearfolio/viewer/auth/TenantPermissions.java Adds ADMIN_READ / ADMIN_WRITE permission constants used by the controller guard.
src/test/java/com/clearfolio/viewer/controller/AdminControllerTest.java Adds auth headers to requests after controller signature change (but currently doesn’t assert guard enforcement).
.jules/sentinel.md Records the “missing authentication on admin endpoints” vulnerability and prevention guidance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 51 to 53
.uri("/api/v1/admin/convert/jobs")
.headers(AdminControllerTest::addAuth)
.exchange()
Comment on lines 69 to 72
webTestClient.get()
.uri("/api/v1/admin/convert/jobs?deadLettered=true")
.headers(AdminControllerTest::addAuth)
.exchange()
Comment on lines 87 to 90
webTestClient.get()
.uri("/api/v1/admin/convert/jobs?deadLettered=false")
.headers(AdminControllerTest::addAuth)
.exchange()
Comment on lines 101 to 106
webTestClient.delete()
.uri("/api/v1/admin/convert/jobs/" + jobId)
.headers(AdminControllerTest::addAuth)
.exchange()
.expectStatus().isNoContent();
}
Comment on lines 113 to 118
webTestClient.post()
.uri("/api/v1/admin/convert/jobs/" + jobId + "/retry")
.headers(AdminControllerTest::addAuth)
.exchange()
.expectStatus().isAccepted();
}
Comment on lines 125 to 130
webTestClient.post()
.uri("/api/v1/admin/convert/jobs/" + jobId + "/retry")
.headers(AdminControllerTest::addAuth)
.exchange()
.expectStatus().isNotFound();
}
Comment on lines 137 to 142
webTestClient.post()
.uri("/api/v1/admin/convert/jobs/" + jobId + "/retry")
.headers(AdminControllerTest::addAuth)
.exchange()
.expectStatus().isEqualTo(409); // isConflict() isn't always available depending on spring-test version, so using isEqualTo(409) is safer
}
@seonghobae seonghobae closed this Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants