Skip to content

Commit 5129ca9

Browse files
authored
Feat/broker policy additions (#73)
* feat: add tools path update for kv * feat: Improve templating * feat: Improve templates * chore: update dependencies * fix: individual app broker tools secret create/patch
1 parent d8a2fdf commit 5129ca9

12 files changed

+131
-94
lines changed

README-dev.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ See: [Oclif CLI](https://oclif.io)
2323
podman build . -t vsync
2424
```
2525

26+
The built container can be substituted for the released container when running locally with NR Broker.
27+
2628
## Hashicorp Vault Setup for local testing
2729

2830
### With NR Broker

config/templates/apps/app-auth.hcl.tpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,10 @@ path "auth/<%= authMount %>/role/<%= project %>_<%= application %>_<%= environme
88
path "auth/<%= authMount %>/role/<%= project %>_<%= application %>_<%= environment %>/secret-id" {
99
capabilities = ["update"]
1010
}
11+
12+
path "<%= secretKvPath %>/subkeys/tools/<%= project %>/<%= application %>" {
13+
capabilities = ["read"]
14+
}
15+
path "<%= secretKvPath %>/data/tools/<%= project %>/<%= application %>" {
16+
capabilities = ["create", "update", "patch"]
17+
}

config/templates/apps/app-kv-read.hcl.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Scope: Approle
33

44
<% if (appCanReadProject) { %>
5-
path "apps/metadata/<%= environment %>/<%= project %>/shared" {
5+
path "<%= secretKvPath %>/metadata/<%= environment %>/<%= project %>/shared" {
66
capabilities = ["read", "list"]
77
}
88

config/templates/apps/app-kv-write.hcl.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
# Scope: Approle
33

44
path "<%= secretKvPath %>/data/<%= environment %>/<%= project %>/<%= application %>" {
5-
capabilities = ["create", "update", "delete"]
5+
capabilities = ["create", "update", "patch", "delete"]
66
}
77

88
path "<%= secretKvPath %>/data/<%= environment %>/<%= project %>/<%= application %>/+" {
9-
capabilities = ["create", "update", "delete"]
9+
capabilities = ["create", "update", "patch", "delete"]
1010
}
1111

1212
path "<%= secretKvPath %>/metadata/<%= environment %>/<%= project %>/<%= application %>" {

config/templates/apps/project-kv-read.hcl.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ path "<%= secretKvPath %>/data/<%= environment %>/<%= project %>/+" {
1919
capabilities = ["read"]
2020
}
2121

22-
path "apps/metadata/<%= environment %>/<%= project %>/+/+" {
22+
path "<%= secretKvPath %>/metadata/<%= environment %>/<%= project %>/+/+" {
2323
capabilities = ["read", "list"]
2424
}
2525

config/templates/apps/project-kv-write.hcl.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11

22
path "<%= secretKvPath %>/data/<%= environment %>/<%= project %>" {
3-
capabilities = ["create", "update", "delete"]
3+
capabilities = ["create", "update", "patch", "delete"]
44
}
55

66
path "<%= secretKvPath %>/data/<%= environment %>/<%= project %>/+" {
7-
capabilities = ["create", "update", "delete"]
7+
capabilities = ["create", "update", "patch", "delete"]
88
}
99

1010
path "<%= secretKvPath %>/data/<%= environment %>/<%= project %>/+/+" {
11-
capabilities = ["create", "update", "delete"]
11+
capabilities = ["create", "update", "patch", "delete"]
1212
}
1313

1414
path "<%= secretKvPath %>/metadata/<%= environment %>/<%= project %>/+" {
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
# Audit hash admin Policy
1+
# Audit hash
22
# Scope: Users and applications with a need to calculate the hash of data
3-
# Note: Access to this path will allow someone to map well known data to their hash. Only trusted entities should have access.
3+
# Note: Access to this path will allow someone to map known possible values to
4+
# their hash. Only trusted entities should have access.
5+
# Warning: This policy is referenced by name. Ensure changes do not break references
6+
# or character of this policy.
47

5-
# Allow create tokens
8+
# Allow checking of hash values (post)
69
path "/sys/audit-hash/+" {
710
capabilities = ["update"]
811
}

config/templates/system/broker-auth.hcl.tpl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Authentication policy for global broker
22
# Scope: Broker Approle
3+
# Warning: This policy is referenced by name. Ensure changes do not break references
4+
# or character of this policy.
35

46
path "auth/<%= authMount %>/role/+/role-id" {
57
capabilities = ["read"]
@@ -13,4 +15,11 @@ path "auth/<%= authMount %>/role/+/secret-id" {
1315
path "auth/<%= authMount %>/role/<%= path %>" {
1416
capabilities = ["deny"]
1517
}
16-
<% }); %>
18+
<% }); %>
19+
20+
path "<%= secretKvAppsPath %>/subkeys/tools/+/+" {
21+
capabilities = ["read"]
22+
}
23+
path "<%= secretKvAppsPath %>/data/tools/+/+" {
24+
capabilities = ["create", "update", "patch"]
25+
}

package-lock.json

Lines changed: 68 additions & 68 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)