OpenSearch Domain Auditor
Quick start
Invoke when classifying an OpenSearch Service (provisioned) domain against the AWS Security Hub Foundational Security Best Practices (FSBP) controls OS.1–OS.8. Minimal live-account invocation:
Audit OpenSearch domain "logs-prod" in us-east-1.
aws opensearch describe-domain --domain-name logs-prod
aws opensearch describe-domain-config --domain-name logs-prod
aws opensearch describe-domain-access-policy --domain-name logs-prod
The verdict is the worst finding:
NO_ENCRYPTION > PUBLIC_ACCESS > NO_FGAC > CONFIG_GAP > OK.
Apply Process steps in order. Edge cases,
anti-patterns, and operational insights are in Reference.
Critical rule — confirmation gate
Every state-changing remediation (update-domain-config,
update-domain-access-policy, delete-domain, create-domain) is blocked
until the operator confirms. Emit and halt:
CONFIRM: About to <action> on domain <name>. This affects <consequence>. Proceed? (yes/no)
This gate is non-negotiable and applies to every remediation command without exception — including log-publishing updates, master-node resize, HTTPS-enforcement toggles, and access-policy edits. OpenSearch mutations can take 30 minutes to several hours (blue/green deployment that doubles node count — cost spike), and some changes (encryption-at-rest, NTN, VPC-vs-public endpoint) are immutable and require full domain recreation. Do not batch-confirm; prompt once per action.
Decision tree — severity thresholds
| Condition | Verdict | Step | FSBP |
|---|---|---|---|
EncryptionAtRestOptions.Enabled: false (or absent) |
NO_ENCRYPTION | 1a | OS.1 |
Principal: "*" + es:ESHttp*/es:* + no STRONG condition (non-VPC) |
PUBLIC_ACCESS | 2a | OS.3 |
Principal: "*" + DATA_PLANE + STRONG (aws:SourceAccount/aws:SourceArn) |
Downgrade (NO_FGAC if FGAC off) | 2b | OS.3 |
AdvancedSecurityOptions.Enabled: false on internet-facing domain |
NO_FGAC | 3a | OS.3 |
AdvancedSecurityOptions.Enabled: false on VPC domain |
CONFIG_GAP | 3b | OS.4 |
NodeToNodeEncryptionOptions.Enabled: false (at-rest on) |
CONFIG_GAP | 4a | OS.2/OS.8 |
Dedicated master t2/t3.small.search, count 1/2, or none |
CONFIG_GAP | 4b | — |
LogPublishingOptions missing SEARCH_SLOW_LOGS AND INDEX_SLOW_LOGS |
CONFIG_GAP | 4c | OS.6/OS.7 |
DomainEndpointOptions.EnforceHTTPS: false |
CONFIG_GAP | 4d | OS.5 |
KmsKeyId is aws/es or absent |
CONFIG_GAP | 4e | OS.1 |
InstanceCount >= 2 + ZoneAwarenessEnabled: false |
CONFIG_GAP | 4f | — |
EngineVersion: Elasticsearch_X.Y (legacy fork) |
CONFIG_GAP | 4g | — |
| All dimensions clean | OK | 5 | — |
Worst finding wins. VPC domains skip Step 2 (no internet endpoint).
Mindset
OpenSearch is unusual among AWS data services: the resource-based policy gates
both the configuration API (es:DescribeDomain) and the data plane
(es:ESHttp* — full REST API: read every document, delete every index, change
every mapping). A pattern safe for S3 or KMS (Principal: "*" with
aws:SourceIp) is not safe for OpenSearch — aws:SourceIp is bypassable
via VPN/NAT and there are no per-object ACLs as a fallback.
Three counter-intuitive facts drive most misclassifications:
(1) encryption-at-rest and node-to-node encryption are both immutable
post-creation — no toggle, the remediation is a full reindex migration;
(2) FGAC cannot be enabled without NTN, which requires HTTPS — so a NO_FGAC
finding often hides a deeper immutable NTN root cause;
(3) the access policy is evaluated before FGAC, so a wildcard principal
grants data-plane access even when FGAC is on.
Process — Classification logic
Apply in order, aggregate worst. See Reference for the operational reasoning behind each rule.
Step 1: Encryption-at-rest (NO_ENCRYPTION)
Enabled: falseor absent → NO_ENCRYPTION (CRITICAL). Data at rest is plaintext — every snapshot, EBS volume, and backup. PCI-DSS 3.4, HIPAA 164.312(a)(2)(iv), SOC2 CC6.1 violation. Remediation is always domain recreation (encryption is immutable); do not emit "enable encryption" guidance. Short-circuits to Step 5.Enabled: true+KmsKeyId: aws/esor absent → CONFIG_GAP finding. The AWS-OWNED keyaws/esis opaque: no CloudTrailkms:Decryptevents (the service calls Decrypt on its own principal), no rotation control, no customer key policy. See Reference: aws/es opacity.Enabled: true+ customer-managed CMK ARN → OK on this dimension.
Step 2: Public access via resource policy (PUBLIC_ACCESS)
Skip for VPC domains. For each Effect: Allow statement, classify:
- Principal: WILDCARD (
"*",{"AWS": "*"},{"Service": "*"}) | CROSS_ACCOUNT (different 12-digit account) | SAME_ACCOUNT. - Action: DATA_PLANE (
es:ESHttp*,es:*,es:ESHttpGet/Post/Put/Delete) | CONFIGURATION_PLANE (es:Describe*,es:UpdateDomainConfig) | read-only DATA_PLANE (es:ESHttpGetonly). - Condition: STRONG (
aws:SourceArn/aws:SourceAccountwithStringEquals— set by AWS infrastructure, not caller-controlled) | WEAK (aws:SourceIpwith real CIDR — bypassable by VPN/NAT/proxy) | NONE (no condition, or0.0.0.0/0).
| # | Principal | Action | Condition | Verdict |
|---|---|---|---|---|
| 2a | WILDCARD | DATA_PLANE / es:* |
None/Weak | PUBLIC_ACCESS |
| 2b | WILDCARD | DATA_PLANE | Strong | Downgrade (NO_FGAC if FGAC off) |
| 2c | CROSS_ACCOUNT | DATA_PLANE | None/Weak | PUBLIC_ACCESS |
| 2d | WILDCARD/CROSS | CONFIGURATION_PLANE only | None/Weak | CONFIG_GAP (metadata leak) |
| 2e | WILDCARD/CROSS | Any | Strong | Downgrade one level |
| 2f | SAME_ACCOUNT | Any | Any | OK |
The account-root statement (Principal: {"AWS": "arn:aws:iam::ACCOUNT:root"}
es:*) is the standard IAM-delegation pattern — classify as SAME_ACCOUNT/OK.
Step 3: Fine-grained access control (NO_FGAC)
Enabled: false+ internet-facing (no VPCOptions) → NO_FGAC (HIGH). Without FGAC, the resource policy alone determines access. Any principal withes:ESHttp*has unrestricted access to every index — no per-index role, no document-level security, no field masking. Remediation prerequisite is NTN (Step 4a) — flag the dependency.Enabled: false+ VPC domain → CONFIG_GAP (MEDIUM). VPC is the network boundary, reducing exposure. But defense-in-depth still recommends FGAC for blast-radius containment.Enabled: true→ OK. Flag CONFIG_GAP finding ifInternalUserDatabaseEnabled: trueand master credentials are not in Secrets Manager (loss of internal master password is unrecoverable without disabling FGAC — a destructive operation that wipes all role mappings).
Step 4: Configuration gaps (CONFIG_GAP — additive)
Each finding adds to FINDINGS; none changes the verdict on its own.
- 4a NTN off:
NodeToNodeEncryptionOptions.Enabled: false. Inter-node traffic plaintext. Required for FGAC and HTTPS. Immutable post-creation — domain recreation only. - 4b Master node:
DedicatedMasterEnabled: false(election storms);DedicatedMasterCount: 1(SPOF) or2(no quorum — AWS requires 3 for HA);DedicatedMasterType: t2/t3.small.search(below m5.large.search minimum, CPU-credit exhaustion silently drops cluster-state API calls). Master type/count IS mutable viaupdate-domain-config(blue/green). - 4c Slow logs:
SEARCH_SLOW_LOGSorINDEX_SLOW_LOGSabsent/disabled. Slow queries invisible. Threshold calibration lives in_cluster/settings, not describe output. - 4d HTTPS off:
EnforceHTTPS: false. Plaintext HTTP to data plane. Auto-false when NTN off. Mutable. - 4e AWS-managed key:
KmsKeyIdisaws/esor absent. No customer audit trail, rotation, or key policy. Migration requires domain recreation. - 4f Single-AZ multi-node:
InstanceCount >= 2+ZoneAwarenessEnabled: false. All nodes in one AZ — AZ failure takes cluster down. - 4g Legacy engine:
EngineVersion: Elasticsearch_X.Y. No new features since fork; eventual forced upgrade. Not a verdict driver but always emit.
Step 5: Aggregation
Precedence: NO_ENCRYPTION > PUBLIC_ACCESS > NO_FGAC > CONFIG_GAP > OK. All
findings listed in FINDINGS; verdict is the worst single step's verdict.
Output format (per domain)
Emit one block per domain in this field order. For batch/multi-domain input, process each independently — emit blocks sequentially. If one domain errors, emit its ERROR block and continue.
DOMAIN: <domain-name>
VERDICT: NO_ENCRYPTION | PUBLIC_ACCESS | NO_FGAC | CONFIG_GAP | OK | ERROR
REASON: <1-2 sentences citing the worst finding and step number>
FINDINGS:
- [SEVERITY] <finding description (Step N)>
REMEDIATION: <specific action per finding, or "None required" if OK>
Immutable-vs-mutable scope: Only at-rest encryption (Step 1a) and NTN
(Step 4a) require domain recreation — state "requires domain recreation
(immutable)" for these. Master-node type/count (Step 4b), HTTPS (Step 4d),
slow-log publishing (Step 4c), and FGAC (Step 3) ARE mutable in-place via
update-domain-config (blue/green deployment) — state "in-place via
update-domain-config" for these. Never confuse the two.
Error handling: If input JSON is invalid, missing DomainStatus, or the
access-policy fetch failed, emit VERDICT: ERROR with the specific cause. If
the API returns ThrottlingException, retry once with exponential backoff; if
AccessDeniedException, state the required IAM permission. Do NOT fabricate a
verdict on API failure.
Worked example — public wildcard + FGAC off
DOMAIN: logs-prod
VERDICT: PUBLIC_ACCESS
REASON: Access policy grants es:ESHttp* to Principal "*" with no restrictive
condition (Step 2a) — any AWS account holder can read/write every document.
FGAC is also disabled, compounding the exposure.
FINDINGS:
- [PUBLIC_ACCESS] Principal "*" + es:ESHttp* with no condition (Step 2a)
- [NO_FGAC] AdvancedSecurityOptions.Enabled is false on internet-facing domain (Step 3a)
- [CONFIG_GAP] KmsKeyId is aws/es — no CloudTrail audit trail (Step 4e)
- [OK] NodeToNodeEncryptionOptions.Enabled is true (Step 4a)
REMEDIATION:
1. PUBLIC_ACCESS — Remove wildcard principal. Replace with named ARNs or
aws:SourceAccount. Back up policy first (NOT versioned — no rollback):
aws opensearch describe-domain-access-policy --domain-name logs-prod > /tmp/logs-prod-policy-backup.json
2. Assume breach. Audit CloudTrail for es:ESHttp* from external principals.
3. NO_FGAC — In-place via update-domain-config (blue/green): enable FGAC with
IAM master:
aws opensearch update-domain-config --domain-name logs-prod
--advanced-security-options 'Enabled=true,InternalUserDatabaseEnabled=false,MasterUserOptions={MasterUserARN=arn:aws:iam::111111111111:role/opensearch-master}'
4. CONFIG_GAP — Plan CMK migration: requires domain recreation (immutable).
Reference
Consult when the audit hits an edge case. These operational behaviors are NOT in AWS documentation and change classification if ignored.
Pre-flight: domain attributes that short-circuit the audit
| Attribute | Effect |
|---|---|
VPCOptions present |
VPC domain. Skip Step 2. FGAC downgrades to CONFIG_GAP. Endpoint is private DNS. |
VPCOptions absent |
Public endpoint. Steps 2-3 at full severity. Endpoint is public DNS. |
EngineVersion: Elasticsearch_X.Y |
Legacy fork. Note as CONFIG_GAP (Step 4g). |
Processing: true |
Blue/green in flight. update-domain-config queues silently (see below). |
CustomEndpointEnabled: true |
Clients use custom DNS/cert, not describe endpoint. Cert expiry invisible in describe output. |
Default-VPC trap: a domain in the default VPC with public subnets is
effectively internet-facing despite having VPCOptions — the default VPC has
an internet gateway and public subnets by default. Check whether subnets have a
route to 0.0.0.0/0 via IGW. Treat default-VPC domains with PUBLIC_ACCESS
severity unless route table confirms no IGW path.
aws/es CloudTrail opacity
The aws/es AWS-OWNED key is distinct from AWS-managed CMKs like aws/s3.
The OpenSearch service calls kms:Decrypt on its own service principal —
the customer sees zero kms:Decrypt events in CloudTrail for data access.
Contrast with S3's aws/s3 AWS-managed key, where Decrypt events DO appear in
the customer's CloudTrail. A customer-managed CMK provides full CloudTrail
visibility, customer-controlled rotation, and a customer-authored key policy.
This is why aws/es is a CONFIG_GAP finding even when Enabled: true — the
data is encrypted but the customer has no audit trail for when it was
accessed by the service.
describe-domain-access-policy is a separate API call
Unlike S3 (get-bucket-policy returns inline) or RDS, OpenSearch's resource
policy is not embedded in describe-domain / describe-domain-config
output. It requires a separate describe-domain-access-policy call. Auditors
and CI/CD scripts that use only describe-domain-config silently skip the
entire PUBLIC_ACCESS check (Step 2). A domain with no resource policy
attached returns empty Policy document — this is OK (account-level IAM is
the gate), NOT an error. Many automation scripts treat empty Policy as a
fetch failure and silently skip the access-policy check.
update-domain-config silently queues behind in-progress blue/green
If a blue/green deployment is already running (Processing: true), a new
update-domain-config call returns HTTP 200 immediately but does not
execute — it queues silently behind the in-flight deployment. The operator
believes the change applied when it has not. Always check
DomainStatus.Processing before recommending any update. There is no API to
list queued updates — they are invisible until they execute (or are overwritten
by a newer call, which discards the queued one).
Blue/green shard stall. When shard count exceeds ~1000 per data node (the
default soft limit), the shard-relocation phase stalls — HTTP 200 but domain
hangs in "Processing" for hours, invisible in describe output. Recommend
pre-flight _cat/shards (data-plane call) for large domains.
FGAC disablement is destructive and non-reversible
Disabling FGAC wipes the entire Security plugin state: all roles, role
mappings, action groups, and the internal user database. Re-enabling creates a
fresh state — all per-index controls must be rebuilt. You cannot "test" FGAC
by toggling it. The Security plugin REST API path also depends on engine
version: _opendistro/_security/api/ for Elasticsearch ≤7.9 vs
_plugins/_security/api/ for OpenSearch 1.1+. Wrong path returns 404.
Cross-cluster search / replication security inversion
CCS does not propagate FGAC. When domain A registers domain B as a remote
(cluster.remote.<alias>.seeds), queries from A to B run as A's connection
identity, not the end-user's. FGAC role mappings, document-level security,
and field masking on B are NOT enforced for CCS queries. A "sanitized" local
domain querying a hardened remote inherits the remote's data without the
remote's per-index enforcement. Flag any CCS wiring as CONFIG_GAP.
CCR inverts the risk. The follower needs write permissions on the leader
(indices:admin/index_template/create, indices:data/write/index), expanding
the leader's write surface. Flag CONFIG_GAP if follower's role ARN is not in
the access policy.
Anti-Patterns — NEVER
- NEVER recommend "enable encryption-at-rest" or "enable NTN" as an in-place fix. Both are immutable post-creation. Only remediation is domain recreation with a reindex. Confusing OpenSearch's immutable encryption with services that allow toggling (S3, EBS) is a common auditor mistake.
- NEVER classify a VPC-backed domain as PUBLIC_ACCESS regardless of access policy. VPC endpoints are not internet-reachable; SG/route table is the network boundary. (Wildcard principal is still NO_FGAC/CONFIG_GAP.)
- NEVER treat
aws:SourceIp(real CIDR) as a STRONG condition for a public OpenSearch domain. VPN/NAT/proxy bypass. Onlyaws:SourceArn/aws:SourceAccount. - NEVER flag
Enabled: true+aws/esas NO_ENCRYPTION. Data IS encrypted; gap is customer control (no CloudTrail, rotation, key policy) = CONFIG_GAP. - NEVER assume FGAC is on because the access policy is restrictive. FGAC is
independent; always check
AdvancedSecurityOptions.Enabledseparately. - NEVER enable FGAC without first verifying NTN + HTTPS enforcement. FGAC
requires NTN, NTN requires HTTPS. Returns
ValidationExceptionotherwise. - NEVER recommend
DedicatedMasterCount< 3 for HA. Three across 3 AZs is minimum quorum. Count 1 = SPOF; count 2 = no quorum. - NEVER classify
t2/t3.small.searchas adequate for dedicated masters on production domains. Below m5.large.search+ recommendation. Burstable masters silently drop cluster-state API calls under CPU-credit exhaustion. - NEVER state master-node resize requires domain recreation. Master
type/count changes ARE mutable via
update-domain-config(blue/green). Only at-rest encryption and NTN are immutable. - NEVER assume CCS propagates FGAC. CCS authenticates as the connection principal, bypassing remote per-index roles/DLS/masking. Flag as CONFIG_GAP.
- NEVER assume a default-VPC domain is private. Default VPC has IGW + public subnets. Check route tables before classifying as VPC-protected.
- NEVER conflate provisioned OpenSearch with Serverless. Serverless uses
aoss:API*, always encrypted, OCU capacity. This skill is provisioned only.
Pre-flight safety (before remediation CLI)
- MANDATORY confirmation gate for every state-changing operation — emit CONFIRM prompt and halt. Applies to ALL updates without exception.
- Back up the access policy before any change — OpenSearch access policies
are NOT versioned (no version ID, no rollback, unlike IAM policies which have
version identifiers):
aws opensearch describe-domain-access-policy --domain-name <name> --output json > /tmp/<name>-policy-backup-$(date +%s).json - Snapshot before encryption/NTN migration — domain recreation without a snapshot loses all data. Manual snapshot to registered S3 repo required.
- Blue/green cost spike — provisions parallel fleet (cost briefly doubles). Surface in CONFIRM gate.
- Verify caller IAM — read-only auditor roles lack
opensearch:UpdateDomainConfig; remediation fails withAccessDeniedException. - NEVER disable FGAC as remediation — wipes all roles/mappings/users.
Recent AWS features (2024-2026)
- OpenSearch Serverless GA (2024-2025): OpenSearch Serverless provides auto-scaling search and analytics without cluster management. Auditors should note that Serverless collections have a different audit surface than provisioned domains — verify encryption, VPC access, and data-access policies at the collection level.
- Security Analytics (2024): OpenSearch Security Analytics provides threat detection rules and alerting on log data. Auditors should verify that security analytics detectors are configured for compliance-relevant log types (CloudTrail, VPC Flow Logs).
- Fine-grained access control improvements (2024): Enhanced FGAC with roles-based access control. Auditors should verify that the master user is not a shared account and that backend roles are scoped appropriately.
- SAML authentication enhancements (2024-2025): Improved SAML integration for OpenSearch Dashboards. Auditors should verify that SAML provider metadata is current and that IdP-initiated SSO is configured correctly.
Domain
AWS CloudOps / OpenSearch Analytics Security & Compliance.
AWS documentation
- Amazon OpenSearch Service Developer Guide — https://docs.aws.amazon.com/opensearch-service/latest/developerguide/what-is.html
- OpenSearch API Reference — https://docs.aws.amazon.com/opensearch-service/latest/APIReference/
- OpenSearch Security — https://docs.aws.amazon.com/opensearch-service/latest/developerguide/security.html
- Fine-grained access control — https://docs.aws.amazon.com/opensearch-service/latest/developerguide/fgac.html
- OpenSearch CLI reference — https://docs.aws.amazon.com/cli/latest/reference/opensearch/