chore(framework): canonize Vault-as-SSOT + ESO-default secrets policy #519
@@ -355,7 +355,6 @@ package config
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/kelseyhightower/envconfig"
|
||||
)
|
||||
|
||||
@@ -373,10 +372,16 @@ func Load() (*Config, error) {
|
||||
}
|
||||
return &cfg, nil
|
||||
}
|
||||
```
|
||||
|
||||
// In main():
|
||||
// cfg, err := config.Load()
|
||||
// if err != nil { fmt.Fprintln(os.Stderr, err); os.Exit(1) }
|
||||
In your `main.go`:
|
||||
|
||||
```go
|
||||
cfg, err := config.Load()
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
@@ -399,7 +404,12 @@ Use this pattern ONLY when a documented dynamic-secrets requirement applies (DB
|
||||
vault auth enable approle
|
||||
|
||||
# Create a Vault policy for the app
|
||||
# Note: KV v2 paths require both the exact path (for the top-level secret) and the
|
||||
# wildcard (for sub-paths). Always include both to avoid permission denied errors.
|
||||
vault policy write <app>-policy - <<EOF
|
||||
path "secret/data/k3s/<app>" {
|
||||
capabilities = ["read"]
|
||||
}
|
||||
path "secret/data/k3s/<app>/*" {
|
||||
capabilities = ["read"]
|
||||
}
|
||||
|
||||
@@ -355,7 +355,6 @@ package config
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/kelseyhightower/envconfig"
|
||||
)
|
||||
|
||||
@@ -373,10 +372,16 @@ func Load() (*Config, error) {
|
||||
}
|
||||
return &cfg, nil
|
||||
}
|
||||
```
|
||||
|
||||
// In main():
|
||||
// cfg, err := config.Load()
|
||||
// if err != nil { fmt.Fprintln(os.Stderr, err); os.Exit(1) }
|
||||
In your `main.go`:
|
||||
|
||||
```go
|
||||
cfg, err := config.Load()
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
@@ -399,7 +404,12 @@ Use this pattern ONLY when a documented dynamic-secrets requirement applies (DB
|
||||
vault auth enable approle
|
||||
|
||||
# Create a Vault policy for the app
|
||||
# Note: KV v2 paths require both the exact path (for the top-level secret) and the
|
||||
# wildcard (for sub-paths). Always include both to avoid permission denied errors.
|
||||
vault policy write <app>-policy - <<EOF
|
||||
path "secret/data/k3s/<app>" {
|
||||
capabilities = ["read"]
|
||||
}
|
||||
path "secret/data/k3s/<app>/*" {
|
||||
capabilities = ["read"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user