Recheck the submitting principal and protect stored log output
This commit is contained in:
@@ -17,9 +17,10 @@ use std::collections::BTreeSet;
|
||||
use uuid::Uuid;
|
||||
|
||||
const PREFIX: &str = "rmm_mcp_";
|
||||
const SCOPES: [&str; 11] = [
|
||||
const SCOPES: [&str; 12] = [
|
||||
"inventory:read",
|
||||
"logs:read",
|
||||
"logs:read_sensitive",
|
||||
"operations:read",
|
||||
"operations:plan",
|
||||
"operations:submit",
|
||||
@@ -371,7 +372,7 @@ async fn authenticate_pool(
|
||||
name: principal,
|
||||
operator: effective
|
||||
.iter()
|
||||
.any(|scope| !READ_SCOPES.contains(&scope.as_str())),
|
||||
.any(|scope| !READ_SCOPES.contains(&scope.as_str()) && scope != "logs:read_sensitive"),
|
||||
session_hash: None,
|
||||
csrf: None,
|
||||
scopes: Some(effective),
|
||||
@@ -427,6 +428,7 @@ async fn enabled(pool: &PgPool, principal: &str, tenant: Uuid) -> bool {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
mod stored_logs;
|
||||
|
||||
#[test]
|
||||
fn mcp_token_selection_is_explicit_and_bounded() {
|
||||
|
||||
Reference in New Issue
Block a user