<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<rfc ipr="trust200902" category="std" docName="draft-ehlers-repsec-00">

  <front>
    <title abbrev="RepSec">Reputation Security Protocol (RepSec)</title>

    <author fullname="Ralph Ehlers" initials="R." surname="Ehlers">
      <organization>PastWipe S.L.</organization>
      <address>
        <postal>
          <city>Marbella</city>
          <country>Spain</country>
        </postal>
        <email>info@pastwipe.com</email>
      </address>
    </author>

    <date year="2025" month="September" day="2"/>

    <abstract>
      <t>
        The Reputation Security Protocol (RepSec) defines a lightweight, extensible, and secure method
        for exchanging digital reputation and security-state information across the Internet. RepSec follows
        the design philosophy of SMTP (simplicity) and SNMP (extensibility). Entities can register, verify,
        remove, and audit reputation data in an interoperable and standardized way.
      </t>
    </abstract>
  </front>

  <middle>

    <section title="Introduction" anchor="intro">
      <t>
        Current approaches to reputation and security metadata are fragmented and proprietary. RepSec provides
        a standardized protocol for secure, interoperable exchange of this information. The protocol is designed
        to be simple to implement, secure by default, and extensible for future needs, drawing on SMTP's
        command/response model and SNMP's extensible object framework.
      </t>
      <t>Goals:</t>
      <t>
        - Simple, JSON-based message exchange<br/>
        - Secure by default (TLS mandatory)<br/>
        - Extensible command set and object schemas<br/>
        - Open and free to implement
      </t>
    </section>

    <section title="Requirements Language" anchor="requirements-language">
      <t>
        The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
        "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY",
        and "OPTIONAL" in this document are to be interpreted as described in
        <xref target="RFC2119"/> and <xref target="RFC8174"/> when, and only when,
        they appear in all capitals, as shown here.
      </t>
    </section>

    <section title="Protocol Overview" anchor="overview">
      <t>RepSec uses a client/server request–response model.</t>
      <t>
        Transport: TCP with mandatory TLS (TLS 1.2 or later; TLS 1.3 SHOULD be supported).<br/>
        Port: TBD by IANA (proposed: 4655).<br/>
        Encoding: UTF-8 JSON for commands and responses.<br/>
        Status Codes: Numeric, modeled after SMTP.
      </t>
    </section>

    <section title="Terminology" anchor="terminology">
      <t>
        Client: entity initiating RepSec commands.<br/>
        Server: entity providing RepSec services.<br/>
        Entity: subject of registration (domain, IP, userID, organization, etc.).<br/>
        Message: JSON-encoded RepSec command or response.<br/>
        Extension: optional module that defines new commands and/or schemas.
      </t>
    </section>

    <section title="Protocol Elements" anchor="protocol-elements">

      <section title="Transport and Encoding" anchor="transport-encoding">
        <t>
          All RepSec traffic MUST be transmitted over TLS. Servers SHOULD support TLS 1.3.
          Messages MUST be encoded as UTF-8 JSON objects. If compression is used, it MUST be negotiated
          at the TLS layer; TLS record compression is NOT RECOMMENDED.
        </t>
      </section>

      <section title="Commands" anchor="commands">
        <t>
          The minimum interoperable command set is shown below. Commands are JSON objects
          with a "command" field and command-specific parameters.
        </t>

        <section title="REGISTER" anchor="cmd-register">
          <t>Registers an entity with RepSec.</t>
          <figure>
            <artwork><![CDATA[
{ "command": "REGISTER", "entity": "example.com", "type": "domain", "auth": "token123" }
]]></artwork>
          </figure>
        </section>

        <section title="VERIFY" anchor="cmd-verify">
          <t>Verifies authenticity of registered data.</t>
          <figure>
            <artwork><![CDATA[
{ "command": "VERIFY", "entity": "example.com" }
]]></artwork>
          </figure>
        </section>

        <section title="REMOVE" anchor="cmd-remove">
          <t>Removes registered data.</t>
          <figure>
            <artwork><![CDATA[
{ "command": "REMOVE", "entity": "example.com" }
]]></artwork>
          </figure>
        </section>

        <section title="AUDIT" anchor="cmd-audit">
          <t>Retrieves entity history (audit log).</t>
          <figure>
            <artwork><![CDATA[
{ "command": "AUDIT", "entity": "example.com" }
]]></artwork>
          </figure>
        </section>

        <section title="PING" anchor="cmd-ping">
          <t>Checks server availability and round-trip.</t>
          <figure>
            <artwork><![CDATA[
{ "command": "PING" }
]]></artwork>
          </figure>
        </section>
      </section>

      <section title="Responses" anchor="responses">
        <t>Responses MUST include a numeric status code and a human-readable message. Additional fields are allowed.</t>
        <figure>
          <artwork><![CDATA[
200 OK                Command succeeded
400 BAD REQUEST       Syntax error or missing parameters
401 UNAUTHORIZED      Authentication required or failed
403 FORBIDDEN         Command not permitted
404 NOT FOUND         No such entity or resource
409 CONFLICT          State conflict (e.g., already registered)
429 TOO MANY REQUESTS Rate limiting in effect
500 SERVER ERROR      Internal processing error
]]></artwork>
        </figure>
        <t>Example:</t>
        <figure>
          <artwork><![CDATA[
{ "status": 200, "message": "Entity registered successfully" }
]]></artwork>
        </figure>
      </section>

      <section title="Example Session" anchor="session-example">
        <figure>
          <artwork><![CDATA[
C: { "command": "REGISTER", "entity": "example.com", "type": "domain" }
S: { "status": 200, "message": "Entity registered successfully" }

C: { "command": "VERIFY", "entity": "example.com" }
S: { "status": 200, "verified": true, "last_updated": "2025-09-02T10:00:00Z" }
]]></artwork>
        </figure>
      </section>

    </section>

    <section title="Security Considerations" anchor="security">
      <t>
        All RepSec sessions MUST use TLS with server authentication; mutual authentication via client
        certificates or token-based schemes is RECOMMENDED. Implementations MUST provide replay protection
        (e.g., timestamps and nonces) and SHOULD employ rate limiting and abuse detection. Privacy by design:
        servers MUST NOT expose unnecessary metadata and SHOULD minimize data retention.
      </t>
    </section>

    <section title="Extensibility" anchor="extensibility">
      <t>
        RepSec supports extensions similar to SMTP EHLO and SNMP MIBs. Extensions MAY define new commands
        and/or JSON schemas (RepSec Object Definitions). Servers SHOULD advertise supported extensions
        during capability discovery (future work).
      </t>
    </section>

    <section title="IANA Considerations" anchor="iana">
      <t>
        IANA is requested to assign a new TCP port for RepSec (suggested: 4655) and to create a new "RepSec
        Parameters" registry containing:
      </t>
      <t>
        - Registered RepSec Commands (Specification Required)<br/>
        - Registered RepSec Extensions (Specification Required)<br/>
        - Status Codes (Standards Action)
      </t>
    </section>

    <section title="Licensing and IPR" anchor="license">
      <t>
        This specification is made available under the IETF Trust Legal Provisions Relating to IETF Documents (TLP).
        Implementations may be licensed under permissive or copyleft licenses (e.g., Apache-2.0, GPL/LGPL), provided
        interoperability with the open standard is maintained. "RepSec" may be used as a trademark to indicate
        interoperable implementations.
      </t>
    </section>

  </middle>

  <back>

    <references title="Normative References">
      <reference anchor="RFC2119" target="https://www.rfc-editor.org/rfc/rfc2119">
        <front>
          <title>Key words for use in RFCs to Indicate Requirement Levels</title>
          <author initials="S." surname="Bradner"/>
          <date month="March" year="1997"/>
        </front>
        <seriesInfo name="RFC" value="2119"/>
      </reference>

      <reference anchor="RFC8174" target="https://www.rfc-editor.org/rfc/rfc8174">
        <front>
          <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
          <author initials="B." surname="Leiba"/>
          <date month="May" year="2017"/>
        </front>
        <seriesInfo name="RFC" value="8174"/>
      </reference>
    </references>

    <references title="Informative References">
      <reference anchor="RFC5321" target="https://www.rfc-editor.org/rfc/rfc5321">
        <front>
          <title>Simple Mail Transfer Protocol</title>
          <author initials="J." surname="Klensin"/>
          <date month="October" year="2008"/>
        </front>
        <seriesInfo name="RFC" value="5321"/>
      </reference>

      <reference anchor="RFC3411" target="https://www.rfc-editor.org/rfc/rfc3411">
        <front>
          <title>An Architecture for Describing SNMP Management Frameworks</title>
          <author initials="D." surname="Harrington"/>
          <author initials="R." surname="Presuhn"/>
          <author initials="B." surname="Wijnen"/>
          <date month="December" year="2002"/>
        </front>
        <seriesInfo name="RFC" value="3411"/>
      </reference>
    </references>

    <section title="Acknowledgments" anchor="ack">
      <t>
        RepSec was inspired by the simplicity of SMTP and the extensibility of SNMP, with the goal of creating an
        open, non-proprietary Internet standard for reputation security.
      </t>
    </section>

  </back>
</rfc>
