Agent credentials

Keep source credentials on your agent.

Keep source credentials on your agent: the console only stores their names and whether they are present.

For a copyable example with your exact credential name, open Get started, step 4 and select your connection. Replace placeholders only on the agent host.

Step 1: Add the connection

  1. In Connections, choose the source type.
  2. Enter its non-secret scope and select an agent.
  3. Choose the credential mode Local credential catalog and enter an uppercase credential name, such as PILOT_SHARE.

The name selects an entry in the agent's local catalog. It is not an environment variable or a path.

Step 2: Write the credential file

Create the host directory /srv/myrikeep/secrets and save the credential JSON there. For an SMB connection named PILOT_SHARE, the file /srv/myrikeep/secrets/PILOT_SHARE contains:

json
{"username": "<USERNAME>", "password": "<PASSWORD>", "domain": "<DOMAIN>"}

Omit domain if your SMB server does not need it. Other types use the fields in Secret file formats.

Step 3: Add the catalog entry

The catalog is myrikeep-credentials.json in the same directory (/run/secrets/myrikeep-credentials.json inside the container). Merge new entries into an existing catalog; do not replace its entries. Change type to match the connection.

json
{
  "version": 1,
  "credentials": {
    "PILOT_SHARE": {
      "type": "smb",
      "source": {"kind": "file_json", "path": "/run/secrets/PILOT_SHARE"}
    }
  }
}

Step 4: Set ownership and mode

sh
sudo chown 10001:10001 /srv/myrikeep/secrets/myrikeep-credentials.json /srv/myrikeep/secrets/PILOT_SHARE
sudo chmod 0600 /srv/myrikeep/secrets/myrikeep-credentials.json /srv/myrikeep/secrets/PILOT_SHARE

See File rules for the accepted modes.

Step 5: Mount the directory and wait for present

Add this flag to the generated docker run command, before the image name:

sh
--mount type=bind,src=/srv/myrikeep/secrets,dst=/run/secrets,readonly
  • Agent already running with this mount: adding files needs no restart.
  • Adding the mount itself: recreate the container with the same state volume.

You should see present after the next heartbeat: the agent resolved and validated the credential for the current connection revision. A stale, missing or older-revision report does not complete the checklist's credential step (step 4 in Get started).

Present does not prove the provider accepts the credential. A failed scan still needs its reported source access problem fixed.

Secret file formats

All values must be nonempty strings.

Type Required fields Optional fields Connection also needs Scope the permission to
SMB (smb) username, password domain Host and share Read-only on the share
AWS S3 bucket (s3) access_key_id, secret_access_key session_token (for temporary credentials) Bucket The bucket and prefix, read-only
Azure Blob container (azure) account_name, account_key, or only sas_token None Account URL and container The container, read-only
IMAP (imap) username, password None Host The chosen mail folders, over TLS

Other credential modes and connectors

Source What to do
S3 or Azure workload identity Configure the identity on the agent host, leave the credential name empty and wait for the agent's credential check. No secret file.
Local mount No credential file; the agent still reports readiness. See the local guide.
Microsoft 365 M365 guide: app registration, read-only permissions, tenant consent and the exact secret JSON.
Gmail or Google Drive (Workspace) Google Workspace guide: the downloaded service-account JSON and domain-wide delegation.
Personal Google Drive or OneDrive Personal drives: the file holds your own app's client fields; refresh tokens live in the writable state volume after sign-in. App passwords cannot be used for Drive files.

For M365 and Workspace, the checklist supplies the catalog entry for your connection's credential name. Provider permission setup for the rest: SMB, S3, Azure, IMAP.

File rules

Rule Value
Owner Root or the agent UID; the agent UID must be able to read the file
Mode 0400 or 0600; 0440 when the agent belongs to the owning group
File type Regular files only; no symlinked files or directory components
Size At most 64 KiB
Content No unrelated fields, no duplicate JSON keys
type / types type for one connector, or types for a compatible Microsoft 365 or Workspace pair/group; never both
Sharing Do not share a catalog entry across unrelated connector families

Credential names

Rule Value
Pattern Starts with A–Z, then A–Z, 0–9 or _
Length Up to 64 characters
Reserved prefixes DJANGO_, DG_, POSTGRES, REDIS, DATABASE, SECRET

The alias selects a catalog entry; it does not name a host file. The catalog's file source sets the actual path.

Environment-variable source (operator option)

The catalog also supports {"kind": "env_json", "name": "SCAN_CREDENTIAL_JSON"} as an operator-configured source for JSON in an environment variable. Aliases never select environment variables automatically. File JSON is the recommended setup on this page.

Credential and pickup states

State / error Meaning What to do
unknown No fresh report for this connection revision Check assignment, online state and desired/applied configuration
missing / credential_missing Alias absent, wrong catalog type or workload credentials unavailable Fix the agent's local setup
Invalid / credential_config_invalid Malformed catalog or value, bad ownership/mode, unreadable file, symlink or wrong fields. Usually shows as missing presence Validate locally; never paste secrets into support messages
present Local resolution passed for this revision. Personal drives also check token readiness Other sources still need a scan to test provider authorization
signin_required / Sign-in required Personal-drive refresh state is absent or revoked Run the sign-in command on the assigned agent
source_error / access denied The fleet reports a bounded generic failure Check source scope, permissions and local diagnostics in that connector's guide
Paused / Migration paused / Disabled Separate from credential presence Resume the agent, reassign and save a migrated connection, or enable the connection

See Getting started for exclusions and schedules, and Security for processing and retention.