Skip to content

๐Ÿ›ก๏ธ Sentinel: [CRITICAL] ๊ด€๋ฆฌ์ž ์—”๋“œํฌ์ธํŠธ์— ์ธ์ฆ ๋ฐ ๊ถŒํ•œ ๋ถ€์—ฌ ์ถ”๊ฐ€ - #196

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

๐Ÿ›ก๏ธ Sentinel: [CRITICAL] ๊ด€๋ฆฌ์ž ์—”๋“œํฌ์ธํŠธ์— ์ธ์ฆ ๋ฐ ๊ถŒํ•œ ๋ถ€์—ฌ ์ถ”๊ฐ€#196
seonghobae wants to merge 1 commit into
mainfrom
sentinel-admin-auth-2248786916299986877

Conversation

@seonghobae

@seonghobae seonghobae commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Superseded by #172, the verified canonical implementation of per-endpoint admin:read and admin:write authorization. This duplicate is closed to keep one review and merge path.

AdminController์˜ ๋ชจ๋“  ์—”๋“œํฌ์ธํŠธ๊ฐ€ ์ธ์ฆ ์—†์ด ๋…ธ์ถœ๋˜์–ด ๋ชจ๋“  ์‚ฌ์šฉ์ž๊ฐ€ ์‹œ์Šคํ…œ ๋‚ด์˜ ์ „ํ™˜ ์ž‘์—…์„ ์ฝ๊ณ , ์‚ญ์ œํ•˜๊ณ , ์žฌ์‹œ๋„ํ•  ์ˆ˜ ์žˆ๋Š” ๋ณด์•ˆ ์ทจ์•ฝ์ ์„ ๋ฐœ๊ฒฌํ•˜์—ฌ ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.

- `TenantPermissions`์— `admin:read` ๋ฐ `admin:write` ์ƒ์ˆ˜ ์ถ”๊ฐ€
- `AdminController`์˜ ์ƒ์„ฑ์ž์— `TenantAccessService` ์ฃผ์ž… ๋ฐ ํ•„๋“œ ์ด๋ฆ„ ์ถฉ๋Œ ๋ฐฉ์ง€ (Checkstyle ๊ทœ์น™ ์ค€์ˆ˜)
- ๊ฐ API ์—”๋“œํฌ์ธํŠธ ์‹คํ–‰ ์ „ `tenantAccessSvc.require()` ํ˜ธ์ถœ์„ ํ†ตํ•ด ๊ถŒํ•œ ๊ฒ€์ฆ ์ ์šฉ
- `AdminControllerTest`๋ฅผ ์—…๋ฐ์ดํŠธํ•˜์—ฌ ์ƒˆ๋กœ ์ถ”๊ฐ€๋œ `TenantAccessService` ์˜์กด์„ฑ์„ ๋ชจ์˜(mock) ๊ฐ์ฒด๋กœ ์ฃผ์ž…
@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 review requested due to automatic review settings July 23, 2026 21:10

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

Adds tenant-claim authentication and explicit permission checks to AdminController admin endpoints to prevent unauthorized users from listing, retrying, or deleting conversion jobs.

Changes:

  • Guard /api/v1/admin/convert/jobs (read) and admin mutation endpoints (write) via TenantAccessService.require(...).
  • Introduce admin:read / admin:write permission constants in TenantPermissions.
  • Update controller construction in AdminControllerTest and record the incident in .jules/sentinel.md.

Reviewed changes

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

File Description
src/main/java/com/clearfolio/viewer/controller/AdminController.java Adds header-based auth and permission checks to admin job endpoints.
src/test/java/com/clearfolio/viewer/controller/AdminControllerTest.java Updates test wiring for the new AdminController constructor signature.
src/main/java/com/clearfolio/viewer/auth/TenantPermissions.java Adds admin permission constants (admin:read, admin:write).
.jules/sentinel.md Documents the admin-endpoint authorization miss and prevention guidance.

๐Ÿ’ก Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +109 to +111
tenantAccessService.require(headers, TenantPermissions.ADMIN_WRITE);
RetryDeadLetterResult result = conversionService.retryDeadLettered(
jobId, "admin");
Comment on lines 25 to 32
@BeforeEach
void setUp() {
conversionService = mock(DocumentConversionService.class);
controller = new AdminController(conversionService);
tenantAccessService = mock(TenantAccessService.class);
controller = new AdminController(conversionService, tenantAccessService);
webTestClient = WebTestClient.bindToController(controller)
.controllerAdvice(new ApiExceptionHandler())
.build();
Comment thread .jules/sentinel.md
Comment on lines 34 to +35
**Prevention:** Always enforce a strict, configurable size limit (e.g., `ConversionProperties.maxUploadSizeBytes`) within the `while` loop that reads from untrusted input streams. Track `totalRead` and throw an exception immediately if the limit is exceeded.
## 2026-07-23 - ๊ด€๋ฆฌ์ž ์—”๋“œํฌ์ธํŠธ ์ธ์ฆ ๋ฐ ๊ถŒํ•œ ๋ถ€์—ฌ ๋ˆ„๋ฝ ์ˆ˜์ •
@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