Interactive Setup
The easiest way to create a configuration file is using the interactive wizard:- Setting the config file path
- Entering your CertWatch API key
- Configuring agent name and intervals
- Adding certificates to monitor
Configuration File
The agent uses a YAML configuration file. By default, it looks forcertwatch.yaml in the current directory.
Complete Example
Configuration Reference
API Settings
| Field | Type | Default | Description |
|---|---|---|---|
api.endpoint | string | https://api.certwatch.app | CertWatch API URL |
api.key | string | required | API key with cloud:sync scope |
api.timeout | duration | 30s | HTTP request timeout |
Agent Settings
| Field | Type | Default | Description |
|---|---|---|---|
agent.name | string | default-agent | Unique identifier for this agent |
agent.sync_interval | duration | 5m | How often to sync with cloud (min: 30s) |
agent.scan_interval | duration | 1m | How often to scan certificates (min: 10s) |
agent.concurrency | int | 10 | Max concurrent scans (1-50) |
agent.log_level | string | info | Log level: debug, info, warn, error |
Certificate Settings
| Field | Type | Default | Description |
|---|---|---|---|
hostname | string | required | Hostname or IP address to connect to |
port | int | 443 | Port number (1-65535) |
tags | []string | [] | Tags for organization (max 50 chars each) |
notes | string | "" | Notes about this certificate (max 500 chars) |
Environment Variables
All configuration options can be set via environment variables with theCW_ prefix:
Non-Interactive Mode
For CI/CD pipelines, use environment variables with--non-interactive:
| Variable | Required | Description |
|---|---|---|
CW_API_KEY | Yes | API key with cloud:sync scope |
CW_API_ENDPOINT | No | API endpoint URL |
CW_AGENT_NAME | No | Agent name (default: default-agent) |
CW_SYNC_INTERVAL | No | Sync interval (e.g., 5m) |
CW_SCAN_INTERVAL | No | Scan interval (e.g., 1m) |
CW_LOG_LEVEL | No | Log level |
CW_CERTIFICATES | Yes | Comma-separated hostnames |
Validation
Validate your configuration without starting the agent:Getting an API Key
1
Log in to CertWatch
Go to certwatch.app and sign in.
2
Navigate to API Keys
Go to Settings -> API Keys.
3
Create a New Key
Click Create API Key and select the
cloud:sync scope.4
Copy the Key
Copy the key immediately - it’s only shown once!

