🐙Argo CD
Install P0 for your Argo CD instances so people can request just-in-time Argo CD roles, on a whole instance or on one project.
Use the Argo CD integration to give people temporary roles in Argo CD. A person requests one of two kinds of access:
A global role, such as
role:readonlyorrole:admin, on a whole Argo CD instance.A project role, one of the roles an Argo CD project (an AppProject) already defines.
When the request is approved, P0 adds one line to your Argo CD policy that gives the person's SSO user that role. When access ends, P0 removes the line.
To learn more, see:
How it works
The connector runs in your cloud. You deploy P0's Argo CD connector (see P0 connectors) on AWS Lambda or Google Cloud Run. P0 invokes the connector, and the connector calls the Argo CD API of your instances over HTTPS. It never calls the Kubernetes API. One connector can serve several Argo CD instances.
The connector acts as an Argo CD local account you create. You add the account
p0-connectorin Git, with a role that can read one Application and update one ConfigMap through it, as in Step 1: Add the p0-connector account.The account's API token stays in your secret manager. You store it in AWS Secrets Manager or Google Secret Manager, under a name you choose. P0 stores only the secret's name and where it is, and never reads the secret. The connector does.
P0 writes grants to a key of its own. Every grant is a line in the
policy.p0.csvkey ofargocd-rbac-cm, written through the Application that managesargocd-rbac-cm. Your own policy keys stay as you wrote them, and Argo CD's audit log records each change.You decide which email domains can receive access. The connector's
ALLOWED_EMAIL_DOMAIN_PATTERNenvironment variable holds a regular expression for the allowed email domains. The connector refuses everyone else, and P0 can't change the pattern.P0 grants roles to SSO users by email. The line names the person's P0 email in lowercase, and Argo CD matches it to the email your identity provider sends. P0 never creates or changes Argo CD accounts, projects or roles.
What P0 changes in Argo CD
A request is approved
Adds g, <email>, role:<role> for a global role, or g, <email>, proj:<project>:<role> for a project role, to policy.p0.csv
Access ends
Removes that line. If the line is already gone, there's nothing to do, and the request ends normally
P0 changes nothing else in Argo CD. It never edits your other policy keys, your AppProjects or your Applications, and never syncs an Application.
P0 refuses a request for a role the person already holds. For the details, see Roles you already hold.
Access policies
In the Resource section of an access policy, Argo CD is the service argocd. Its access types are global-role and project-role.
Available filters
A rule can filter on these properties of a request, each with the key name:
instance
The Argo CD instance's ID in P0, whichever way the requestor named it
prod
project
The project's name in Argo CD. Applies to project-role only
payments
role
For global-role, the role's full name, with its role: prefix. For project-role, the role's name on the project
role:readonly
Patterns are unanchored, case-sensitive regular expressions. Use ^ and $ to match a whole name.
Example access policy
These policies send requests for role:readonly on any instance, and for any role on the payments project, to your Security Reviewers, and deny role:admin on the prod instance:
Error messages for admins
Requestors and approvers see these messages on a request when it needs an admin's attention. For the messages a requestor can fix themselves, see Troubleshooting. For the messages you see while you add an instance, see What the install checks.
The install
The Argo CD connector for <instance> can't check email domains. Ask your P0 admin to check its setup.
The connector's ALLOWED_EMAIL_DOMAIN_PATTERN is unset, blank, or isn't a regular expression that compiles. Set it as in The email domain pattern. The connector's log says what's wrong with it.
The Argo CD instance <instance> uses the connector <connector>, which isn't installed. Ask your P0 admin to install it.
Install a connector with that ID again, in the same place, as in Step 3: Install the connector.
P0 isn't installed on any Argo CD instance yet. Ask your P0 admin to install one.
Add an Argo CD instance, as in Step 4: Add the Argo CD instance.
A message that starts P0 is not installed for the instance and names an instance
The request is for an instance that was removed from P0. See Remove or replace an instance.
The connector and the p0-connector account
P0 couldn't reach the Argo CD connector. Ask your P0 admin to check its deployment.
Check that the connector's function or service exists where its hosting says, and that the connector's Terraform is applied: it gives P0 lambda:InvokeFunction on AWS, or roles/run.invoker and roles/run.viewer on Google Cloud. Check the connector's logs.
The Argo CD connector couldn't read the p0-connector account's API token. Ask your P0 admin to check the Argo CD install.
Check the secret's name, and its account and region or project, on the instance's page in P0. Check that the secret holds {"token": "<api token>"}, and that the instance's Terraform is applied. The connector's log records why the read failed.
A message that starts Argo CD at <host> didn't accept the connector's API token
The token was deleted, or the p0-connector account was disabled, removed or lost its apiKey capability. Check the account with argocd account get --account p0-connector, and if you need a new token, follow Rotate the API token.
A message that starts Argo CD at <host> refused the connector's call to
The p0-connector account lost one of its policy lines, or the managing Application was renamed or deleted. Check the account's lines in Step 1: Add the p0-connector account against argocd-rbac-cm.
A message that says an Application doesn't manage ConfigMap <namespace>/argocd-rbac-cm
argocd-rbac-cm is no longer deployed by the Application the instance names. See Remove or replace an instance to point P0 at the Application that deploys it now.
Argo CD is temporarily unavailable. Try again in a few minutes.
The connector couldn't reach Argo CD, or Argo CD answered with an error or limited its calls. Check that Argo CD is up and that the connector's network can reach it. The connector's log says what happened. Then retry.
The Argo CD connector's account on <instance> may do more than P0 allows, such as sync any application, so P0 grants nothing there until its privileges are cut back. Ask your P0 admin to check the Argo CD install.
Someone widened the p0-connector account's role. Remove what it shouldn't have, as in Permissions not to grant the account.
Argo CD's policy
argocd-rbac-cm on the Argo CD instance <instance> has a line Argo CD refuses, so Argo CD keeps enforcing the policy it had and a new grant wouldn't take effect. Ask an Argo CD admin to fix or remove that line.
A line in one of your policy keys doesn't parse, so Argo CD ignores the whole change and keeps its earlier policy. Fix the line in Git, starting with the most recent change to a policy key.
A message that starts Argo CD at <host> accepted the change to policy.p0.csv in argocd-rbac-cm, but reading it back
Something changed policy.p0.csv right after P0 wrote it, such as a sync. Check that Git doesn't declare the key, then retry.
When P0 can't revoke a role, the request shows as errored, and the line stays in policy.p0.csv. Fix the cause, then click Retry revoke on the request's page.
Limitations
P0 grants roles to SSO users only, by email. It can't grant a role to an Argo CD local account, and it doesn't check that a user exists in your identity provider.
Your identity provider must send emails in lowercase. Argo CD compares a policy line's email with the email the identity provider sends, capitalization included, and P0 writes the email in lowercase. If your identity provider sends
Alice@Example.com, a grant toalice@example.comgives Alice nothing.An Application must manage
argocd-rbac-cm. P0 writes through that Application, so an instance whoseargocd-rbac-cmno Application deploys isn't supported.Argo CD must be version 3.0 or later, and served at the root of its address. An Argo CD served under a path (
server.rootpath) isn't supported.P0 never creates or edits AppProject roles. A project role must already be defined on the project, and P0 offers every role a project defines. See Project roles.
P0 doesn't put back a line that someone else removes. If a sync or a person removes P0's line, the person loses the access before it ends, and the request still ends normally.
A person can have one open request for each role at a time. See One request per role.
Removing an instance from P0 leaves the lines P0 wrote in
policy.p0.csv, and P0 can't revoke them while the instance isn't installed. See Remove or replace an instance.The instance must be reachable over the public internet at an
httpsaddress, with a certificate from a public certificate authority.The connector runs on AWS Lambda or Google Cloud Run, and reads the API token's secret from the secret manager of the same cloud.
Last updated