Skip to content

Commit

Permalink
feat: add tools space access policy in system
Browse files Browse the repository at this point in the history
  • Loading branch information
GraceRuan committed Aug 13, 2024
1 parent 5ce43ab commit dba3681
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
14 changes: 14 additions & 0 deletions config/templates/system/kv-tools-read.hcl.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Write policy for tools space
# Scope: apps/data/tools access

path "<%= secretKvPath %>/data/tools/+/+" {
capabilities = ["read"]
}

path "<%= secretKvPath %>/metadata/tools/+/+" {
capabilities = ["read", "list"]
}

path "<%= secretKvPath %>/config" {
capabilities = ["read"]
}
1 change: 1 addition & 0 deletions config/templates/system/kv-tools-read.name.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<%= secretKvPath %>-kv-tools-read
6 changes: 6 additions & 0 deletions src/vault/policy-roots/impl/system-policy.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ export class SystemPolicyService implements PolicyRootService<undefined> {
templateName: 'kv-developer',
data: { secretKvPath },
});
if (secretKvPath == 'apps')
kvSpecs.push({
group: VAULT_ROOT_SYSTEM,
templateName: 'kv-tools-read',
data: { secretKvPath },
});
}
return kvSpecs;
}
Expand Down

0 comments on commit dba3681

Please sign in to comment.