Skip to content

[SECURITY] Credential lifecycle: validation, rotation audit trail, and secure deletion #62

Done

Description

@OkiriGabriel

Problem

OrgConfig.save() accepts any non-empty string for known keys — no format validation (URL shape, token prefixes, etc.). _SENSITIVE_SUFFIXES is defined but never used.

Credential changes log key names only — no structured audit of who changed what and when. OrgConfig.delete() exists but has no HTTP or MCP endpoint for secure revocation/rotation.

With 40+ BYOK keys per org (ORG_CREDENTIAL_KEYS), operators have no guided rotation path or visibility into stale credentials.

Impact

Invalid keys fail at runtime instead of save time. Compromised keys cannot be revoked via API. No audit trail for compliance (SOC2, etc.).

Proposed solution

  1. Optional format validation for high-risk keys (webhook URLs, sk-ant- prefix, ghp_ prefix, etc.)
  2. Emit structured audit events on credential create/update/delete (actor, org_id, keys changed, timestamp — never values)
  3. Expose authenticated DELETE /orgs/{org_id}/config and MCP equivalent for revocation
  4. Add rotation metadata (updated_at, updated_by) per credential bundle
  5. Document rotation runbook in security docs

References

  • services/org_config.py (ORG_CREDENTIAL_KEYS, _SENSITIVE_SUFFIXES, save(), delete())
  • devops_mcp/registry.py (configure_org_credentials, get_org_config_status)
  • docs/COVERAGE_GAPS.md (Vault/rotation mention)

Activity

  1. added
    enhancement
    security
    on Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementsecurity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions