بنقرة واحدة
audit-auth
Audit authentication flow completeness — login, refresh, logout, session, RBAC, middleware.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Audit authentication flow completeness — login, refresh, logout, session, RBAC, middleware.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Scan for PII exposure in API responses, committed files, grimoires, and data flow paths.
Scan for secret leakage in env files, client code, git history, and build artifacts.
API endpoint security surface scan — auth gates, data exposure, rate limiting, input validation.
Map impact surface of a change or regression by tracing data flow through every consumer.
Generate defensive measure specifications from a PMR — test specs, types, error boundaries, checklists.
Create a structured Postmortem Record from an incident, mining git history and issues for timeline and blast radius.
| name | audit-auth |
| description | Audit authentication flow completeness — login, refresh, logout, session, RBAC, middleware. |
| user-invocable | true |
| allowed-tools | Read, Glob, Grep, Bash, Agent |
| triggers | ["audit auth","check auth flow","review authentication"] |
| capabilities | {"model_tier":"opus","danger_level":"safe","effort_hint":"medium"} |
Verify the auth system works end-to-end — every edge case, every flow.
Map every auth-related endpoint and middleware:
Build a flow diagram:
Login → Token Issued → Token Stored → Token Validated → Token Refreshed → Logout → Token Revoked
For each login method:
The critical test: After a user clicks "logout", can a captured refresh token still be used to get a new access token? If yes, logout is broken.
For each middleware that gates access:
user.role? user.tier? user.isAdmin?## Authentication Flow Audit
### Flow Map
[diagram of auth flows]
### Findings
| ID | Phase | Severity | Issue | File:Line | Fix |
|----|-------|----------|-------|-----------|-----|
### Token Lifecycle
| Token | Storage | Lifetime | Rotation | Revocation |
|-------|---------|----------|----------|------------|
### Middleware Chain
| Path | Middleware | Validates | Failure Mode |
|------|-----------|-----------|-------------|
### The Logout Test
- [ ] Capture refresh token before logout
- [ ] Click logout
- [ ] Try to use captured refresh token
- [ ] Expected: 401 (token blacklisted)
- [ ] Actual: [result]
These patterns were found in production codebases (constructs.network, 2026-03-14):
tier instead of role: Enterprise-tier users get admin access. Fix: always check user.role, never user.tier, for authorization decisions.