# Elbv2 Load Balancer Auditor

> Audits AWS ELBv2 load balancers (ALB/NLB) for insecure TLS listener policies (TLS 1.0/1.1, weak ciphers, cleartext HTTP), disabled access logs, permissive security groups (all-ports-open, internal-LB-exposed-to-internet), idle load balancers with zero healthy targets, disabled cross-zone load balancing (NLB), and missing deletion protection. Emits a deterministic categorical verdict (INSECURE_LISTENER | NO_ACCESS_LOGS | PERMISSIVE_SG | IDLE | CONFIG_GAP | OK) per load balancer with enumerated findings and specific CLI remediation. Use when reviewing ALB or NLB configurations, checking listener TLS posture, validating access-log enablement, auditing security group exposure, finding idle or abandoned load balancers, or hardening load balancer posture before production deployment.

- Skill: `jhkchan/elbv2-load-balancer-auditor` (Agent Skill, multi-file: 20 files)
- Install (CLI): `npx get-skill add jhkchan/elbv2-load-balancer-auditor`
- Raw SKILL.md: https://api.skillmd.com/api/skills/jhkchan/elbv2-load-balancer-auditor/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- License: Apache-2.0
- Author: jhkchan (https://skillmd.com/u/jhkchan)
- Updated: 2026-11-23
- Page: https://skillmd.com/skills/jhkchan/elbv2-load-balancer-auditor

---


# ELBv2 Load Balancer Auditor

## Mindset

**One-line takeaway:** the verdict is always the **worst** finding across all
dimensions, and the most dangerous finding is an insecure listener — TLS 1.0/1.1
negotiation means an attacker on the network path can downgrade and decrypt
traffic with BEAST, POODLE, or CRIME-family attacks.

ELBv2 load balancers are the network ingress point for most AWS workloads.
- **TLS termination** happens at the LB for HTTPS/TLS listeners. The
  `SslPolicy` determines which protocol versions and cipher suites clients can
  negotiate. A permissive policy silently accepts a downgrade to TLS 1.0 — the
  client never sees it, and the operator never knows unless they audit the
  policy by name.
- **Access logs** are the forensic trail. Without them, a breach investigation
  has zero request-level signal — no source IPs, no paths, no response codes.
- **Security groups** on an ALB control who can reach the LB. An all-ports-open
  rule on an internet-facing ALB exposes every listener (including future ones)
  to the entire internet.

## Quick reference — verdict priority (worst finding wins)

| Priority | Verdict | Severity | What triggers it | Step |
|---|---|---|---|---|
| 1 | **INSECURE_LISTENER** | CRITICAL | TLS 1.0/1.1 in SslPolicy; weak ciphers; HTTP-only with no HTTPS redirect | Step 1 |
| 2 | **PERMISSIVE_SG** | HIGH | SG open to 0.0.0.0/0 on ports beyond the listener set; all-ports-open | Step 2 |
| 3 | **NO_ACCESS_LOGS** | HIGH | AccessLogsEnabled is false on ALB; access_logs.s3.enabled false on NLB | Step 3 |
| 4 | **IDLE** | MEDIUM | Zero registered targets, or all targets unhealthy | Step 4 |
| 5 | **CONFIG_GAP** | MEDIUM | NLB cross-zone off; deletion protection off (additive) | Step 5 |
| 6 | **OK** | LOW | All dimensions pass | Step 6 |

If multiple findings exist, the **highest-priority** (lowest number) verdict
wins. Additional findings appear in the FINDINGS list but do not change the
verdict.

## Pre-flight: load balancer type gate (run before classification)

The load balancer type determines which checks apply. Misidentifying the type
produces false positives.

| Attribute | Value | Effect on audit |
|---|---|---|
| `Type` | `application` | **ALB.** Full audit: TLS/cipher (Step 1), SG (Step 2), access logs (Step 3), target health (Step 4), deletion protection (Step 5). Cross-zone is **always on** — do NOT evaluate it. |
| `Type` | `network` | **NLB.** TLS/cipher check applies ONLY to TLS-protocol listeners (not TCP passthrough). SG check applies if the NLB has an attached SG (supported since 2023; older NLBs may have none). Cross-zone is **off by default** — evaluate it (Step 5). |
| `Scheme` | `internet-facing` | The LB has public IP addresses. SG allowing 0.0.0.0/0 on ports 80/443 is **expected and OK**. |
| `Scheme` | `internal` | The LB has private IP addresses. SG allowing 0.0.0.0/0 on **any** port is PERMISSIVE_SG — internal LBs should be restricted to known CIDRs (VPC, peered ranges). |
| `State` | `failed` | The LB is in a failed provisioning state. Output ERROR. Do not classify. |

**If the listener/SG/target input is missing or malformed**, output:

```text
LB: <arn>
VERDICT: ERROR
REASON: Load balancer configuration is incomplete or malformed — cannot classify.
REMEDIATION: Retrieve full config with aws elbv2 describe-load-balancers, describe-listeners, describe-target-groups, describe-target-health.
```

## Process — Classification logic (apply in order, aggregate worst)

### Step 0: Expert knowledge — non-obvious ELBv2 behaviors that change classification
Step-0 expert-knowledge deep dive (ALB cross-zone always on, default SslPolicy insecurity, NLB TCP listeners, HTTP-redirect pattern, access-log silent failure, 5-min NLB log granularity, deletion protection, ALB SG vs target SG, WAF ALB-only, deregistration delay, TLS-version log blindness, TCP health checks, preserve_client_ip) moved verbatim to [references/advanced-patterns.md](references/advanced-patterns.md).
Load on demand before classifying — each behavior changes a verdict if ignored.

### Step 1: Listener TLS security evaluation — INSECURE_LISTENER

For each listener on the load balancer:

**TLS protocol version check (HTTPS/TLS listeners):**

Classify the `SslPolicy` by known-name lookup first, then by explicit
protocol/cipher list if provided:

**INSECURE policies (include TLS 1.0 or TLS 1.1):**

| Policy name | TLS versions | Notes |
|---|---|---|
| `ELBSecurityPolicy-2015-05` | 1.0, 1.1, 1.2 | Legacy. |
| `ELBSecurityPolicy-2016-08` | 1.0, 1.1, 1.2 | **AWS default.** Most common in production. |
| `ELBSecurityPolicy-TLS-1.0-2015-04` | 1.0, 1.1, 1.2 | Explicitly TLS 1.0. |
| `ELBSecurityPolicy-TLS-1-0-2015-04` | 1.0, 1.1, 1.2 | Same, alternate naming. |
| `ELBSecurityPolicy-FS-1-1-2019-08` | 1.1, 1.2 | Forward Secrecy but TLS 1.1 is deprecated. |

Any listener using one of these policies → **INSECURE_LISTENER** (CRITICAL).

**ACCEPTABLE policies (TLS 1.2+ only, strong ciphers):**

| Policy name | TLS versions | Notes |
|---|---|---|
| `ELBSecurityPolicy-TLS13-1-2-2021-06` | 1.3, 1.2 | **Current best practice.** |
| `ELBSecurityPolicy-TLS13-1-2-Res-2021-06` | 1.3, 1.2 | Resizable cipher (FIPS). |
| `ELBSecurityPolicy-FS-1-2-2019-08` | 1.2 | Forward Secrecy, TLS 1.2 only. |
| `ELBSecurityPolicy-TLS-1-2-2017-01` | 1.2 | TLS 1.2 only (no FS guarantee but acceptable). |
| `ELBSecurityPolicy-TLS-1-2-ext-2018-06` | 1.2 | Extended cipher suites, TLS 1.2 only. |

**Custom policies:** If the SslPolicy name does not match any known policy,
evaluate the explicit `Protocols` and `Ciphers` lists if provided:
- If `Protocol-TLSv1` or `Protocol-TLSv1.1` is in the Protocols → INSECURE.
- If any weak cipher is enabled (RC4-MD5, RC4-SHA, DES-CBC3-SHA, ECDHE-RCA
  variants) → INSECURE.
- If only TLS 1.2+ and AEAD ciphers (GCM, ChaCha20-Poly1305) → OK.

**Cleartext HTTP listener check:**

For each HTTP (non-HTTPS) listener:
- If the listener has a `redirect` action to HTTPS → **OK** for this listener.
- If the listener has a `forward` action and NO HTTPS/TLS listener exists on
  the same LB → **INSECURE_LISTENER** (cleartext traffic with no encrypted
  alternative).
- If the listener has a `forward` action AND an HTTPS/TLS listener exists →
  **OK** (HTTP serves non-sensitive content; HTTPS handles encrypted traffic).

**NLB TCP listener:** No TLS evaluation — skip. The NLB does not terminate
TLS for TCP listeners. If end-to-end encryption is required, note it as an
operational recommendation but do NOT classify as INSECURE_LISTENER.

### Step 2: Security group exposure evaluation — PERMISSIVE_SG

Evaluate each inbound rule on every SG attached to the load balancer.

**CRITICAL — all-ports-open to internet:**
Any SG rule with source `0.0.0.0/0` or `::/0` on port range `0-65535` (or
`all`) → **PERMISSIVE_SG** (CRITICAL). This exposes every current and future
listener to the entire internet.

**HIGH — internet-open on non-listener ports (internet-facing LB):**
For an `internet-facing` LB, a SG rule with source `0.0.0.0/0` or `::/0` on
a port that is NOT one of the listener ports → **PERMISSIVE_SG** (HIGH). The
SG should only expose the ports the listeners actually use.

**HIGH — internet-open on any port (internal LB):**
For an `internal` LB, ANY SG rule with source `0.0.0.0/0` or `::/0` →
**PERMISSIVE_SG** (HIGH). Internal LBs should only be reachable from known
CIDRs (VPC ranges, peered networks, VPN).

**OK — internet-facing LB with 0.0.0.0/0 on listener ports only:**
For an `internet-facing` ALB with listeners on ports 80 and 443, SG rules
allowing `0.0.0.0/0` on TCP 80 and TCP 443 → **OK**. This is the expected
posture for a public-facing load balancer.

### Step 3: Access logs evaluation — NO_ACCESS_LOGS

**ALB:** Check `LoadBalancerAttributes` for
`access_logs.s3.enabled`. If `false` (or absent) → **NO_ACCESS_LOGS** (HIGH).
Access logs are the only per-request forensic signal for an ALB — without
them, incident response cannot reconstruct source IPs, request paths, or
response codes.

**NLB:** Check `LoadBalancerAttributes` for
`access_logs.s3.enabled`. Same logic as ALB. NLB access logs capture
connection-level telemetry (source IP, port, TLS handshake details for TLS
listeners).

**If enabled:** OK for this dimension. Note: the S3 bucket policy must
correctly grant the ELB service principal write access — if logs are enabled
but the bucket policy is wrong, logs silently fail. This is a live-account
follow-up, not classifiable from the LB config alone.

### Step 4: Target health and idle evaluation — IDLE

Check each target group associated with the load balancer via listener
default actions or rules.

**IDLE — zero registered targets:**
If every target group has zero registered targets (TargetHealthDescriptions
is empty or all targets are in `unused` state) → **IDLE** (MEDIUM). The LB
is accepting traffic on its listeners but has nowhere to send it — clients
receive 502 (Bad Gateway) or 503 (Service Unavailable). This is typically a
forgotten LB from a decommissioned service.

**IDLE — all targets unhealthy:**
If every registered target across all target groups is `unhealthy` → **IDLE**
(MEDIUM). The LB is live but not serving traffic. This may be a transient
outage (health-check failure) or a permanently broken deployment.

**OK — at least one healthy target:**
If at least one target group has at least one `healthy` target → OK for this
dimension.

### Step 5: Configuration best practices — CONFIG_GAP

These are additive findings that do not override higher-priority verdicts but
are reported in the FINDINGS list.

**NLB cross-zone load balancing disabled:**
If the LB type is `network` and `load_balancing.cross_zone.enabled` is `false`
→ CONFIG_GAP finding. Cross-zone off means traffic is distributed per-AZ,
which can lead to uneven distribution if one AZ has more capacity than
another. Enabling it incurs inter-AZ data transfer charges but improves
availability and distribution. Note: ALB cross-zone is always on — never
evaluate this for ALB.

**Deletion protection disabled:**
If `deletion_protection.enabled` is `false` → CONFIG_GAP finding. Without
deletion protection, `aws elbv2 delete-load-balancer` succeeds without a
second confirmation. An accidental deletion (script error, IaC teardown)
destroys the LB and all listener/rule configurations — there is no undo.

**HTTP desync mitigation mode not strict (ALB only):**
If `routing.http.desync_mitigation_mode` is `monitor` → CONFIG_GAP finding.
Monitor mode logs HTTP request smuggling attempts but does not block them.
`defensive` (default) or `strict` is recommended for production.

If none of these apply → OK for this dimension.

### Step 6: Aggregation — worst finding wins

The final verdict is the **highest-priority** finding across all steps, where
INSECURE_LISTENER > PERMISSIVE_SG > NO_ACCESS_LOGS > IDLE > CONFIG_GAP > OK:

```text
verdict = first_match(Step1, Step2, Step3, Step4, Step5, OK)
```

If no findings (all dimensions pass), the verdict is **OK**.

## Output format (per load balancer)

```text
LB: <arn or name>
VERDICT: INSECURE_LISTENER | NO_ACCESS_LOGS | PERMISSIVE_SG | IDLE | CONFIG_GAP | OK
REASON: <1-2 sentences citing the worst finding and its step number>
FINDINGS:
  - [CRITICAL] <finding description (Step N)>
  - [HIGH] <finding description (Step N)>
  - [OK] <dimension that passed>
REMEDIATION: <specific action per finding, or "None required" if OK>
```

### Worked example — TLS 1.0 policy with access logs disabled

```text
LB: arn:aws:elasticloadbalancing:us-east-1:111111111111:load-balancer/app/prod-web/abc123
VERDICT: INSECURE_LISTENER
REASON: HTTPS listener on port 443 uses ELBSecurityPolicy-TLS-1.0-2015-04
which enables TLS 1.0/1.1 — traffic is vulnerable to protocol-downgrade
attacks (Step 1). Access logs are also disabled (Step 3).
FINDINGS:
  - [CRITICAL] HTTPS:443 SslPolicy ELBSecurityPolicy-TLS-1.0-2015-04 includes
    TLS 1.0/1.1 — deprecated by PCI-DSS, vulnerable to BEAST/POODLE (Step 1)
  - [HIGH] Access logs disabled — no per-request forensic trail for incident
    response (Step 3)
  - [OK] Security group allows 0.0.0.0/0 only on port 443 — expected for
    internet-facing ALB (Step 2)
REMEDIATION:
  1. CRITICAL — Update the listener SslPolicy:
     aws elbv2 modify-listener --listener-arn <arn> \
       --ssl-policy ELBSecurityPolicy-TLS13-1-2-2021-06
  2. HIGH — Enable access logs:
     aws elbv2 modify-load-balancer-attributes --load-balancer-arn <arn> \
       --attributes Key=access_logs.s3.enabled,Value=true \
       Key=access_logs.s3.bucket,Value=<bucket> \
       Key=access_logs.s3.prefix,Value=<prefix>
```

## Anti-Patterns — NEVER

- NEVER flag an ALB for cross-zone load balancing being disabled. Cross-zone
  is **always enabled** for ALB — it is not a configurable attribute. Only
  NLB has the toggle (off by default). Flagging ALB cross-zone is a false
  positive that erodes trust.

- NEVER flag a TCP listener on an NLB for "missing TLS." TCP is a
  passthrough protocol — the NLB does not terminate TLS for TCP listeners.
  Only TLS-protocol listeners have an SslPolicy to evaluate. If
  end-to-end encryption is required, note it as a recommendation, not a
  finding.

- NEVER flag an HTTP:80 listener with a redirect-to-HTTPS action as
  insecure. The redirect pattern (HTTP→HTTPS) is the **standard secure
  hardening** for ALB. Only flag an HTTP listener that forwards cleartext
  with no HTTPS alternative on the same LB.

- NEVER flag `0.0.0.0/0` on ports 80 and/or 443 for an `internet-facing` ALB.
  This is the **expected posture** — the ALB must accept traffic from the
  internet on its listener ports. Only flag 0.0.0.0/0 on non-listener ports
  or on all ports (0-65535).

- NEVER assume `ELBSecurityPolicy-2016-08` is secure because it is the AWS
  default. It includes TLS 1.0 and 1.1, both deprecated by PCI-DSS since
  2018. The default is insecure by modern standards. Always classify it as
  INSECURE_LISTENER.

- NEVER recommend WAF as remediation for an NLB finding. WAFv2 Web ACL
  association is available for ALB only — NLB operates at Layer 4 and cannot
  inspect HTTP payloads.

- NEVER classify an LB as IDLE if at least one target group has at least one
  `healthy` target. A single healthy target means the LB is serving traffic.
  Only flag IDLE when all target groups have zero registered targets or all
  targets are `unhealthy`.

- NEVER assume access logs are working just because `access_logs.s3.enabled`
  is `true`. The S3 bucket policy must grant `elasticloadbalancing.amazonaws.com`
  the `s3:PutObject` permission with `aws:SourceAccount` condition. A
  misconfigured bucket policy causes logs to silently fail — the attribute
  says enabled but no log objects ever appear. Always verify with a live
  bucket-policy check.

- NEVER recommend enabling deletion protection without explaining the
  trade-off. Deletion protection prevents accidental deletion (good) but also
  blocks `delete-load-balancer` with `OperationNotPermittedException` until
  explicitly disabled (can confuse operators). State both sides.

- NEVER evaluate TLS cipher suites on a custom SslPolicy without checking the
  explicit Protocols list. A policy name you do not recognize may be a
  customer-managed custom policy with TLS 1.2+ only — or it may include TLS
  1.0. Always check `Protocols` and `Ciphers` if provided.

- NEVER conflate ALB and NLB security group models. ALB has its own SG
  attached to the LB. NLB may or may not have an SG (pre-2023 NLBs have none;
  the target SGs control access). Applying ALB SG logic to an NLB without an
  attached SG produces a false negative.

- NEVER assume access logs are being delivered just because
  `access_logs.s3.enabled` is `true`. The S3 bucket policy MUST grant
  `elasticloadbalancing.amazonaws.com` the `s3:PutObject` permission with an
  `aws:SourceAccount` (or `aws:SourceArn`) condition matching the LB owner
  account. A missing or incorrect bucket policy causes logs to silently fail
  — the attribute says enabled but no log objects ever appear in S3. Always
  verify with `aws s3 ls` on the prefix after 5-10 minutes.

- NEVER trust an NLB `healthy` status without verifying
  `health_check.type`. The default TCP health check succeeds on a bare TCP
  handshake — an application returning 500s or serving wrong content is
  marked `healthy`. For HTTP/HTTPS target groups, require
  `health_check.type` = HTTP/HTTPS with a real `path`; a TCP check on an
  HTTP target produces a false-negative IDLE verdict (the LB appears to
  have healthy targets, but the app is broken and users see 502/503 with
  no IDLE flag raised). This is the most common cause of "healthy but
  down" incidents on NLB-fronted services.

- NEVER assume the target group's default `Port` is the port targets
  actually listen on. `register-targets` accepts a per-target `Port`
  override that can differ from the group default — a target registered on
  the wrong port passes the health check (which uses the group port) but
  fails under real traffic, producing intermittent 502s. When auditing
  live targets, list `TargetHealthDescriptions` and compare each target's
  registered port to the group `Port`; a mismatch is a CONFIG_GAP finding,
  not an IDLE finding.

- NEVER conflate deregistration delay with unhealthy-threshold timing. If
  `health_check.interval_seconds * unhealthy_threshold_count` exceeds the
  deregistration delay, a failing target may be deregistered (after
  draining) BEFORE the health check marks it `unhealthy` — the LB sends
  traffic to a dying target throughout the gap. Conversely, if the
  product is shorter than the delay, a target flaps in and out of
  rotation during deploys. Always verify the timing relationship as part
  of a CONFIG_GAP finding on target groups with non-default dereg delay.

## Pre-flight safety checks (run before any remediation CLI)

- **MANDATORY CONFIRMATION GATE.** Before any state-changing operation
  (modify-listener, modify-load-balancer-attributes, delete-load-balancer),
  the auditor MUST emit:
  `CONFIRM: About to <action> on LB <arn>. This affects <consequence>.
  Proceed? (yes/no)`
  Do NOT execute the CLI command until the operator confirms.

- **SslPolicy change validation.** Before modifying a listener SslPolicy,
  verify the new policy is compatible with the listener protocol:
  `aws elbv2 describe-listener-attributes --listener-arn <arn>`. Changing
  the SslPolicy on a live listener immediately renegotiates TLS for all new
  connections — clients with old cipher suites may be disconnected.

- **Access-log enablement requires a valid S3 bucket.** Before enabling
  access logs, verify the bucket exists and has the correct policy granting
  `elasticloadbalancing.amazonaws.com` write access with `aws:SourceAccount`
  condition. Enabling logs on a non-existent bucket silently fails.

- **Deletion protection toggle is a two-step process.** To delete an LB with
  deletion protection: (1) disable deletion protection, (2) delete the LB.
  Attempting to delete without disabling returns
  `OperationNotPermittedException`.

- **Target group health check after changes.** After modifying listeners or
  target groups, verify target health:
  `aws elbv2 describe-target-health --target-group-arn <arn>`. A
  configuration change can cause health-check failures that take minutes to
  surface.

## Remediation guidance
Full per-verdict remediation CLI (INSECURE_LISTENER TLS policy update and HTTP redirect, PERMISSIVE_SG revoke/authorize, NO_ACCESS_LOGS enablement, IDLE deletion/re-register, CONFIG_GAP cross-zone and deletion protection) moved verbatim to [references/remediation-commands.md](references/remediation-commands.md).
Load on demand when emitting the REMEDIATION field or executing fixes.

## Deep reference: ELBv2 TLS security policy catalog
TLS deep reference (SslPolicy negotiation mechanics, ELBSecurityPolicy naming convention, ALB vs NLB TLS termination, operational edge cases: policy-change scope, TLS 1.3 fixed ciphers, idle-timeout cascade, health-check vs dereg timing, log prefix collisions, NLB static IPs) moved verbatim to [references/advanced-patterns.md](references/advanced-patterns.md).
Load on demand when evaluating custom or unrecognized SslPolicies.

## Recent AWS features (2024-2026)
Recent AWS features (TLS 1.3 on ALB, mTLS on NLB, routing enhancements, capacity reservations) moved verbatim to [references/advanced-patterns.md](references/advanced-patterns.md).
Load on demand when auditing recently deployed listeners.

## References (load on demand)

- [references/remediation-commands.md](references/remediation-commands.md) — per-verdict remediation CLI moved verbatim from the Remediation guidance section.
- [references/advanced-patterns.md](references/advanced-patterns.md) — Step-0 non-obvious behaviors, TLS security policy deep reference, and recent AWS features.

## Domain

AWS CloudOps / ELBv2 Load Balancer Security & Compliance.

## AWS documentation

- **Elastic Load Balancing User Guide** — https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html
- **ELB Security** — https://docs.aws.amazon.com/elasticloadbalancing/latest/application/security.html
- **ELB API Reference (v2)** — https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/
- **AWS CLI Command Reference (elbv2)** — https://docs.aws.amazon.com/cli/latest/reference/elbv2/
- **mTLS on NLB** — https://docs.aws.amazon.com/elasticloadbalancing/latest/network/mutual-authentication.html

