Remediation
Ravenscan can generate, simulate, and execute guided remediation plans for infrastructure findings. Credentials are fetched from Coderaft Vault at execution time — they are never stored or logged by Ravenscan. All actions are logged to the immutable WORM audit trail.
Workflow overview
- Select credential — enter the UUID of a Vault credential (SSH key or sudo password). The secret is fetched from Coderaft Vault at execution time — never stored by Ravenscan.
- View plan — a step-by-step plan is generated from the finding's rule (e.g.
vuln-ssh-*→ updatesshd_config+ restart, with a backup step). - Dry-run — simulate execution: checks command safety, warns on destructive ops, no host mutation.
- Apply — execute the plan via SSH. Poll status via
GET /api/v1/remediation/status/:plan_id. - Rollback — run each step's
rollback_commandin reverse order to restore pre-remediation state.
API — full workflow
Remediation API workflow
# Step 1: create a remediation plan
curl -X POST https://ravenscan.example.com/api/v1/remediation/plan \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"finding_id": "vuln-ssh-weak-cipher-abc123",
"target_host": "192.168.1.10",
"credential_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}'
# → { "plan_id": "uuid", "steps": [...], "estimated_duration_s": 40 }
# Step 2: dry-run — no host mutation
curl -X POST https://ravenscan.example.com/api/v1/remediation/dry-run \
-H "Authorization: Bearer $API_KEY" \
-d '{ "plan_id": "uuid" }'
# Step 3: apply (confirm: true required)
curl -X POST https://ravenscan.example.com/api/v1/remediation/apply \
-H "Authorization: Bearer $API_KEY" \
-d '{ "plan_id": "uuid", "confirm": true }'
# Poll status (for long-running plans)
curl https://ravenscan.example.com/api/v1/remediation/status/uuid \
-H "Authorization: Bearer $API_KEY"
# → { "status": "running|done|failed|rolled_back", ... }
# Rollback executed steps
curl -X POST https://ravenscan.example.com/api/v1/remediation/rollback/uuid \
-H "Authorization: Bearer $API_KEY" Plan response — example
Example plan response
{
"plan_id": "uuid",
"finding_id": "vuln-ssh-weak-cipher-abc123",
"target_host": "192.168.1.10",
"steps": [
{
"order": 1,
"command": "sshd -T | grep ciphers",
"expected_outcome": "output lists configured ciphers",
"rollback_command": "echo 'no rollback needed for read-only probe'"
},
{
"order": 2,
"command": "cp /etc/ssh/sshd_config /etc/ssh/sshd_config.wolfguard.bak && sed -i ...",
"expected_outcome": "sshd_config updated with strong ciphers",
"rollback_command": "cp /etc/ssh/sshd_config.wolfguard.bak /etc/ssh/sshd_config && systemctl restart sshd"
}
],
"estimated_duration_s": 40
} Security
- No secrets in payload or logs —
credential_idis a UUID referencing Coderaft Vault. The actual SSH/sudo credential is fetched at execution time viavault.Fetch(credential_ref). - UUID validation — the API rejects any
credential_idthat is not a valid UUID, preventing accidental raw credential submission. - WORM audit trail — every plan creation, dry-run, apply step, and rollback is appended to the immutable
audit_logtable (SQLite triggers preventing UPDATE and DELETE).
Plan status values
| Status | Meaning |
|---|---|
pending | Plan created, not yet applied |
running | SSH execution in progress |
done | All steps completed successfully |
failed | One or more steps failed |
rolled_back | All rollback commands executed |
Scope
Remediation is executed over SSH only. A winrm-typed Vault credential can be stored, but there is no real WinRM executor yet — Windows credentialed remediation is not available today.
Next steps
- → Coderaft Vault — store SSH credentials
- → Attack Test — active vulnerability assessment
- → Features — full scan capabilities