Giter Club home page Giter Club logo

contactinfo-information-sharing-specification's Introduction

Version 2

Overview

The Tor relay ContactInfo string was primarily intended to contain an email address and PGP key fingerprint but since this field accepts an arbitrary string it has been used for multiple other purposes (website urls, donation information, bitcoin addresses, ...). Making use of provided information in an automated way is hard since there is no specification on how this string should look like. This is a specification to formalize the ContactInfo string. This specification is optional (opt-in), operators can choose to implement it or not.

A simple to use ContactInfo generator for this specification can be found at https://torcontactinfogenerator.netlify.app/

Example

An example ContactInfo string as defined by this specification could look like this:

foo bar email:tor[]example.com url:https://example.com proof:uri-rsa uplinkbw:100 ciissversion:2

In words this means:

Motivation

  • increase information sharing among Tor relay operators
  • improve the ability to contact relay operators
  • increase trust in contact information
    • give operators a standardized way to authenticate some fields
    • detect relay operators impersonating other operators or entities that do not run relays
  • collect additional (self-reported) relay metrics
    • for Tor relay operators
    • for Tor developers
  • provide metadata for Tor network graphs
  • make hosting costs visible
  • make it easier for current and future relay operators to find (rarely used) hosters
    • (indirectly) improve geo- and autonomous system diversity on the Tor network (more diverse is better)

Design Goals

  • make provided information machine readable
  • allow for automatic verification (limited)
  • do not require changes in Tor
  • low entry barrier

Defined Fields

The fields specified in this document coexists with other arbitrary strings located in the relay's ContactInfo descriptor field. Defined fields may appear at any position within the contactInfo string. A field identifier (key) MUST only be used once, if it appears multiple times in the ContactInfo string only the first occurance is considered. UTF-8 is supported to the extend that Tor supports it (proposal 285). Punycode encoding should be used for internationalized domain names.

Information is provided in key-value pairs:

key ":" value WS key ":" value ...

keys and values MUST NOT contain any whitespace. WS is a single or multiple whitespace characters (space, tab, ..). The order of keys is not mandatory but SHOULD follow the order in which they appear in this specification. Specifically the email field SHOULD be the first field.

The version field (ciissversion) and at least one additional field (any) is mandatory.

Overview of definied fields

contact information

email

This field contains the email address of the technical contact managing this Tor relay. The given email address SHOULD be the same for all relays this entity manages. The value is an addr-spec as defined in RFC5322 but the "@" sign SHOULD be replaced with "[]". We are aware that this is trivially defeated anti-spam "protection" but not all email address scrappers are aware of this specification (not targeted for Tor contact info data).

example value:

contact[]example.com

url

This field contains an URL (or hostname) pointing to the website of the entity (organization or person) responsible for this Tor relay. In most cases the responsible entity will be the same as the technical contact mentioned in the email field. This field MUST be consistent across all relays where this entity is responsible. It MUST point to a specific (non-shared) domain/hostname. Two organizations/persons can not have the same field content. The url field is verified using the selected proof method described bellow (proof field).

When displaying the url field content on websites and tools implementing this specification:

  • The url SHOULD be ignored if verification does not succeed.
  • End users MUST be able to tell verified from unverified URLs.

In cases where the responsible organization or person does not have a website, this field can be used to specify a DNS domain only. In that case "http(s)://" is omitted.

length: < 400 characters

valid characters: [_%/:a-zA-Z0-9.-]

example value:

https://example.com

proof

The proof field is only relevant when the url field is set. It is ignored when url is not set. The proof field gives the operator the option to authenticate the url field.

Since the url can be set to an arbitrary value - without consent of the entity it points to - the proof field tells interested parties how they can verify the url value. A relay operator can choose one out of two options to establish a proof (proofs can not be combined), they are also the two possible field values:

  • uri-rsa
  • dns-rsa

The "uri-rsa" method is preferred over "dns-rsa" because it is easier to setup if a webserver is available and faster when performing proof verfications. The DNS based option SHOULD only be used when no webserver is available. All relays using a given url value MUST have the same consistent proof value. You can not use multiple distinct proof values within a single group of relays using a certain url value.

Tools performing proof checks SHOULD re-verify the availability of the proof at least every 6 months.

uri-rsa

The "uri-rsa" proof method uses the well-known "tor-relay" URI to fetch the RSA SHA1 Tor relay fingerprints from a fixed location on the url domain for verification.

Example: If the url points to "https://example.com", the verification process fetches the relay fingerprints from:

https://example.com/.well-known/tor-relay/rsa-fingerprint.txt

The text file contains the RSA SHA1 relay fingerprints from that entity - one per line.

For bridges the file is named:

https://example.com/.well-known/tor-relay/hashed-bridge-rsa-fingerprint.txt

In case of bridges the file contains hashed fingerprints instead of fingerprints.

The path and filename is static and defined in Tor proposal 326. It is not required that all listed relay fingerprints point to running relays, but all running relays contained in the file MUST have the same url field value.

Note: This URI MUST be accessible via HTTPS regardless whether the url uses HTTPS or not. The URI MUST NOT redirect to another domain.

dns-rsa

The "dns-rsa" proof method uses DNS instead of HTTPS and places the RSA SHA1 relay fingerprint or the hashed fingerprint in case of a bridge in DNS TXT records. DNSSEC MUST be enabled on the domain located in the url field to ensure the integrity of DNS records.

When choosing this method (for example because no webserver is available) the operator creates a DNS TXT record for each relay/bridge to proof it's url field.

These DNS TXT records look as follows (example: url:example.com):

relay-fingerprint.example.com value: "we-run-this-tor-relay"

relay-fingerprint is the 40 character RSA SHA1 fingerprint of the Tor relay.

For bridges:

hashed-fingerprint.example.com value: "we-run-this-tor-bridge"

hashed-fingerprint is the 40 character SHA1 hash of the bridge's fingerprint.

Each relay/bridge has its own DNS record, a single TXT record MUST be returned per relay/bridge only.

pgp

40 characters PGP key fingerprint (long form) without leading "0x" and without spaces. Case in-sensitive. This key relates to the email address given in the email field, but providing the pgp field without an email field is also possible.

This key SHOULD be available on https://keys.openpgp.org

length: MUST be exactly 40 characters long

valid characters: [a-fA-F0-9]

example value:

EF6E286DDA85EA2A4BA7DE684E2C6E8793298290

abuse

Email address of the abuse handling contact for this Tor relay. This is primariy relevant for Tor exit relays but can also be used on non-exit relays. The value is an addr-spec as defined in RFC5322 but the "@" sign SHOULD be replaced with "[]". We are aware that this is trivially defeated anti-spam "protection" but not all email address scrappers are aware of this specification (not targeted for Tor contact info data).

example value:

abuse[]example.com

keybase

The technical contact's keybase username. This identifier MUST be usable to create a valid keybase.io profile url.

length: < 50 characters

valid characters: [a-fA-F0-9]

example value:

nusenu

twitter

The entity's twitter username without the leading "@" (non-technical contact). The user MUST be usable to create a valid twitter profile url. If the responsible organization or person has no twitter account, the technical contact's twitter handle can be used instead.

length: MUST be 1-15 characters long

valid characters: [a-zA-Z0-9_]

example value:

torproject

mastodon

url pointing to the entity's mastodon profile (responsible organization/person).

length: < 254 characters

example value:

https://mastodon.social/@nusenu

matrix

Matrix user identifier for the technical contact for this Tor relay.

example value:

@user:example.com

xmpp

XMPP handle for the technical contact of this Tor relay. The "@" sign SHOULD be replaced with "[]".

length: < 254 characters

example value:

user[]example.com

otr3

OTR version 3 key fingerprint without spaces. Case in-sensitive. This key fingerprint relates to the xmpp address given in the xmpp field.

length: MUST be exactly 40 characters long

valid characters: [a-fA-F0-9]

example value:

EF6E286DDA85EA2A4BA7DE684E2C6E8793298290

hoster information

hoster

Commercial hoster domain where this server has been ordered. This is supposed to help other relay operators and future relay operators to find hosting providers. To normalize the provided domain:

  • The domain MUST NOT include a protocol specifier (like "https://").
  • The provided domain MUST NOT redirect to another (sub)domain
  • If the hoster has multiple domains (using different TLDs) use the international version.
  • The domain MUST NOT include trailing slashes "/".

If you are your own ISP (and are not offering a commercial service for others) this field MUST be omitted.

length: < 254 characters

valid characters: [a-zA-Z0-9.-]

example:

www.example-hoster.com

cost

Monthly hosting costs the hosting company is charging for the server. This does not include time spend to manage the relay. The amount MUST be provided with two digits after the decimal separator. The decimal separator MUST be a full stop (not a comma). The value MUST be followed by the currency in ISO4217 format.

On servers with multiple Tor instances the server hosting costs given in this field MUST be divided through the number of Tor relay instances running on that OS.

length: < 13 characters

valid characters: [A-Z0-9.]

example:

10.70USD
10.00EUR

invalid examples:

1USD
1.1USD
1,10USD

uplinkbw

Logical network interface speed in Mbit/s (1Mbit/s = 1 000 000 Bit/s) or the value of RelayBandwidthRate in your torrc setting (whatever is smaller). For asymetrical uplinks specify the lower of up- and download bandwidth.

On a server with multiple Tor instances the total available bandwidth of the server MUST be divided by the number of Tor relay instances running on it. This is an integer value.

length: < 7 characters

valid characters: [0-9]

example:

100

trafficacct

States if this is an unmetered or metered offering. In case of metered bandwidth the monthly included outbound (TX) traffic in GiB (GibiByte) MUST be provided. If no traffic is included in the monthly costs, this value MUST be set to 0. If the hoster meters in+outbound the hoster provided value must be divided by two. This is an integer value.

On a server with multiple Tor instances the total available monthly traffic of the server MUST be divided by the number of Tor relay instances running on it.

length: < 10 characters

valid characters: [unmetrd0-9]

example values:

unmetered
0
25600

memory

Non-persistent memory (RAM) available on this server - measured in MB (Mebibytes). This is the output of free -m on most Unix-based systems.

On a server with multiple Tor instances the memory size MUST be divided by the number of Tor relay instances. This is an integer value.

length: < 10 characters

valid characters: [0-9]

example:

4096

cpu

Only relevant for relays running on bare metal. String without spaces describing the used CPU model.

example:

intel-i5-8400

virtualization

States the underlying virtualization technology used on which the OS is running. Use "baremetal" for bare-metal servers (not virtualized).

length: < 15 characters

valid characters: [a-z-]

possible values:

kvm
qemu
bochs
xen
vmware
virtualbox
hyper-v
lxc
bhyve
openvz
parallels
vmm      #https://man.openbsd.org/vmm
zvm

donation information

donationurl

url pointing to a website that contains donation information to support this Tor relay. This MUST be an HTTPS URL.

length: < 254 characters

example:

https://torservers.net/donate.html

btc

Bitcoin or OpenAlias address where people can send donations to support the operation of this Tor relay.

length: < 100 characters

valid characters: [A-Za-z0-9]

zec

Zcash address where people can send donations to support the operation of this Tor relay.

length: < 96 characters

valid characters: [A-Za-z0-9]

xmr

Monero or OpenAlias address where people can send donations to support the operation of this Tor relay.

length: < 100 characters

Tor configuration

offlinemasterkey

Single character stating whether the OfflineMasterKey feature is enabled ("y") on this Tor instance or not ("n").

length: 1 character

valid characters: [yn]

signingkeylifetime

Integer stating the signing key renewal interval in days.

length: < 6 characters

valid characters: [0-9]

sandbox

Single character stating whether this instance runs with Sandbox enabled ("y") or not ("n").

length: 1 character

valid characters: [yn]

OS Information

os

String stating which OS distribution and version is used. Distribution and version is separated with a "/" sign. On platforms where the file /etc/os-release is available os is created by taking the ID and VERSION_ID values. The version identifier is optional and may be omitted. The string is case-insensitive.

length: < 21 character

valid characters: [A-Za-z0-9/.]

examples:

OpenBSD/6.7
FreeBSD/13
ubuntu/20.04
debian/10
centos/8
arch

tls

String stating which tls library is used by the tor daemon.

length: < 15 character

valid characters: [a-z]

example values:

openssl
libressl

aesni

Character stating whether AES-NI is available and used ("y") or not available/not used ("n").

length: 1 character

valid characters: [yn]

autoupdate

Single character stating whether automatic (unattended) updates are enabled ("y") or not ("n").

length: 1 character

valid characters: [yn]

confmgmt

States what configuration managment system is used. Set to "manual" for no configuration management.

example values

ansible
chef
puppet
salt

length: < 16 character

valid characters: [a-z]

DNS Configuration (Exits only)

dnslocation

This field is only relevant for exit relays, it is ignored on relays that do not allow exiting.

String describing the location of the used DNS resolver in relation to the exit relay.

  • local means the resolver is running on the same host as the Tor process.
  • sameas means the resolver is running on the same autonomous system as the exit relay and queries to the resolver do not cross another AS before reaching the resolver.
  • remote means the resolver is running on a system outside the exit relay's autonomous system

Multiple options may apply and MUST be separated using a comma. The order is relevant, the primary resolver MUST appear first followed by fallback resolvers.

example values:

local
sameas
remote
local,sameas

valid characters: [a-z,]

dnsqname

This field is only relevant for exit relays, it is ignored on relays that do not allow exiting.

Character stating whether this exit relay is using a resolver that is performing DNS QNAME minimization ("y") or not ("n"). QNAME minimization is defined in RFC7816.

length: 1 character

valid characters: [yn]

dnssec

This field is only relevant for exit relays, it is ignored on relays that do not allow exiting.

Character stating whether this exit relay is using a resolver that is performing DNSSEC validation ("y") or not ("n").

length: 1 character

valid characters: [yn]

dnslocalrootzone

This field is only relevant for exit relays, it is ignored on relays that do not allow exiting.

Character stating whether this exit relay is using a resolver that is running the DNS root zone on loopback ("y") to avoid latency and information disclosure to DNS root servers or not ("n"). This is defined in RFC7706.

length: 1 character

valid characters: [yn]

Specification Version Information

ciissversion

This field is mandatory.

Version of the ContactInfo Information Sharing Specification (this document) used to generate the ContactInfo string.

format: integer counter

valid characters: [0-9]

length: <4 digits

example values:

1
2

Considerations

  • increases exposure of relay operators

The machine readable information could be used by spammers and to target relay operators. The amount of spam observed has been limited. Operators concerned about spam should create a dedicated email address for the purpose of using it in the ContactInfo string. This email address can be rotated should there be any unacceptable amount of spam.

  • more information makes targeted exploitation easier / more silent

Attackers could use the additional information provided in these fields to specifically target only vulnerable systems. Operators concerned about sharing configuration information should omit this type of information, but can share other information.

  • increased descriptor size and directory traffic

The contactinfo field size could potentially grow because of this specification. This is mitigated by directory data compression and diffs available since Tor version 0.3.1.

  • ContactInfo size constraints

According to the manual there is no explicit ContactInfo size limit but there is a descriptor size limit. The max. descriptor size is 20000 bytes. The family size (number of listed fingerprints) and exit policy are two other relevant inputs.

HTTPS URLs and used certificate authority

The HTTPS endpoints located in field values MUST use certificates from a well known trusted certificate authority (for example Let's Encrypt).

contactinfo-information-sharing-specification's People

Contributors

nusenu avatar parckwart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

contactinfo-information-sharing-specification's Issues

Add ed25519 URI proof

Tor relays currently use both a vestigial RSA1024 key and an ed25519 key. It would make more sense to rely on the latter, especially since there is already a designated location for them.


I propose a new proof value, uri-ed25519, which may be validated using the /.well-known/tor-relay/ed25519-master-pubkey.txt path as described in the current tor-relay spec.

Virtualization

I’m not sure whether the “virtualization” field could use some more specification, to make sure that we don’t see too many different strings used to describe the same virtualization technology in the wild.

On systems with systemd installed, the systemd-detect-virt tool can be used to detect the virtualization technology. As of v237, it supports the following values (source):

  • kvm
  • qemu
  • bochs
  • xen
  • uml
  • vmware
  • oracle (virtualbox)
  • microsoft (hyper-v)
  • zvm
  • parallels
  • bhyve
  • vm-other
  • systemd-nspawn
  • lxc-libvirt
  • lxc
  • openvz
  • docker
  • rkt
  • container-other

Entries which are listed in the current example values in the README are set in bold; entries which use a different string in the example values are set in italic, with the README string in bold after it. README further mentions “vmm”, which I’m not sure what to make of.

Do you think we could use that as the basis for the virtualization field?

Cost in other currencies

Monthly hosting costs this server is causing measured in US dollar.

What if I’m not paying for the server in US dollar? Should I regularly adjust my ContactInfo for the current exchange rate?

I think it would be better to include the ISO 4217 currency code (e. g. USD, EUR) in the value, and to always specify the cost in the currency in which it’s actually paid.

Further specify os field

I think the os field is currently underspecified:

String stating which OS and version is used. OS and version is separated with a "/" sign.

example: OpenBSD/6.1

For Linux distributions, is the OS “Linux” or the distribution name? And is the version the Linux kernel version or the distribution version? (In the latter case: what about rolling-release distributions like Arch?)

On Linux systems, I would suggest using the ID and VERSION_ID fields from /etc/os-release. (Note that the VERSION_ID field is optional.)

I’m less familiar with *BSD, but I take it the version number is unambiguous there?

Add tls field

You have an SSL field for the SSL library which is of limited usefulness without the versions of the libraries: openssl you would want to know the versions of openssl.

More important is to know what versions of SSL/TLS the server speaks. Python code will not connect to SSLv* servers, and I don't think even TLSv1. The TLS field should be one of: TLSv1.1 TLSv1.2 or TLSv1.3 (currently).

We really need to get servers upgraded to TLSv1.3 as anything <= TLSv1.2 is suffering downgrade attacks in the wild over Tor.

Decimal or binary prefixes?

The specification refers to SI prefixes several times (MBit/s, TB, MB). It should clarify whether those prefixes are intended as decimal or binary prefixes.

IMHO this is especially important for memory, because /proc/meminfo and free by default use kB (kibibytes according to free(1)), but the specification calls for MB, so the relay operator needs to divide by either 1000 or 1024.

"verify my contact info" field

In the future we would like to verify provided contactinfo fields:

  • email
  • pgp
  • twitter
  • mastodon
  • xmpp

The problem here: who is allowed to verify - this should be someone who owns a tpo email address / the metrics team

the motivation for verification is:

  • have verified contact info is valuable and allows to find liars
  • verified fields could be displayed differently on Relay Search (this is why the verification should be performed by them - so they trust the verification result)

Do we want a field that allows the operator to explicitly say: Yes, please verify my contact info fields
vs
simply attempt a verification without explicit request by the operator

Add DNS resolver field

  • use-case: provide data in case of wide scale DNS problems
  • field is only relevant for exit relays
  • should contain the software (unbound, bind, ...)
  • configuration?

IRC contact field

It would be beneficial to have an irc contact field in addition to twitter, matrix, mastodon, xmpp, since Tor community channels exist on the OFTC network.

Since IRC is broadly implemented, the format could be networkname/nickname, for example irc:libera/Spydar007 or irc:oftc/Spydar007.
An alternative could be to include the full hostmask, like oftc/Spydar007!spydar007[]spydar007.com.

tag 1.0

lets remove the draft flag after solving some issues and tag 1.0

Add CPU field

  • use case: benchmark data for how much tor bw can a given CPU model push
  • should this be limited to virtualization:baremetal systems?
  • we need a canonical CPU model format
    • ansible field?
    • /proc/cpuinfo, replacing spaces and non-alphanum chars?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.