dcg

Kong API Gateway

apigateway.kong

Protects against destructive Kong Gateway CLI, deck CLI, and Admin API operations.

  • 11blocking rules
  • 14safe patterns
  • 1Critical
  • 7High
  • 3Medium
~/.config/dcg/config.toml
[packs]
enabled = ["apigateway.kong"]

Evaluated when a command contains kong, deck, 8001.

Blocking rules

Each rule ID is apigateway.kong:<name>. Use it in allowlists and [policy.rules].

  1. deck-reset

    Critical

    deck reset removes ALL Kong configuration. This is extremely dangerous and irreversible.

    Explanation
    Resetting Kong removes ALL services, routes, plugins, consumers, certificates, and upstreams. Your entire API gateway configuration is wiped. All traffic through Kong will fail immediately. There is no undo. Safer alternatives: - deck dump: Export current configuration first - deck diff: Review what will change before any sync - Delete specific entities instead of full reset
  2. deck-sync-destructive

    High

    deck sync with --select-tag can remove entities not matching the tag.

    Explanation
    Using --select-tag with deck sync removes entities not matching the tag in your state file. This can accidentally delete services and routes managed by other teams or systems. Entities without tags are at risk of deletion. Safer alternatives: - deck diff --select-tag: Preview changes first - Use consistent tagging across all entities - Consider deck sync without --select-tag to avoid surprises
  3. kong-admin-delete-certificates

    High

    DELETE request to Kong Admin API removes certificates.

    Explanation
    Deleting a Kong certificate removes the TLS/SSL certificate. SNIs using this certificate will fail TLS handshakes. HTTPS traffic to affected domains will receive certificate errors. Safer alternatives: - GET /certificates first: Review certificate details - Upload a replacement certificate before deletion - Remove associated SNIs first
  4. kong-admin-delete-consumers

    High

    DELETE request to Kong Admin API removes consumers.

    Explanation
    Deleting a Kong consumer removes the API client identity. All credentials (API keys, JWT, OAuth) for that consumer are revoked. Plugins configured per-consumer stop applying. Affected clients lose API access. Safer alternatives: - GET /consumers first: Review consumer details - Delete individual credentials instead of the consumer - Notify affected clients before deletion
  5. kong-admin-delete-routes

    High

    DELETE request to Kong Admin API removes routes.

    Explanation
    Deleting a Kong route removes the path-to-service mapping. Requests to that path will return 404 errors. Plugins attached to the route are also removed. The associated service is not affected. Safer alternatives: - GET /routes first: Verify the route details - Test in a non-production environment - Consider disabling plugins instead of deleting the route
  6. kong-admin-delete-services

    High

    DELETE request to Kong Admin API removes services.

    Explanation
    Deleting a Kong service removes the upstream service definition. All routes associated with the service become orphaned and stop working. Traffic to those endpoints will return 404 errors. Safer alternatives: - GET /services first: List services to verify the target - Delete routes pointing to the service first - Use deck dump to export configuration before changes
  7. kong-admin-delete-snis

    High

    DELETE request to Kong Admin API removes SNIs.

    Explanation
    Deleting a Kong SNI removes the domain-to-certificate mapping. HTTPS requests for that hostname will fail TLS negotiation or use a default certificate if configured. Clients will see certificate warnings. Safer alternatives: - GET /snis first: Review SNI configuration - Update the SNI to point to a different certificate - Verify the certificate is no longer needed for this domain
  8. kong-admin-delete-upstreams

    High

    DELETE request to Kong Admin API removes upstreams.

    Explanation
    Deleting a Kong upstream removes the load balancer and all its targets. Services using this upstream will fail to route traffic. Health checks and circuit breaker settings are lost. Safer alternatives: - GET /upstreams first: Review upstream configuration - Update services to use a different upstream first - Remove targets individually to verify impact
  9. kong-admin-delete-generic

    Medium

    DELETE request to Kong Admin API can remove configuration.

    Explanation
    DELETE requests to the Kong Admin API remove configuration objects. The specific impact depends on the endpoint: services, routes, plugins, consumers, certificates, or other Kong entities. Deletions take effect immediately. Safer alternatives: - Use GET requests first to review the resource - Export configuration with deck dump - Test changes in a staging environment
  10. kong-admin-delete-plugins

    Medium

    DELETE request to Kong Admin API removes plugins.

    Explanation
    Deleting a Kong plugin removes its functionality from the associated service, route, or consumer. Authentication, rate limiting, logging, or transformation features provided by the plugin stop immediately. Safer alternatives: - GET /plugins first: Review plugin configuration - PATCH to disable the plugin instead of deleting - Export plugin config with deck dump before deletion
  11. kong-admin-delete-targets

    Medium

    DELETE request to Kong Admin API removes targets.

    Explanation
    Deleting a Kong target removes a backend server from the upstream pool. Traffic is redistributed to remaining targets. If this was the last target, the upstream has no backends and requests fail. Safer alternatives: - GET /upstreams/{id}/targets first: List current targets - Set target weight to 0 to drain traffic first - Verify other targets can handle the load

Safe patterns

Checked first. A command that matches one is never blocked by this pack.

  • kong-version
  • kong-help
  • kong-health
  • kong-check
  • kong-config-parse
  • deck-version
  • deck-help
  • deck-ping
  • deck-dump
  • deck-diff
  • deck-validate
  • deck-convert
  • deck-file
  • kong-admin-explicit-get