Credential Key and Token Rotation Checklist After Security Incident

halfbrain_logo512adminJune 16, 2026
0 lượt xem

Credential Key and Token Rotation Checklist After Security Incident

After a security incident, cleaning files is not enough. Passwords, SSH keys, database credentials, API keys, webhook secrets and service tokens may be exposed. Rotation reduces the chance that old access can be reused.

Core principle

Assume credentials touched by the compromised system may be unsafe. Rotate from a clean device and update dependent services carefully.

Checklist

  1. List all credentials used by the system.
  2. Prioritize hosting, VPS and WordPress admin credentials.
  3. Rotate SSH keys if compromise is suspected.
  4. Rotate database passwords.
  5. Rotate API keys and service tokens.
  6. Rotate webhook secrets.
  7. Update .env files and application configs.
  8. Restart affected services.
  9. Remove old keys from providers.
  10. Verify all workflows still work after rotation.

Reusable lesson

Credential rotation applies to WordPress, VPS, GitHub, Cloudflare, email SMTP, analytics, payment tools, AI APIs, n8n and automation pipelines.

Checklist Type Security
Level Intermediate
Risk Level Critical Risk
Estimated Time 45–120 minutes

When to Use This Checklist

Use this checklist after suspected compromise, leaked keys, unknown admin access, exposed .env files or hacked automation workflows.

Required Tools

Password manager, clean device, hosting panel, SSH keys, database access, API provider dashboards, .env files

Before You Start

Rotate credentials from a clean device. Do not trust a compromised machine for sensitive password changes.

Structured Checklist Steps

  1. List credentials.
  2. Rotate hosting and VPS credentials.
  3. Rotate WordPress admin passwords.
  4. Rotate SSH keys if needed.
  5. Rotate database passwords.
  6. Rotate API keys.
  7. Rotate webhook secrets.
  8. Update configs.
  9. Remove old keys.
  10. Verify workflows.

Rollback Plan

If rotation breaks an application, restore access using the new credential in the correct config file rather than re-enabling the old compromised credential.

Common Mistakes

  • Changing only one password.
  • Forgetting database credentials.
  • Leaving old API keys active.
  • Not updating .env files.
  • No credential inventory.

Related Commands

grep -R "API_KEY" .
grep -R "DB_PASSWORD" .
grep DB_ wp-config.php
docker compose config
sudo systemctl restart nginx
docker compose restart

Share:

Disclaimer: The guides, checklists, commands, and examples on HalfBrain.net are provided for educational and operational reference only. Server environments, hosting providers, software versions, security settings, and WordPress configurations can vary, so you should always review commands before running them on your own system. We do our best to keep the content accurate and useful, but we cannot guarantee that every command, configuration, or recommendation will fit every environment. Always back up your website, database, and server configuration before making changes. HalfBrain.net is not responsible for data loss, downtime, security incidents, misconfiguration, or other issues that may result from applying the information on this website. Use the material at your own discretion.

Leave a Reply

Your email address will not be published. Required fields are marked *