Problem Statement
The GET /admin/audit-logs endpoint (api/src/audit/admin-audit.controller.ts) has no authentication or authorization guard. Anyone can query the audit log, including user IDs, actions performed (login, password_change, stream_delete, role_change), and IP addresses.
Evidence
// api/src/audit/admin-audit.controller.ts — no @UseGuards decorator
@Controller("admin/audit-logs")
export class AdminAuditController {
@Get()
async findAll(@Query() query: PaginationQueryDto) { ... }
}
Impact
Unauthenticated access to audit logs exposes sensitive user activity data. IP addresses, login timestamps, and privileged action history are publicly accessible.
Proposed Solution
Add @UseGuards(RolesGuard) and @Roles("admin") decorators to the controller, matching the pattern used in AdminController.
Acceptance Criteria
File Map
api/src/audit/admin-audit.controller.ts — add guards
Labels: security, quick win
Priority: Medium | Difficulty: Beginner | Estimated Effort: 0.5h
Labels: security,quick win
Priority: Medium | Difficulty: Beginner | Estimated Effort: 0.5h
Backlog ID: REPO-031
Problem Statement
The
GET /admin/audit-logsendpoint (api/src/audit/admin-audit.controller.ts) has no authentication or authorization guard. Anyone can query the audit log, including user IDs, actions performed (login, password_change, stream_delete, role_change), and IP addresses.Evidence
Impact
Unauthenticated access to audit logs exposes sensitive user activity data. IP addresses, login timestamps, and privileged action history are publicly accessible.
Proposed Solution
Add
@UseGuards(RolesGuard)and@Roles("admin")decorators to the controller, matching the pattern used inAdminController.Acceptance Criteria
File Map
api/src/audit/admin-audit.controller.ts— add guardsLabels: security, quick win
Priority: Medium | Difficulty: Beginner | Estimated Effort: 0.5h
Labels: security,quick win
Priority: Medium | Difficulty: Beginner | Estimated Effort: 0.5h
Backlog ID: REPO-031