# Secrets and security

Source: https://argoctl-docs.pages.dev/docs/concepts/security

> How argoCTL handles BMC passwords, tokens, keys and logs, and what it never stores or prints.

## Secrets are referenced, never written down

The site file never contains a password. It names **where** the BMC password is:

```yaml
bmc:
  username: admin
  password_env: ARGOCTL_BMC_PASSWORD        # an environment variable on mgmt
  # or
  password_file: /etc/argoctl/bmc-password  # an absolute path to a file holding it
```

`argoctl site validate` rejects an inline `bmc.password:` (without printing its value), and rejects a `password_env` that doesn't look like a variable name, because it may be a pasted password. The same pattern applies to Hugging Face tokens (`--hf-token-env`, `--hf-token-file`) and inference API keys (`--api-key-env`, `--api-key-file`).

When running as root, pass environment variables through `sudo` explicitly:

```bash
sudo --preserve-env=ARGOCTL_BMC_PASSWORD argoctl provision /etc/argoctl/site.yaml
```

For a file, keep it root-only:

```bash
sudo install -m 0600 -o root -g root /dev/stdin /etc/argoctl/bmc-password   # paste, then Ctrl-D
```

## What argoCTL generates and keeps

| Secret | Where | Notes |
|---|---|---|
| Ironic API password, MariaDB password | `/etc/argoctl/ironic/` (0700) | Random, generated once, never printed. |
| mgmt's provisioning SSH key | `/var/lib/argoctl/ssh/id_ed25519` | Added to every installed node for user `ubuntu`. |
| Kubernetes admin kubeconfig | `/var/lib/argoctl/cluster/admin.conf` (0600, in a 0700 directory) | Cluster-admin credentials. |
| Hugging Face token, API keys | Kubernetes Secrets in the inference namespace | Read from your variable or file at deploy time. |

Kubernetes **join tokens** are created right before each join with a 15-minute lifetime, passed to the worker in a file that is deleted straight after, and every bootstrap token is deleted at the end of the run. They never reach the site file, mgmt's disk or a log.

## Logs and reports are redacted

Every [run log](https://argoctl-docs.pages.dev/docs/reference/logs) replaces secrets with `[redacted]`:

- **by value**: the BMC password, Ironic and database passwords, kubeconfig keys, tokens, wherever they appear (request bodies, command output, error messages);
- **by field**: JSON keys and `key: value` text named like a password, secret, token, private key or authorization; `Authorization` headers; `user:password@` in URLs; PEM private keys; kubeadm join tokens;
- request headers are never logged at all.

Logs still contain IPs, MACs, host names and the site file, so log files are `0600` and their directories `0700`.

## Installed nodes

- Login is by SSH key only, as `ubuntu`, with password authentication and root login disabled.
- Keys: mgmt's provisioning key plus the site file's `ssh_authorized_keys`. Private keys in the site file are refused.
- **Secure Boot** is left as the BMC has it. Every boot stage argoCTL uses is signed, so it works with Secure Boot on.

## The BMCs

- argoCTL changes only what it needs (virtual media, the one-time boot override, power) and, in preflight, puts every setting back explicitly.
- It never replaces media it didn't insert.
- `verify_tls: false` accepts a BMC's self-signed certificate; prefer trusting the BMC's CA on mgmt where you can.

## Inference endpoints

By default an endpoint accepts any request that can reach it. Protect it with an API key (`--api-key-env` / `--api-key-file` on [`deploy inference`](https://argoctl-docs.pages.dev/docs/reference/cli/deploy-inference)), and expose it only on networks your users should reach it from.
