fix(pamsave): close credential and policy injection

- Require exact username matching when replacing PAM secrets.
- Confine policy staging and validate decoded TOML values.
- Add the validated password-substring exploit for Neo automation.
This commit is contained in:
TakuyaYagam1 committed 2026-11-29 13:09:03 +03:00
1 parent 2a9632774d
commit 96314809c8
5 files changed
+311 -41

No files matched your search

@@ -27,17 +27,15 @@ pub async fn create(
}
pam::validator::validate_raw(&req.content)?;
let compiled = pam::policy::compile(&req.content);
let compiled = pam::policy::compile(&req.content)?;
pam::deploy::stage(name, &req.content)?;
if let Ok(compiled) = &compiled {
for username in &compiled.external_rights {
pam::memberships::append(username, workspace_id)?;
}
for (username, file) in &compiled.file_rights {
pam::memberships::append_file_grant(username, workspace_id, file)?;
}
for username in &compiled.external_rights {
pam::memberships::append(username, workspace_id)?;
}
for (username, file) in &compiled.file_rights {
pam::memberships::append_file_grant(username, workspace_id, file)?;
}
let stored = AuthPolicyRepository::create(pool, workspace_id, name).await;