OpenSearch
search.opensearch
Protects against destructive OpenSearch REST API operations and AWS CLI domain deletions.
- 12blocking rules
- 8safe patterns
- 3Critical
- 6High
- 3Medium
[packs]
enabled = ["search.opensearch"]Evaluated when a command contains opensearch, aws, curl, http, 9200, _search, _cluster, _cat, _doc, _all.
Blocking rules
Each rule ID is search.opensearch:<name>. Use it in allowlists and [policy.rules].
Criticalaws-opensearch-delete-domainaws opensearch delete-domain permanently deletes an OpenSearch domain.
Explanation
Deleting an OpenSearch domain removes the entire cluster including all indices, data, and configuration. This is irreversible and affects all applications using the domain. Automated snapshots may also be deleted. Safer alternatives: - aws opensearch describe-domain: Review domain configuration - Create a manual snapshot before deletion - Export data to S3 for long-term retention
Criticalos-curl-delete-indexcurl -X DELETE against an OpenSearch index (or _all/*) deletes data permanently.
Explanation
Deleting an OpenSearch index permanently removes all documents, mappings, and settings. Using _all or * patterns can delete multiple indices at once. This action cannot be undone without restoring from a snapshot. Safer alternatives: - _cat/indices: List indices before deletion - Create a snapshot before deleting - Close the index first if just archiving
Criticalos-http-delete-indexhttp DELETE against an OpenSearch index (or _all/*) deletes data permanently.
Explanation
Deleting an OpenSearch index permanently removes all documents, mappings, and settings. Using _all or * patterns can delete multiple indices at once. This action cannot be undone without restoring from a snapshot. Safer alternatives: - _cat/indices: List indices before deletion - Create a snapshot before deleting - Close the index first if just archiving
Highaws-opensearch-delete-inbound-connectionaws opensearch delete-inbound-connection removes an OpenSearch connection.
Explanation
Deleting an inbound connection removes cross-cluster connectivity. Applications performing cross-cluster searches or replication will fail. The connection must be re-established from the source domain. Safer alternatives: - List connections to understand dependencies - Verify no active cross-cluster operations - Update applications to use alternative data sources
Highaws-opensearch-delete-outbound-connectionaws opensearch delete-outbound-connection removes an OpenSearch connection.
Explanation
Deleting an outbound connection removes cross-cluster connectivity from this domain. Any cross-cluster searches or replication to other domains will fail. Re-establishing requires a new connection request. Safer alternatives: - List connections to understand what will be affected - Coordinate with teams using connected domains - Test connection removal in a non-production environment
Highos-curl-close-indexcurl -X POST to _close closes an index, making it unavailable for reads/writes.
Explanation
Closing an index makes it completely unavailable for search and indexing. Applications will receive errors until the index is reopened. Using _all or * can close all indices at once. Safer alternatives: - Check index status with _cat/indices first - Use specific index names instead of wildcards - Verify no active applications depend on the index
Highos-curl-delete-by-querycurl -X POST to _delete_by_query deletes documents matching the query.
Explanation
The _delete_by_query endpoint can delete large numbers of documents at once. A poorly constructed query can remove more data than intended. This operation cannot be easily undone. Safer alternatives: - Use _search with same query first to preview matches - Add conflicts=abort to stop on version conflicts - Use scroll_size to process in smaller batches
Highos-http-close-indexhttp POST to _close closes an index, making it unavailable for reads/writes.
Explanation
Closing an index makes it completely unavailable for search and indexing. Applications will receive errors until the index is reopened. Using _all or * can close all indices at once. Safer alternatives: - Check index status with _cat/indices first - Use specific index names instead of wildcards - Verify no active applications depend on the index
Highos-http-delete-by-queryhttp POST to _delete_by_query deletes documents matching the query.
Explanation
The _delete_by_query endpoint can delete large numbers of documents at once. A poorly constructed query can remove more data than intended. This operation cannot be easily undone. Safer alternatives: - Use _search with same query first to preview matches - Add conflicts=abort to stop on version conflicts - Use scroll_size to process in smaller batches
Mediumaws-opensearch-delete-packageaws opensearch delete-package removes an OpenSearch package.
Explanation
Deleting a package removes custom plugins, dictionaries, or scripts. Domains using this package may experience errors or degraded functionality. The package must be re-uploaded if needed again. Safer alternatives: - List domains using this package first - Dissociate package from domains before deletion - Keep a copy of package contents for recovery
Mediumos-curl-delete-doccurl -X DELETE against /_doc deletes a document from OpenSearch.
Explanation
Deleting individual documents removes them from search results immediately. While less destructive than bulk operations, this can affect applications expecting the document to exist. Safer alternatives: - GET the document first to verify content - Use _update API to mark as deleted instead - Ensure document ID is correct before deletion
Mediumos-http-delete-dochttp DELETE against /_doc deletes a document from OpenSearch.
Explanation
Deleting individual documents removes them from search results immediately. While less destructive than bulk operations, this can affect applications expecting the document to exist. Safer alternatives: - GET the document first to verify content - Use _update API to mark as deleted instead - Ensure document ID is correct before deletion
Safe patterns
Checked first. A command that matches one is never blocked by this pack.
os-curl-get-searchos-curl-get-catos-curl-get-cluster-healthos-http-get-searchos-http-get-catos-http-get-cluster-healthaws-opensearch-describe-domainaws-opensearch-list-domain-names