Conversation
|
49e21fa to
c9dc275
Compare
c9dc275 to
cfa1fb4
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cfa1fb45e5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const ( | ||
| defaultCmdOutputMaxSize = 1024 * 1024 | ||
| defaultCmdTimeout = 5 * time.Second | ||
| defaultCmdTimeout = 30 * time.Second |
There was a problem hiding this comment.
Preserve the legacy backend's five-second timeout
When an explicitly configured legacy secret-backend command hangs, this global default now allows every invocation to block for 30 seconds instead of the previous 5 seconds. Since CredentialManager.fetchCredentials retries retriable command failures up to five times, a bad legacy backend can now delay Operator startup or credential retrieval for roughly 150 seconds. Use the longer timeout only for the embedded SGC path so existing command-based backends retain their prior behavior.
Useful? React with 👍 / 👎.
| const ( | ||
| defaultCmdOutputMaxSize = 1024 * 1024 | ||
| defaultCmdTimeout = 5 * time.Second | ||
| defaultCmdTimeout = 30 * time.Second |
There was a problem hiding this comment.
changed to 30s since both the regular datadog-agent and sgc default to 30s
What does this PR do?
Adds native SGC support for resolving the Operator's own
ENC[...]credentials. When-secretBackendTypeis set without-secretBackendCommand, the Operator invokes/usr/local/bin/secret-generic-connectorusing the SGC v1.1 payload, including the backend type, nested configuration, and a 30-second timeout.The public Operator image includes the normal or FIPS SGC binary selected by
FIPS_ENABLED. Both flavors currently use SGC7.84.0-rc.2through theSGC_VERSIONbuild argument.The existing command-based secret backend remains unchanged and takes precedence when configured.
Motivation
This allows the Operator to use the same out-of-the-box secret management implementation as the Agent, so deployments can replace
datadog-vault-secretsafter rollout validation.Additional Notes
Documentation for the operator will have to be updated
The internal GBI wrapper image preserves the bundled SGC binary in https://github.com/DataDog/images/pull/11615. Enabling SGC in deployment values is handled separately.
Minimum Agent Versions
None. This change resolves the Operator's own credentials and does not depend on an Agent or Cluster Agent version.
Describe your test plan
go test -count=1 ./pkg/secrets ./cmd make managergobuild make lintLocal Operator + SGC + Vault end-to-end validation
1. Build the Operator with SGC
From the
datadog-operatorPR branch:Expected:
2. Create a kind cluster and install Vault
3. Configure Vault Kubernetes authentication
Create the policy and role:
Add dummy credentials and enable audit logging:
4. Deploy the Operator
Set the path to a
k8s-datadog-agent-opscheckout:Create the Helm values:
Install the chart:
helm upgrade --install datadog-operator \ "$OPS_REPO/charts/datadog-operator" \ --namespace datadog-agent \ -f /tmp/operator-sgc-values.yaml \ --no-hooksThe chart wiring is handled separately, so patch the Deployment with the new SGC flags:
5. Verify secret retrieval
No decryption errors should be returned.
Confirm Vault received the authentication and secret-read requests:
Expected paths:
6. Verify secret rotation
Expected:
This validates that the Operator retrieves and refreshes its own
ENC[vault://...]credentials through SGC using Vault Kubernetes authentication.Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel