swarm-secret-client: agents may list their own subtree; controller rewrites agent policies
render_agent gains a second stanza: list on secret/metadata/swarm/agents/<agent>/*, next to the existing read on secret/data/swarm/agents/<agent>/*. An agent can now learn which credentials it holds by listing its own subtree. Metadata read, writes and every other principal's paths stay refused. An agent's policy was only written when it was minted, so existing agents would never get the new stanza. swarm-controller now rewrites every agent's policy at start (read_policy::ensure_agent_policies), with the same 30s / 24h retry as ensure_hive_access. The roster is the store's hive-agent-* cert-auth roles, listed with the controller's existing `list` on auth/cert/certs; the writes use its existing grant on sys/policies/acl/hive-*. Only the policy is written: mint_and_verify also reissues the certificate, so the pass does not call it. Refs #4348
This commit is contained in:
parent
4e8225c058
commit
e04616eb70
5 changed files with 204 additions and 43 deletions
|
|
@ -2836,6 +2836,9 @@ async fn main() -> Result<()> {
|
|||
// abandoned, since the two of them boot together.
|
||||
let hive_names: Vec<String> = hives.iter().map(|h| h.name.clone()).collect();
|
||||
read_policy::ensure_hive_access(hive_names).await;
|
||||
// Agents keep the policy they were minted with until this rewrites it, so
|
||||
// what `policy::render_agent` grants today reaches them only from here.
|
||||
read_policy::ensure_agent_policies().await;
|
||||
|
||||
let state = AppState {
|
||||
hives: Arc::new(hives),
|
||||
|
|
|
|||
Loading…
Reference in a new issue