Elasticsearch
search.elasticsearch
Protects against destructive Elasticsearch REST API operations like index deletion, delete-by-query, index close, and cluster setting changes.
- 10blocking rules
- 6safe patterns
- 2Critical
- 6High
- 2Medium
[packs]
enabled = ["search.elasticsearch"]Evaluated when a command contains elasticsearch, curl, http, 9200, _search, _cluster, _cat, _doc, _all, _delete_by_query.
Blocking rules
Each rule ID is search.elasticsearch:<name>. Use it in allowlists and [policy.rules].
Criticales-curl-delete-indexcurl -X DELETE against an Elasticsearch index (or _all/*) deletes data permanently.
Explanation
Deleting an index permanently removes all documents, mappings, and settings. Using _all or * wildcards can delete multiple indices at once. This operation is immediate and irreversible. Data cannot be recovered without snapshots. Safer alternatives: - GET /_cat/indices to review before deletion - Create a snapshot before deleting - Disable action.destructive_requires_name for safety
Criticales-http-delete-indexhttp DELETE against an Elasticsearch index (or _all/*) deletes data permanently.
Explanation
Deleting an index permanently removes all documents, mappings, and settings. Using _all or * wildcards can delete multiple indices at once. This operation is immediate and irreversible. Data cannot be recovered without snapshots. Safer alternatives: - GET /_cat/indices to review before deletion - Create a snapshot before deleting - Disable action.destructive_requires_name for safety
Highes-curl-close-indexcurl -X POST to _close closes an index, making it unavailable for reads/writes.
Explanation
Closing an index blocks all read and write operations. Applications will receive errors when accessing closed indices. Closed indices still consume disk space but release memory. Use _all with extreme caution. Safer alternatives: - GET /_cat/indices to review indices first - Close specific indices rather than patterns - Use index lifecycle management for automated handling
Highes-curl-cluster-settingscurl -X PUT to /_cluster/settings changes cluster settings and can be dangerous.
Explanation
Cluster settings affect all nodes and can impact stability, performance, and data integrity. Persistent settings survive restarts. Changes to allocation, recovery, or shard settings can trigger data movement. Safer alternatives: - GET /_cluster/settings to review current values - Use transient settings for testing - Test changes on non-production clusters first
Highes-curl-delete-by-querycurl -X POST to _delete_by_query deletes documents matching the query.
Explanation
Delete-by-query removes all documents matching the query criteria. A malformed query can delete far more documents than intended. The operation runs asynchronously and cannot be easily cancelled once started. Safer alternatives: - Run the query with _search first to preview matches - Use scroll_size to limit batch size - Set wait_for_completion=false and monitor progress
Highes-http-close-indexhttp POST to _close closes an index, making it unavailable for reads/writes.
Explanation
Closing an index blocks all read and write operations. Applications will receive errors when accessing closed indices. Closed indices still consume disk space but release memory. Use _all with extreme caution. Safer alternatives: - GET /_cat/indices to review indices first - Close specific indices rather than patterns - Use index lifecycle management for automated handling
Highes-http-cluster-settingshttp PUT to /_cluster/settings changes cluster settings and can be dangerous.
Explanation
Cluster settings affect all nodes and can impact stability, performance, and data integrity. Persistent settings survive restarts. Changes to allocation, recovery, or shard settings can trigger data movement. Safer alternatives: - GET /_cluster/settings to review current values - Use transient settings for testing - Test changes on non-production clusters first
Highes-http-delete-by-queryhttp POST to _delete_by_query deletes documents matching the query.
Explanation
Delete-by-query removes all documents matching the query criteria. A malformed query can delete far more documents than intended. The operation runs asynchronously and cannot be easily cancelled once started. Safer alternatives: - Run the query with _search first to preview matches - Use scroll_size to limit batch size - Set wait_for_completion=false and monitor progress
Mediumes-curl-delete-doccurl -X DELETE against /_doc deletes a document from Elasticsearch.
Explanation
Deleting a document removes it from the index. The document ID becomes available for reuse. Applications expecting this document will receive 404 errors. Search results will no longer include this document. Safer alternatives: - GET the document first to verify - Use document versioning for conflict detection - Index a tombstone document instead of deleting
Mediumes-http-delete-dochttp DELETE against /_doc deletes a document from Elasticsearch.
Explanation
Deleting a document removes it from the index. The document ID becomes available for reuse. Applications expecting this document will receive 404 errors. Search results will no longer include this document. Safer alternatives: - GET the document first to verify - Use document versioning for conflict detection - Index a tombstone document instead of deleting
Safe patterns
Checked first. A command that matches one is never blocked by this pack.
es-curl-get-searches-curl-get-cates-curl-get-cluster-healthes-http-get-searches-http-get-cates-http-get-cluster-health