sha174n commented on code in PR #40503:
URL: https://github.com/apache/superset/pull/40503#discussion_r3324685831


##########
AGENTS.md:
##########
@@ -52,6 +52,37 @@ Common pre-commit failures:
 - **External API exposure** - Use UUIDs in public APIs instead of internal 
integer IDs
 - **Existing models** - Add UUID fields alongside integer IDs for gradual 
migration
 
+## Security and Threat Model
+
+Before evaluating any code path for security issues, read 
[`SECURITY.md`](SECURITY.md). It is the canonical, authoritative source for 
Apache Superset's security model and is referenced by both human reporters and 
automated scanners.
+
+In short, the test for whether a finding is in scope is one question:
+
+> *Does it let a principal perform an action the role and capability matrix in 
`SECURITY.md` does not entitle them to?*
+
+If yes, it is in scope. If no, it is not.
+
+The three trust boundaries are:
+
+1. **The Admin role** is a fully trusted operational principal. Anything an 
Admin can do through documented configuration, API, or UI is an intended 
capability, not a vulnerability.
+2. **The operator** owns deployment-time decisions (secrets, network exposure, 
feature-flag selection, connector and codec choices, notification destinations, 
third-party plugins). Misconfiguration at this layer is a deployment defect, 
not a Superset vulnerability.
+3. **The codebase** is responsible for enforcing the role and capability 
matrix wherever it exposes functionality to a principal: API routes, command 
and DAO layers, UI handlers, background jobs, and any other entry point. A 
missing or incorrect enforcement check is in scope no matter where it lives.
+
+The security model assumes that operator-controlled infrastructure, including 
the metadata database, cache backends, message brokers, secret stores, and 
deployment environment, remains within the operator's trust boundary. 
Vulnerabilities must demonstrate a security boundary violation by an attacker 
who does not already control those systems.
+
+The canonical authorization pattern in this codebase is `@has_access_api` 
(Flask-AppBuilder) at the route level plus 
`security_manager.raise_for_access(...)` at the object level, with DAO 
`base_filters` where listing is involved. Code following both gates is not a 
finding **on authorization grounds** by itself; code that omits the per-object 
gate on a route that returns or mutates a specific object is. Code following 
both gates can still contain injection, SSRF, XSS, or other classes of finding 
unrelated to authorization, which are evaluated separately.

Review Comment:
   Replaced the single-decorator line with the three-decorator list (@protect 
for REST API routes, @has_access_api for legacy view routes, @has_access for 
legacy HTML view routes) in 7059a86.



##########
AGENTS.md:
##########
@@ -52,6 +52,37 @@ Common pre-commit failures:
 - **External API exposure** - Use UUIDs in public APIs instead of internal 
integer IDs
 - **Existing models** - Add UUID fields alongside integer IDs for gradual 
migration
 
+## Security and Threat Model
+
+Before evaluating any code path for security issues, read 
[`SECURITY.md`](SECURITY.md). It is the canonical, authoritative source for 
Apache Superset's security model and is referenced by both human reporters and 
automated scanners.
+
+In short, the test for whether a finding is in scope is one question:
+
+> *Does it let a principal perform an action the role and capability matrix in 
`SECURITY.md` does not entitle them to?*
+
+If yes, it is in scope. If no, it is not.
+
+The three trust boundaries are:
+
+1. **The Admin role** is a fully trusted operational principal. Anything an 
Admin can do through documented configuration, API, or UI is an intended 
capability, not a vulnerability.
+2. **The operator** owns deployment-time decisions (secrets, network exposure, 
feature-flag selection, connector and codec choices, notification destinations, 
third-party plugins). Misconfiguration at this layer is a deployment defect, 
not a Superset vulnerability.
+3. **The codebase** is responsible for enforcing the role and capability 
matrix wherever it exposes functionality to a principal: API routes, command 
and DAO layers, UI handlers, background jobs, and any other entry point. A 
missing or incorrect enforcement check is in scope no matter where it lives.
+
+The security model assumes that operator-controlled infrastructure, including 
the metadata database, cache backends, message brokers, secret stores, and 
deployment environment, remains within the operator's trust boundary. 
Vulnerabilities must demonstrate a security boundary violation by an attacker 
who does not already control those systems.
+
+The canonical authorization pattern in this codebase is `@has_access_api` 
(Flask-AppBuilder) at the route level plus 
`security_manager.raise_for_access(...)` at the object level, with DAO 
`base_filters` where listing is involved. Code following both gates is not a 
finding **on authorization grounds** by itself; code that omits the per-object 
gate on a route that returns or mutates a specific object is. Code following 
both gates can still contain injection, SSRF, XSS, or other classes of finding 
unrelated to authorization, which are evaluated separately.
+

Review Comment:
   Adopted your suggested carveout in 7059a86: raise_for_access is scoped to 
data-bearing resources, and annotations/tags/CSS templates/reports/RLS rules 
explicitly call out route-level decorator + DAO base_filters as the by-design 
pattern.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to