Skip to content

Commit c17b5bf

Browse files
author
rzisholz
committed
Drop the onboarding script, document console-based onboarding instead
Tenant onboarding is a UI flow in the CyberArk console, not something customers run a script for, so the script does not belong in this repo. Removes hack/onboard-disco-agent.sh and rewrites the chart README's onboarding section to state what onboarding must produce (an authn-jwt authenticator scoped to the cluster's issuer/JWKS, a registered workload for the agent's ServiceAccount, and the grants to authenticate and upload) and to point at the product documentation for the walkthrough. Also removes references to server-side implementation details from code comments — specific source files and internal service names — leaving the protocol-level facts a reader of this repo needs: the authn-jwt exchange is served by Secrets Manager rather than identity_administration, and the returned base64 token is forwarded as an opaque Bearer credential. No functional change; the agent's auth path is untouched.
1 parent 3785a96 commit c17b5bf

4 files changed

Lines changed: 21 additions & 35 deletions

File tree

deploy/charts/disco-agent/README.md

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -94,33 +94,20 @@ configuration is required.
9494

9595
### Per-tenant Conjur onboarding
9696

97-
Onboarding uses the Conjur Cloud **v2 REST API** (JSON objects), not v1 policy
98-
files — run `hack/onboard-disco-agent.sh` against the target tenant before
99-
deploying the agent. The script performs all of it with the **customer's own**
100-
Conjur Cloud admin token; DisCo holds no Conjur identity of its own:
97+
Before deploying the agent, the target tenant must be onboarded in Conjur
98+
Cloud: an `authn-jwt` authenticator scoped to the cluster's OIDC issuer and
99+
JWKS, a registered workload for the agent's ServiceAccount, and the grants that
100+
let that workload authenticate and upload. Onboarding is performed through the
101+
CyberArk web console — see the product documentation for the current
102+
walkthrough.
101103

102-
```sh
103-
CONJUR_TOKEN="$(cat admin-token.txt)" \
104-
hack/onboard-disco-agent.sh \
105-
--ark-subdomain <tenant-subdomain> \
106-
--issuer https://kubernetes.default.svc.cluster.local
107-
```
108-
109-
Tenant-level (once per tenant per provider type): creates the `data/disco`
110-
branch, a per-type uploader group, and a value-less "probe" secret that only
111-
the uploader group can `read`+`execute` — that probe is the entire
112-
authorization decision at request time (no policy `!permit`/`!grant` needed).
113-
114-
Per-cluster (each onboard): creates `data/<provider-type>/<cluster-UUID>` and
115-
its `workloads` sub-branch, an `authn-jwt` authenticator scoped to the
116-
cluster's real OIDC issuer + JWKS, registers the agent's workload under that
117-
branch, and grants it both the authenticator's `apps` group (to authenticate)
118-
and the uploader group (to pass the probe, i.e. to authorize).
104+
Onboarding needs only the tenant administrator's own Conjur Cloud credentials.
105+
The agent itself holds no Conjur identity beyond its projected ServiceAccount
106+
token, and nothing in this chart requires a Conjur admin credential at deploy
107+
time.
119108

120-
`CLUSTER_UUID` (the `kube-system` namespace UID), the OIDC issuer, and the JWKS
121-
are auto-derived from the current `kubectl` context if not passed explicitly.
122-
See the script's header comment for the full `--dry-run`/`--skip-deploy` flag
123-
reference.
109+
Once onboarding is complete, note the authenticator's service ID — that is the
110+
value for `config.cyberark.serviceId` below.
124111

125112
### Deploy the agent
126113

@@ -151,7 +138,7 @@ kubectl logs deployments/disco-agent --namespace "${NAMESPACE}" --follow
151138
| Symptom | Likely cause | Fix |
152139
|---|---|---|
153140
| Agent logs `401 Unauthorized` from Conjur | ServiceAccount token `audience` does not match the authenticator's configured `audience` value, or the authn-jwt authenticator is not enabled for the account | Confirm `audience=conjur` in both the projected volume (chart default) and the Conjur `conjur/authn-jwt/<serviceId>/audience` variable; ensure the authenticator is enabled (`CONJUR_AUTHENTICATORS` includes `authn-jwt/<serviceId>`) |
154-
| Agent logs `403 Forbidden` from the upload API | The agent's workload is not a member of `data/disco/<type>-uploaders` (fails the authz probe) | Re-run `hack/onboard-disco-agent.sh` for this cluster — it's idempotent |
141+
| Agent logs `403 Forbidden` from the upload API | The agent's workload is authenticated but not authorized to upload | Confirm in the CyberArk console that this cluster's workload was granted the uploader permission during onboarding |
155142
| Agent logs `500` / no upload attempt | Conjur is unreachable or returned an unexpected error | Check network policy / DNS; inspect Conjur audit logs for the host identity |
156143

157144
## Values

internal/cyberark/client.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ func selectAuthenticator(ctx context.Context, httpClient *http.Client, serviceMa
103103
account = "conjur"
104104
}
105105
// The authn-jwt exchange is served by Secrets Manager (Conjur Cloud),
106-
// not by identity_administration. Onboarding registers the
107-
// authenticator on that same host (hack/onboard-disco-agent.sh builds
108-
// https://<subdomain>.secretsmgr.<env>-cyberark.cloud/api), and the
109-
// DisCo authorizer resolves it the same way when validating the token.
106+
// not by identity_administration — those are different hosts. Tenant
107+
// onboarding registers the authenticator on the Secrets Manager host,
108+
// and the server that later validates the resulting token resolves the
109+
// same service from service discovery.
110110
smsAPI := serviceMap.SecretsManager.API
111111
if smsAPI == "" {
112112
return nil, errors.New("service discovery returned an empty secrets_manager API, which is required for the Conjur JWT exchange")

internal/cyberark/conjur/conjur.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ func (c *Client) exchange(ctx context.Context) (string, error) {
4848
}
4949
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
5050
// Request the base64-encoded access token — Conjur's canonical wire form for
51-
// the token. The DisCo authorizer accepts this base64 blob directly (passes it
52-
// to /whoami as-is, base64-decodes only for routing).
51+
// the token. It is sent onwards as an opaque Bearer credential, so no
52+
// decoding is needed on this side.
5353
req.Header.Set("Accept-Encoding", "base64")
5454
resp, err := c.httpClient.Do(req)
5555
if err != nil {

internal/cyberark/servicediscovery/discovery.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ const (
3131
// SecretsManagerServiceName is the name of the Secrets Manager (Conjur
3232
// Cloud) API in responses from the Service Discovery API. This is the host
3333
// that serves `authn-jwt/<service-id>/<account>/authenticate` — NOT the
34-
// identity_administration host. The DisCo authorizer resolves the same
35-
// service name when it validates the resulting token (see conjur_token.py
36-
// `_SMS_SERVICE_NAME`).
34+
// identity_administration host. The server that validates the resulting
35+
// token resolves this same service name.
3736
SecretsManagerServiceName = "secrets_manager"
3837

3938
// maxDiscoverBodySize is the maximum allowed size for a response body from the CyberArk Service Discovery subdomain endpoint

0 commit comments

Comments
 (0)