MEDIUM HAProxy Reconnaissance / Scanning LTR-0034 ✓ validated

Detect Admin Endpoint and Sensitive File Scanning in HAProxy Access Logs

Published

MITRE ATT&CK: T1595.003T1083

Sigma Rule

title: HAProxy Admin Endpoint and Sensitive File Probing
id: 4e692484-3272-46b4-8770-f622e438e3a4
status: experimental
description: >
  Detects a single source probing admin paths (/admin/) and sensitive
  configuration files (/.env) behind HAProxy and being denied with a
  401 or 403 several times within a short window. Legitimate traffic to
  an admin panel comes from authenticated sessions that succeed; a run of
  denials across distinct sensitive paths from one source is enumeration.
references:
  - https://www.haproxy.org/download/2.8/doc/configuration.txt
  - https://attack.mitre.org/techniques/T1595/003/
author: LogTriage
date: 2026/11/16
logsource:
  product: haproxy
  category: webserver
detection:
  sensitive_path:
    request|contains:
      - '/admin/'
      - '/.env'
  denied:
    status_code:
      - '403'
      - '401'
  timeframe: 5m
  condition: sensitive_path and denied | count() by src_ip >= 3
falsepositives:
  - Authorized vulnerability scan or pentest hitting admin and config paths deliberately
  - A developer mistyping an admin sub-path a few times before reaching the right one
level: medium
tags:
  - attack.reconnaissance
  - attack.t1595.003
  - attack.discovery
  - attack.t1083
How the rule decides

1 · Each event is compared with 2 selections. Every field in a selection must match; listed values are alternatives.

sensitive_path
  • request contains any of /admin//.env
denied
  • status_code is any of 403401

2 · An event counts when

sensitive_pathanddenied

3 · Then

Count matching events for each src_ip within 5 minutes; it alerts at at least 3.

Alert medium Checked on every deploy: fires on haproxy_attack.log, silent on haproxy_normal.log — both in the public sample dataset ↗︎

What this rule detects

An attacker who does not have valid credentials or source code for a web application will enumerate paths that are commonly left exposed: admin panels under /admin/, and framework configuration files like /.env that can contain database passwords and API keys. HAProxy sees every one of these requests pass through the frontend, and records the backend’s (or its own) response code for each. This rule fires when one source generates several denied requests (401 or 403) against admin or sensitive-file paths within a 5-minute window — the signature of automated or scripted path enumeration rather than normal browsing.

Detection logic

Two selections, combined, then counted per source:

  • sensitive_path — the request line contains /admin/ or /.env.
  • denied — the status code is 401 or 403.

condition: sensitive_path and denied | count() by src_ip >= 3 requires at least 3 denied requests to sensitive paths from the same source within the 5-minute timeframe. A single denied admin request is common enough (bookmarks, typos, revoked sessions) that it is not worth an alert; three or more distinct denials from one source in a short window is not.

Validated against a real sample

In haproxy_attack.log, source 185.220.101.42 generates three matching requests within five seconds:

  • GET /admin/config → 403
  • GET /admin/users → 403
  • GET /.env → 403, with termination flags PR-- showing HAProxy itself refused the request before any backend server was contacted

That is 3 denied sensitive-path requests from one source inside the window, which meets the >= 3 threshold and fires the rule. The same log also contains a separate source (45.142.212.100) sending a failed login and a large /api/v1/data/export transfer — neither of those lines matches /admin/ or /.env, so they do not contribute to this count.

The benign log (haproxy_normal.log) contains only /api/v1/dashboard, /api/v1/data, and /api/v1/static/app.js requests returning 200 or 304. None of it matches /admin/ or /.env, so the rule produces zero matches.

False positives

An authorized vulnerability scan or penetration test that walks admin and configuration paths will trigger this rule legitimately; check for a scheduled scan window or a known scanner user-agent before escalating. A developer mistyping an admin sub-path a handful of times in a row before reaching the correct one can also cross the threshold — if this happens often from a known internal IP range, consider excluding that range rather than raising the threshold tenant-wide.

Frequently Asked Questions

Why require both a sensitive path and a denial, rather than just the path?
Hitting /admin/config once and getting a 200 is normal traffic from someone with access. The signal here is the combination: a request to a path that should require authentication or shouldn't be reachable at all (/.env), paired with HAProxy or the backend actually refusing it. That pairing is what separates a legitimate admin session from a probe.
Why /.env specifically, and why does it matter that the sample shows a PR-- termination state?
/.env is a dotenv file convention used by many frameworks (Laravel, Node, Django tooling) to store database credentials and API keys outside source control. It should never be served. In the sample, the request to /.env has termination flags PR--, meaning HAProxy itself rejected the request before it reached any backend server (no server was selected). That is HAProxy's own defenses catching the probe, which still confirms the path was tried — it does not mean the attempt was harmless.
Why count by source IP with a 5-minute window instead of alerting on the first denied admin request?
A single 403 on an admin path can be a bookmark gone stale or a typo. Grouping by src_ip over 5 minutes catches the pattern that matters: the same source trying multiple admin or sensitive paths in quick succession, which is enumeration rather than an accident. The threshold of 3 is deliberately low because sensitive-path scanning is rare in normal traffic; raise it if your admin panel sits behind a path that legitimate automation also retries.
This rule stays silent on the /api/v1/login and /api/v1/data/export lines in the sample — why aren't those covered here?
Those lines describe a different behavior: a failed login followed by a large data transfer from a second source, which looks like credential abuse and exfiltration rather than path scanning. Mixing that into this rule would blur two distinct signals into one alert. It belongs in a separate rule keyed on authentication failures and response size, not on sensitive-path probing.

Related Resources

Reference

See this detection run on a real report

Try the live demo with a pre-loaded malicious log set — no signup required — or upload your own log file and get a full AI-reviewed threat report in minutes.