8 Rules. Zero False Positives.
Each rule is purpose-built for API authorization patterns. No generic scanning - just targeted detection for real security issues.
AP001: Unintentional Public Access
Detects endpoints that are accessible without authentication but lack an explicit [AllowAnonymous] attribute.
This forces developers to make intentional decisions about public access. Every public endpoint should have explicit documentation of its intent.
AP002: Anonymous Write Operations
Catches [AllowAnonymous] on POST, PUT, DELETE, and PATCH operations.
Anonymous write access is almost never intentional. This rule prevents accidental exposure of data modification endpoints.
AP003: Authorization Conflicts
Detects when action-level [AllowAnonymous] overrides controller-level [Authorize].
This pattern often indicates copy-paste errors or incomplete refactoring. It creates security holes in otherwise protected controllers.
AP004: Missing Auth on Writes
The most critical rule: public write operations without any authorization attributes. This is your last line of defense.
Write operations (POST, PUT, DELETE, PATCH) should always have explicit authorization. No exceptions.
AP005: Role Sprawl
Flags endpoints with 3 or more roles assigned. This is a code smell indicating that policy-based authorization might be a better fit.
Excessive role requirements make code harder to maintain and reason about. Consider consolidating into policies.
AP006: Weak Role Names
Detects generic roles like "User", "Admin", "Guest", and "Manager". These names don't convey specific permissions.
Descriptive role names like "OrderManager" or "ReportViewer" make authorization logic self-documenting.
AP007: Sensitive Routes Exposed
Flags public routes containing sensitive keywords like /admin, /debug, /export, /config.
The keyword list is customizable via configuration. Add your own patterns to match your application's conventions.
AP008: Minimal API Gaps
Detects Minimal API endpoints missing .RequireAuthorization() method chains.
Full support for modern .NET patterns including route groups and endpoint filters.
Ready to secure your API?
Install ApiPosture and run your first scan in under 60 seconds.