From d181ae8b2662b0a85a0babd082aa4ec0a826ae76 Mon Sep 17 00:00:00 2001 From: Rob Pothier Date: Tue, 18 Jan 2022 14:15:55 -0500 Subject: [PATCH] Add Secrets Provider refresh interval --- PUSH_TO_FILE.md | 4 +- cmd/secrets-provider/main.go | 27 ++++- pkg/log/messages/error_messages.go | 3 + pkg/secrets/config/config.go | 78 ++++++++++++++- pkg/secrets/config/config_test.go | 60 +++++++++++ pkg/secrets/provide_conjur_secrets.go | 67 ++++++++++++- pkg/secrets/provide_conjur_secrets_test.go | 111 +++++++++++++++++++++ 7 files changed, 341 insertions(+), 9 deletions(-) diff --git a/PUSH_TO_FILE.md b/PUSH_TO_FILE.md index 7f17b4f72..4eedf316c 100644 --- a/PUSH_TO_FILE.md +++ b/PUSH_TO_FILE.md @@ -323,12 +323,14 @@ for a description of each environment variable setting: | K8s Annotation | Equivalent
Environment Variable | Description, Notes | |-----------------------------------------|---------------------|----------------------------------| | `conjur.org/authn-identity` | `CONJUR_AUTHN_LOGIN` | Required value. Example: `host/conjur/authn-k8s/cluster/apps/inventory-api` | -| `conjur.org/container-mode` | `CONTAINER_MODE` | Allowed values: Defaults to `init`.
Must be set (or default) to `init` for Push to File mode.| +| `conjur.org/container-mode` | `CONTAINER_MODE` | Allowed values: Defaults to `init`.
Must be set (or default) to `init` or `side-car`for Push to File mode.| | `conjur.org/secrets-destination` | `SECRETS_DESTINATION` | Allowed values: | | `conjur.org/k8s-secrets` | `K8S_SECRETS` | This list is ignored when `conjur.org/secrets-destination` annotation is set to **`file`** | | `conjur.org/retry-count-limit` | `RETRY_COUNT_LIMIT` | Defaults to 5 | `conjur.org/retry-interval-sec` | `RETRY_INTERVAL_SEC` | Defaults to 1 (sec) | | `conjur.org/debug-logging` | `DEBUG` | Defaults to `false` | +| `conjur.org/secrets-refresh-enabled`| Note\* | Can be set to `true` or `false`. Secrets Provider will exit with error if this is explicitly set to `false` and `conjur.org/secrets-rotation-interval` is explicitly set. | +| `conjur.org/secrets-refresh-interval` | Note\* | Set to a valid duration string as defined [here](https://pkg.go.dev/time#ParseDuration). Valid time units are `s`, `m`, and `h` (for seconds, minutes, and hours, respectively). Some examples of valid duration strings:The minimum refresh interval is 1 second. A refresh interval of 0 seconds is treated as a fatal configuration error. The maximum refresh interval is approximately 290 years. | | `conjur.org/conjur-secrets.{secret-group}` | Note\* | List of secrets to be retrieved from Conjur. Each entry can be either: