| Identity Provider | MFA Support | Targets |
|---|---|---|
| authentik | TOTP, WebAuthn | AWS (the AWS SAML application and the AWS IAM Identity Center application) |
| authentik | TOTP, WebAuthn | Rancher (a token for a downstream cluster) |
The config file for c9s is located at ~/.config/c9s/settings.toml,
but you can use c9s config to manage your configuration.
c9s stores passwords and cached secrets in your OS keyring (Secret Service on Linux, Keychain on macOS, Credential Manager on Windows).
It's enabled by default, but you can disable or re-enable it:
c9s config global use-keyring --enabled falsec9s supports wrapping secrets stored in the OS keyring with AES-256-GCM.
It uses an encryption key derived from a physical YubiKey touch via FIDO2 hmac-secret (Linux and macOS).
This is not supported on Windows.
- The derived key is cached in zeroized memory. It exists only in the process lifetime and requires a physical touch per invocation.
- Once a YubiKey is enrolled, it will always wrap IdP credentials.
- If you want to wrap other secrets, you can. It will just require one physical touch per invocation.
Enroll a YubiKey:
c9s config global yubikey enroll [--rp-id localhost]Check Status:
c9s config global yubikey statusConfigure Protection for Cached Session Secrets (non IdP secrets):
c9s config global yubikey wrap-cached --enabled trueDisable YubiKey Wrapping:
c9s config global yubikey disableSet the default identity provider for targets that do not explicitly specify --idp:
c9s config global default-idp --name workTo make it easier to manage multiple targets, you can set a shared identity provider. The identity provider takes all the information you need to authenticate to your idp: username, url, and mfa type.
c9s config idp --name work --url https://id.example.com --username username@example.com --mfa totp --defaultIf you add --default, it becomes the default idp for all targets.
When configuring targets, you should be aware what the --app-url is for.
--app-url is the URL of the SAML application's .../sso/binding/init/ endpoint in Authentik.
You can find this by right-clicking the application tile and copying its URL.
The following is an example of such an --app-url:
https://id.example.com/application/saml/<app-slug>/sso/binding/init/
The <app-slug> is the name of the application in Authentik.
The Rancher target works with an OIDC application, such as in Authentik.
It requires the --url of the Rancher server and the --client-id from the OIDC application.
Rancher logs in through an identity provider (see above); --client-id is the client id of the OIDC application in
authentik that Rancher is configured with. --username and --mfa are optional overrides of the identity provider's.
c9s config rancher --url https://rancher.example.com --client-id rancher [--idp work] [--username username@example.com]Provide the --app-url of your AWS application.
The username comes from the identity provider.
If you wish to provide an override, set --username as well.
c9s config aws app --app-url https://id.example.com/application/saml/my-aws-app/sso/binding/init/ [--idp work] [--username username@example.com]Provide the --app-url of your AWS IAM Identity Center application and the --region of your Identity Center instance.
The username comes from the identity provider.
If you wish to provide an override, set --username as well.
c9s config aws sso --app-url https://id.example.com/application/saml/my-aws-sso-app/sso/binding/init/ --region eu-central-1 [--idp work] [--username username@example.com]--cluster is the display name of the cluster in Rancher.
The token lives for --ttl. It's one hour (1h) by default, but you can also set it for other times: 30m, 1d, etc.
c9s will reuse valid tokens from its keyring.
Kubeconfig:
c9s creds rancher --cluster my-cluster > ~/.kube/my-cluster.yaml
kubectl --kubeconfig ~/.kube/my-cluster.yaml get namespaceskubectl credential plugin:
--output exec-credential prints an ExecCredential, so kubectl can ask c9s for a token whenever it needs one.
users:
- name: my-cluster
user:
exec:
apiVersion: client.authentication.k8s.io/v1
command: sh
args: ["-c", "c9s creds rancher --cluster my-cluster --output exec-credential 2> /dev/tty"]
interactiveMode: NeverDefaults:
If you want to override the default values, you can provide them as arguments in the command:
c9s creds aws --app-url YOUR_APP_URL --username USERNAME --app-type awsIf you want to only retrieve credentials for a single AWS role, provide a value for the --role-arn argument:
c9s creds aws --role-arn YOUR_ROLE_ARNAWS CLI Profile:
Note: Some environments may not work well with stdout prompts. It may make it difficult to know when to plug in a hardware security key.
- Think of a new AWS CLI profile name. Replace
my-new-profilewith it in the following steps. - Note the role arn you want to assume. Replace
my-role-arnin thecredential_processwith this arn in the next step. - Add a new profile to your AWS CLI config file
~/.aws/config:[profile my-new-profile] region = eu-west-1 credential_process = sh -c "c9s creds aws --app-type aws --role-arn my-role-arn --output aws-profile 2> /dev/tty" - Verify the profile with
aws sts get-caller-identityaws --profile my-new-profile sts get-caller-identity
Defaults:
If you want to override the default values, you can provide them as arguments in the command:
c9s creds aws --app-url YOUR_APP_URL --username USERNAME --app-type aws-ssoSpecify role-arn:
If you want to only retrieve credentials for a single role, provide a value for the --role-arn argument:
c9s creds aws --app-type aws-sso --role-arn YOUR_ROLE_ARNAWS CLI Profile:
Note: Some environments may not work well with stdout prompts. It may make it difficult to know when to plug in a hardware security key.
- Think of a new AWS CLI profile name. Replace
my-new-profilewith it in the following steps. - Note the role arn you want to assume. Replace
my-role-arnin thecredential_processwith this arn in the next step. - Add a new profile to your AWS CLI config file
~/.aws/config:[profile my-new-profile] region = eu-west-1 credential_process = sh -c "c9s creds aws --app-type aws-sso --role-arn my-role-arn --output aws-profile 2> /dev/tty" - Verify the profile with
aws sts get-caller-identityaws --profile my-new-profile sts get-caller-identity