Documentation
¶
Overview ¶
Package authz holds the authentication and access-control checks. Like dast, it is a SKELETON: metadata, modes, standards mapping and remediation are complete; the testing logic is a stub for you to implement. The same rules apply — every request through core.HTTPClient(ctx), test accounts only, non-destructive, honor the declared Mode().
Access-control checks (IDOR, privilege escalation) need two configured test identities to compare what each may reach. That surface now exists (scout.WithTestIdentities / core.Target.Identities); IDOR uses it. Supply disposable test accounts only — never real user accounts.
JWT checks inspect a token the operator supplies (passive analysis of its header/claims) — not a brute force. "Weak secret" cracking is out of scope here; detect alg:none, missing/!verified signature and missing expiry.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var RemediationCORS = core.Remediation{ What: "The server reflects arbitrary origins (or uses '*') while allowing credentials.", Why: "A malicious site can make authenticated cross-origin requests and read the responses, stealing data on behalf of a logged-in user.", How: []core.Fix{{Stack: "generic", Language: "text", Code: "Allowlist specific trusted origins; never combine Access-Control-Allow-Credentials: true with a reflected or wildcard origin."}}, Effort: core.EffortS, References: []string{"https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS"}, }
var RemediationIDOR = core.Remediation{ What: "An object is served based on an ID in the request without checking the caller owns it.", Why: "An attacker changes an ID in the URL or body to read or modify other users' data.", How: []core.Fix{{Stack: "generic", Language: "text", Code: "Enforce an ownership/role check on every object access, server-side; prefer unguessable IDs but never rely on them for authorization."}}, Effort: core.EffortM, References: []string{"https://owasp.org/Top10/A01_2021-Broken_Access_Control/"}, }
var RemediationJWT = core.Remediation{ What: "A JSON Web Token accepts an unsafe algorithm, is not signature-verified, or never expires.", Why: "alg:none or unverified signatures let an attacker forge tokens and impersonate any user; tokens without expiry stay valid forever if stolen.", How: []core.Fix{{Stack: "generic", Language: "text", Code: "Pin the expected algorithm (reject 'none'), always verify the signature with the server key, set a short 'exp', and rotate signing keys."}}, Effort: core.EffortM, References: []string{"https://cheatsheetseries.owasp.org/cheatsheets/JSON_Web_Token_for_Java_Cheat_Sheet.html"}, }
var RemediationMassAssignment = core.Remediation{ What: "An endpoint binds request fields straight onto a model, including fields the user should not set.", Why: "An attacker adds a field such as a role or account flag to escalate privileges or tamper with data.", How: []core.Fix{{Stack: "generic", Language: "text", Code: "Bind to an explicit allowlist DTO of editable fields; never bind untrusted input directly onto persistent models."}}, Effort: core.EffortM, References: []string{"https://cheatsheetseries.owasp.org/cheatsheets/Mass_Assignment_Cheat_Sheet.html"}, }
var RemediationMissingAuth = core.Remediation{ What: "An endpoint that exposes protected functionality or data has no authentication.", Why: "Anyone can call it directly, bypassing the app's login entirely.", How: []core.Fix{{Stack: "gin", Language: "go", Code: "// Apply auth middleware to the protected group, not per-handler ad hoc:\nprotected := r.Group(\"/api\", AuthRequired())\nprotected.GET(\"/account\", accountHandler)"}}, Effort: core.EffortM, References: []string{"https://owasp.org/Top10/A01_2021-Broken_Access_Control/"}, }
Functions ¶
Types ¶
type MassAssignment ¶
type MassAssignment struct{}
func (MassAssignment) Category ¶
func (MassAssignment) Category() core.Category
func (MassAssignment) Description ¶
func (MassAssignment) Description() string
func (MassAssignment) ID ¶
func (MassAssignment) ID() string
func (MassAssignment) Mode ¶
func (MassAssignment) Mode() core.Mode
func (MassAssignment) OWASP ¶
func (MassAssignment) OWASP() []string
type MissingAuth ¶
type MissingAuth struct{}
func (MissingAuth) Category ¶
func (MissingAuth) Category() core.Category
func (MissingAuth) Description ¶
func (MissingAuth) Description() string
func (MissingAuth) ID ¶
func (MissingAuth) ID() string
func (MissingAuth) Mode ¶
func (MissingAuth) Mode() core.Mode
func (MissingAuth) OWASP ¶
func (MissingAuth) OWASP() []string