gittech. site

for different kinds of informations and explorations.

underattack.txt Internet Standard

Published at
Jan 16, 2025

underattack.txt Internet Standard

Overview

The underattack.txt file is a text file placed in the root directory of a server's web directory (e.g., https://example.com/underattack.txt). This file provides information on whether the host is currently under external attack. The format is designed to be simple, extensible, and machine-readable.

Specification

  1. File Location: The file must be served at the root level of the host's domain:/underattack.txt

    • Example URL: https://example.com/underattack.txt
  2. Content Format: The file must contain a single line in the format:

    underattack:[yes|no]
    
    • yes: Indicates the host is under external attack.
    • no: Indicates the host is not under external attack.
  3. File Encoding:

    • The file must be UTF-8 encoded.
    • No additional whitespace or characters are permitted outside the defined format.
  4. HTTP Headers:

    • The server must return the file with the MIME type text/plain.

Extensibility

To support future extensions, additional fields may be appended to the file in the format:

fieldname:value

Rules for Extensions:

  1. Each new field must be on a separate line.
  2. Fields must use lowercase alphanumeric names and hyphens (-) as separators.
  3. Unknown fields must be ignored by parsers for backward compatibility.
  4. Example of an extended format:
    underattack:yes
    mitigation-status:active
    attack-type:ddos
    

Example Usage

  • Not under attack:
    underattack:no
    
  • Under attack with extensions:
    underattack:yes
    mitigation-status:active
    attack-type:ddos
    

Compliance

  1. Hosts adopting underattack.txt must ensure the file is accessible via HTTPS.
  2. Parsers must interpret only defined fields and ignore unrecognized extensions.
  3. Updates to this standard will provide backward-compatible changes to ensure interoperability.

Version History

  1. January 16, 2025. Initial version.