Skip to content

Commit ac8c621

Browse files
authored
Document using more than one egress credential provider (agent-substrate#3410)
Part of agent-substrate#1661. - Documents the JSON array form of ate-setup's `--credential-provider` in `docs/guides/egress-credential-injection.md` and `cmd/ate-setup/commands.md`, and that the gateway sends each `ate-secret://` URI to the provider its host names. - Updates comments that still described one provider: the egress manifest's marker comment and `cmd/atenet/internal/router/egress/provider.go`. Docs and comments only, so it can merge during the freeze. AI use: AI-assisted draft, reviewed by me. - [x] Tests pass (no code changes) - [x] Docs updated Signed-off-by: Max Thompson <[email protected]>
1 parent 9d16b69 commit ac8c621

4 files changed

Lines changed: 18 additions & 16 deletions

File tree

‎cmd/ate-setup/commands.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ every setting with its environment variable.
2929
| `--ingress-allowed-spiffe-ids IDS` | Comma-separated SPIFFE IDs (exact match) of the clients the ingress router lets reach actors; any listed client may reach any actor. Unset, no client may reach actors through the router. Both dataplanes require a Pod Identity CA client certificate on HTTPS and TLS CONNECT. The SPIFFE URI SAN allowlist may be checked during or after TLS, including after CONNECT acceptance, but unlisted clients must be denied before actor routing. The podidentity signer issues `spiffe://cluster.local/ns/<namespace>/sa/<service-account>`. `ATE_INGRESS_ALLOWED_SPIFFE_IDS` when the flag is absent |
3030
| `--egress-gateway-extra-spiffe-ids IDS` | Comma-separated SPIFFE IDs that hold ate-api-server's `egress_gateway` role next to atenet-egress, such as a credential provider that mints actor JWTs. ate-setup passes atenet-egress's ID and then each listed ID as repeated `--egress-gateway-spiffe-id` flags; unset passes none, leaving ate-api-server's default. `ATE_EGRESS_GATEWAY_EXTRA_SPIFFE_IDS` when the flag is absent |
3131
| `--experimental-additional-egress-extproc-service NS/SVC:PORT` | External processor authorization filter |
32-
| `--credential-provider JSON` | Required by `deploy ate-system` and `deploy atenet`. A JSON object: `{"name":"k8s.io"}` deploys and uses the bundled Kubernetes Secrets provider, with a NetworkPolicy that admits only the egress gateway; `{"enabled":false}` turns egress credential injection off; `{"name":"<provider>","address":"<host>:<port>"}` uses a provider you deploy yourself. See [`docs/guides/egress-credential-injection.md`](../../docs/guides/egress-credential-injection.md). `ATE_CREDENTIAL_PROVIDER` when the flag is absent |
32+
| `--credential-provider JSON` | Required by `deploy ate-system` and `deploy atenet`. A JSON object: `{"name":"k8s.io"}` deploys and uses the bundled Kubernetes Secrets provider, with a NetworkPolicy that admits only the egress gateway; `{"enabled":false}` turns egress credential injection off; `{"name":"<provider>","address":"<host>:<port>"}` uses a provider you deploy yourself. A JSON array of provider objects selects several, each serving the `ate-secret://` URIs its name is the host of. See [`docs/guides/egress-credential-injection.md`](../../docs/guides/egress-credential-injection.md). `ATE_CREDENTIAL_PROVIDER` when the flag is absent |
3333
| `--ateapi-log-level LEVEL` | ate-api-server log level: `debug`, `info`, `warn`, or `error`. Written to the `ate-api-config` ConfigMap on every deploy when set; unset keeps the installed level (`info` on a new install). Changing the level updates the env-hash annotation and rolls `ate-api-server`. `ATE_API_LOG_LEVEL` when the flag is absent |
3434
| `--otlp-endpoint URL` | Send control plane telemetry to `URL` instead of the cluster default (see [`benchmarking/telemetry/README.md`](../../benchmarking/telemetry/README.md)). `ATE_OTLP_ENDPOINT` when the flag is absent |
3535
| `--preview GATES` | Preview gates passed as `--preview` to every substrate component: comma-separated gate names, or `ALL` for all. `ATE_PREVIEW` or `config.preview` when the flag is absent. An explicit `--preview=''` turns them all off, even when `ATE_PREVIEW` is set |

‎cmd/atenet/internal/router/egress/provider.go‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
// This file connects the egress gateway to the credential provider it resolves
16-
// egress credential injections through: dialing it, reducing the configured
17-
// provider prefix to the provider name the handler enforces, and the small
15+
// This file connects the egress gateway to the credential providers it resolves
16+
// egress credential injections through: dialing them, validating the configured
17+
// provider names the handler routes on, and the small
1818
// validators the injection path shares. The gateway's atenet router wires
1919
// DialProvider and ProviderName in when it builds the egress handler (see
2020
// cmd/atenet/internal/router).
@@ -97,7 +97,7 @@ func ProviderName(name string) (string, error) {
9797
// providerNameFromURI returns the provider name of a ate-secret:// URI —
9898
// the URI host, e.g. "k8s.io" in
9999
// ate-secret://k8s.io/default/<namespace>/<secret>/<key>. The gateway reads only the host,
100-
// to confirm a URI targets the provider it is configured to serve.
100+
// to pick the provider a URI targets.
101101
func providerNameFromURI(raw string) (string, error) {
102102
u, err := url.Parse(raw)
103103
if err != nil {

‎docs/guides/egress-credential-injection.md‎

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,13 @@ go run ./cmd/ate-setup deploy atenet --credential-provider='{"name":"k8s.io"}'
203203
```
204204

205205
`--credential-provider` (or `ATE_CREDENTIAL_PROVIDER` when the flag is
206-
absent) is a JSON object with these keys; any other key is an error:
206+
absent) is a JSON object with these keys, or a JSON array of such objects to
207+
select several providers; any other key is an error:
207208

208209
| Key | Value |
209210
|---|---|
210-
| `enabled` | Defaults to `true`. `false` turns injection off, and then no other key is allowed |
211-
| `name` | Required unless `enabled` is `false`. A DNS name: `k8s.io` for the bundled Kubernetes Secrets provider, or the name of a provider you deploy, which is the host of the `ate-secret://` URIs it serves, e.g. `vault.example.com` for `ate-secret://vault.example.com/...`. A policy URI naming any other provider fails closed |
211+
| `enabled` | Defaults to `true`. `false` turns injection off, and then no other key is allowed. An array entry can't be `false` |
212+
| `name` | Required unless `enabled` is `false`. A DNS name: `k8s.io` for the bundled Kubernetes Secrets provider, or the name of a provider you deploy, which is the host of the `ate-secret://` URIs it serves, e.g. `vault.example.com` for `ate-secret://vault.example.com/...`. Names in an array must differ. A policy URI naming no configured provider fails closed |
212213
| `address` | The `host:port` the gateway dials the provider at. Required for a provider you deploy; optional with `k8s.io`, where it defaults to the bundled provider's Service, `k8s-credential-provider.ate-system.svc:50051` |
213214

214215
For example:
@@ -217,9 +218,10 @@ For example:
217218
--credential-provider='{"name":"k8s.io"}'
218219
--credential-provider='{"enabled":false}'
219220
--credential-provider='{"name":"vault.example.com","address":"vault-provider.ate-system.svc:50051"}'
221+
--credential-provider='[{"name":"k8s.io"},{"name":"vault.example.com","address":"vault-provider.ate-system.svc:50051"}]'
220222
```
221223

222-
**2. The provider.** With `k8s.io` the install deploys the Kubernetes Secrets
224+
**2. The provider.** With `k8s.io` among the providers, the install deploys the Kubernetes Secrets
223225
provider itself, from `manifests/egress-credential-injection/`, and waits for
224226
it alongside the gateway. The install applies:
225227

@@ -235,7 +237,7 @@ it alongside the gateway. The install applies:
235237
cluster whose network plugin enforces NetworkPolicy. Elsewhere the provider's
236238
check of the gateway's client certificate is the only restriction.
237239

238-
Selecting any other provider, or `{"enabled":false}`, removes a bundled
240+
A selection without `k8s.io`, including `{"enabled":false}`, removes a bundled
239241
provider an earlier install left behind, NetworkPolicy included. A provider of
240242
your own is yours to deploy, and until something serves the configured address
241243
every matching injection rule fails closed with 503.
@@ -327,12 +329,12 @@ Manager, or any other secret store — implement the API under your own provider
327329
class (the URI host, e.g. `ate-secret://vault.example.com/...`), then have a
328330
cluster admin point the gateway at it with
329331
`--credential-provider='{"name":"vault.example.com","address":"<host>:<port>"}'`.
330-
A gateway currently fronts **one** provider:
331-
a policy URI naming any other class fails closed rather than being sent to the
332-
wrong provider.
332+
A gateway can front several providers, one per class. It sends each URI to the
333+
provider its host names, and a policy URI naming no configured class fails
334+
closed rather than being sent to the wrong provider.
333335

334-
The gateway reads only the URI host, to confirm the URI targets the provider it
335-
serves. The provider interprets the path, within the rules under
336+
The gateway reads only the URI host, to pick the provider the URI targets. The
337+
provider interprets the path, within the rules under
336338
[Credential URIs](#credential-uris).
337339

338340
[credprovider-gcp-secret-manager](https://github.com/agent-substrate-plugins/credprovider-gcp-secret-manager) is such a provider for Google Cloud Secret Manager.

‎manifests/ate-install/atenet-egress.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1393,7 +1393,7 @@ spec:
13931393
# "Envoy already exited", and reports a drain it never performed.
13941394
- --envoy-admin-address=127.0.0.1:15000
13951395
# Egress credential-injection flags. The installer replaces this marker
1396-
# with the --credential-provider-* flags for the provider that the
1396+
# with the --credential-provider-* flags for the providers that the
13971397
# installer's --credential-provider selects, or removes it when that is
13981398
# {"enabled":false}. Without a provider, a request matching a rule that
13991399
# requires an injection is denied (see egress.applyEffects).

0 commit comments

Comments
 (0)