Administering Keen
DigitalOcean
Chapter 18 of 40
DigitalOcean
DigitalOcean posture reads the team a token belongs to: Cloud Firewalls, Droplet backups, managed databases, Kubernetes clusters and Security Center scan findings, with read-only access, and records the team's resource actions. Results appear on the DigitalOcean vendor's Cloud posture tab (see Cloud vendor posture).
Keen reads api.digitalocean.com through its validated HTTP client and names the team after its UUID. DigitalOcean publishes no API for team members or their two-factor authentication, so the tab lists no identities and runs no user checks.
Checks
| Check | Action | Met when |
|---|---|---|
| SSH and RDP open to the internet | posture.network.admin_ports | No Cloud Firewall applied to a Droplet allows TCP port 22 or 3389 from 0.0.0.0/0 or ::/0. A Cloud Firewall drops whatever no rule allows, and a deny rule for every address takes precedence over an allow rule. |
| Droplets behind a Cloud Firewall | posture.network.firewall_coverage | Every Droplet has a Cloud Firewall, applied by ID or by tag. |
| Databases open to the internet | posture.network.databases | Every managed database has trusted sources, and none of them is 0.0.0.0/0 or ::/0. A database without trusted sources accepts connections from anywhere. |
| Droplet backups | posture.resilience.backups | Every Droplet has backups on. |
| Kubernetes clusters | posture.kubernetes.control_plane | Every cluster has a high-availability control plane and automatic upgrades on. |
| Security scan findings | posture.findings | The latest Security Center scan has no critical or high finding. A team whose scans are off, or have not run, reads Not established. |
Activity
Keen records the team's resource actions under their own type, such as power_cycle, snapshot or resize, with the resource type and region, and an outcome of success for completed actions and failure for errored ones. DigitalOcean's actions name no person. Each read stops 15 minutes before the present.
1. Create a custom-scoped, read-only token
- In the DigitalOcean control panel, switch to the team Keen should read, then open API → Tokens → Generate New Token. Name it, for example Keen posture, and choose an expiry.
- Choose Custom Scopes and select only the read scopes below, then generate the token. Copy it at once: the control panel shows it only once.
| Scope | Needed by |
|---|---|
account:read | The team's name and UUID |
actions:read | Resource actions |
droplet:read | Droplets behind a Cloud Firewall, and Droplet backups |
firewall:read | SSH and RDP open to the internet, and Droplets behind a Cloud Firewall |
tag:read | Cloud Firewalls applied to Droplets by tag |
database:read | Databases open to the internet. It does not include database credentials, which need database:view_credentials. |
kubernetes:read | Kubernetes clusters. It does not include cluster credentials. |
security:read | Security scan findings. Leave it out to skip that check. |
2. Configure Keen
| Setting | Purpose |
|---|---|
KEEN_DIGITALOCEAN_ENABLED | Turns DigitalOcean posture on. |
DIGITALOCEAN_TOKEN | The token from step 1. |
3. Verify, rotate or revoke
Recreate the API, worker and beat containers and choose Admin → Ingest runners → Run DigitalOcean, then open the DigitalOcean vendor's Cloud posture tab. A check that reads Not established names its reason: not allowed means a scope is missing; not set up, or the credentials were not accepted covers a missing, expired or revoked token and scans that are off. Before the token expires, generate another, update DIGITALOCEAN_TOKEN, recreate the containers and delete the old token under API → Tokens.