dcg

RabbitMQ

messaging.rabbitmq

Protects against destructive RabbitMQ operations like deleting queues/exchanges, purging queues, deleting vhosts, and resetting cluster state.

  • 9blocking rules
  • 6safe patterns
  • 5Critical
  • 4High
~/.config/dcg/config.toml
[packs]
enabled = ["messaging.rabbitmq"]

Evaluated when a command contains rabbitmqadmin, rabbitmqctl.

Blocking rules

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

  1. rabbitmqadmin-delete-queue

    Critical

    rabbitmqadmin delete queue permanently deletes a queue.

    Explanation
    Deleting a queue permanently removes all messages and bindings. Consumers will disconnect, and producers will fail unless they handle the missing queue. Undelivered messages are lost. Safer alternatives: - rabbitmqadmin list queues: Review queues first - rabbitmqadmin purge queue: Remove messages but keep the queue - Set TTL or max-length policies for automatic cleanup
  2. rabbitmqctl-delete-queue

    Critical

    rabbitmqctl delete_queue deletes the queue and ALL messages in it.

    Explanation
    Deleting a queue removes its messages permanently and breaks every consumer and binding that refers to it. Safer alternatives: - rabbitmqctl list_queues name messages consumers: Check it first - rabbitmqctl delete_queue <name> --if-empty --if-unused: Refuse when in use
  3. rabbitmqctl-delete-vhost

    Critical

    rabbitmqctl delete_vhost removes a vhost and all its resources.

    Explanation
    Deleting a vhost removes ALL queues, exchanges, bindings, policies, and user permissions within that vhost. This is a complete wipe of that namespace. Safer alternatives: - rabbitmqctl list_vhosts: Review vhosts first - rabbitmqctl list_queues -p <vhost>: Check resources in vhost - Export definitions before deletion
  4. rabbitmqctl-force-reset

    Critical

    rabbitmqctl force_reset wipes node data and can break cluster state.

    Explanation
    Force reset ignores cluster state and wipes the node unconditionally. This can leave the cluster in an inconsistent state where other nodes still expect this node to exist. Safer alternatives: - Try rabbitmqctl reset first (safer) - Coordinate with cluster members before force reset - Document the cluster state for recovery
  5. rabbitmqctl-reset

    Critical

    rabbitmqctl reset wipes all configuration, queues, and bindings on the node.

    Explanation
    Reset returns the node to a blank state, removing all exchanges, queues, bindings, users, vhosts, and permissions. The node is removed from any cluster it was part of. Safer alternatives: - Export definitions before reset - Use stop_app/start_app for service restart without data loss - Consider forget_cluster_node for cluster membership changes only
  6. rabbitmqadmin-delete-exchange

    High

    rabbitmqadmin delete exchange removes an exchange and its bindings.

    Explanation
    Deleting an exchange removes all bindings to queues. Messages published to this exchange will be lost unless an alternate exchange is configured. Publishers may not receive errors if they don't use confirms. Safer alternatives: - rabbitmqadmin list exchanges: Review exchanges first - rabbitmqadmin list bindings: Check dependent bindings - Rebind queues to a new exchange before deletion
  7. rabbitmqadmin-purge-queue

    High

    rabbitmqadmin purge queue deletes ALL messages in the queue.

    Explanation
    Purging a queue deletes all messages immediately. Messages that were waiting to be consumed are permanently lost. This cannot be undone. Safer alternatives: - rabbitmqadmin show queue: Check message count first - Consume and process messages instead of purging - Set message TTL for automatic expiration
  8. rabbitmqctl-forget-cluster-node

    High

    rabbitmqctl forget_cluster_node permanently removes a node from the cluster.

    Explanation
    Forgetting a cluster node removes it from the cluster metadata. Use this only for permanently failed nodes. Mirrored queues may lose replicas, and quorum queues may lose availability if quorum is affected. Safer alternatives: - rabbitmqctl cluster_status: Review cluster state first - Try to recover the node instead of forgetting - Ensure quorum is maintained after removal
  9. rabbitmqctl-purge-queue

    High

    rabbitmqctl purge_queue deletes ALL messages in the queue.

    Explanation
    Purging a queue deletes every message waiting to be consumed. This cannot be undone. Safer alternatives: - rabbitmqctl list_queues name messages: Check the message count first - Consume and process messages instead of purging

Safe patterns

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

  • rabbitmqadmin-list
  • rabbitmqadmin-show
  • rabbitmqctl-status
  • rabbitmqctl-list-queues
  • rabbitmqctl-cluster-status
  • rabbitmqctl-report