Whilst a lot of the stats we collected are pertinent to exit nodes, we don't really collect any of the stats that are only relevant to exit nodes.
It'd be useful to go over and see which of those we can/should collect.
From the top of my head, it'd be useful to report
And perhaps also a breakdown of
accept
vs reject
)
Activity
13-May-22 10:10
assigned to @btasker
14-May-22 10:38
It occurred to me that I don't actually need an exit to collect the stats - a relay should provide them too.
Have spun one up to experiment on
It looks like
GETINFO
returns a comma separated list of policies rather than a multi-line response14-May-22 10:41
This should be fairly straightforward to consume and break-down then.
If the tor instance isn't a relay, trying to fetch exit policy information returns a non 2xx status code:
The only catch is we don't want to report this as a stats fetch failure - it's a legitimate response.
14-May-22 11:24
This is now implemented - assuming the Tor daemon is running in server mode, we'll collect the following
ipv4_exit_policy_num_total
: Total number of exit policiesipv4_exit_policy_num_accept
: Total number of accept exit policiesipv4_exit_policy_num_reject
: Total number of reject exit policiesipv4_exit_policy_num_wildcard
: Total number of policies that use a*
for hostipv4_exit_policy_num_specific
: Total number of exit policies that refer to a specific hostipv4_exit_policy_num_unique_hosts
: Number of unique hosts in exit policiesipv4_exit_policy_num_unique_ports
: Number of unique ports in exit policiesipv4_exit_policy_num_wildcard_port
: Number of policies with wildcarded portsipv4_exit_policy_num_specific_port
: Number of policies mentioning specific portipv6_exit_policy_num_total
: Total number of exit policiesipv6_exit_policy_num_accept
: Total number of accept exit policiesipv6_exit_policy_num_reject
: Total number of reject exit policiesipv6_exit_policy_num_wildcard
: Total number of policies that use a*
for hostipv6_exit_policy_num_specific
: Total number of exit policies that refer to a specific hostipv6_exit_policy_num_unique_hosts
: Number of unique hosts in exit policiesipv6_exit_policy_num_unique_ports
: Number of unique ports in exit policiesipv6_exit_policy_num_wildcard_port
: Number of policies with wildcarded portsipv6_exit_policy_num_specific_port
: Number of policies mentioning specific portWith the resulting LP looking like
14-May-22 11:27
We might want to tweak the port counters though.
Exit policies allow a range to be specified, so an exit policy like this is legal
Currently we'd count this a 3 ports being specified, but really it's 4.
14-May-22 11:28
I'd also like to collect per-action stats. Currently we return a count of total
accept
and totalreject
, but the other stats are completely dis-associated from the action.It'd be useful to be able to show that there are
n
unique hosts associated withaccept
, andy
unique ports associated withreject
14-May-22 11:45
Actually, we've got trouble...
It looks like
GETINFO exit-policies/ipv4
sometimes returns a multi-line response:Will have to adjust the function to detect and handle this.
14-May-22 11:59
mentioned in commit github-mirror/telegraf-plugins@bf5ce11d11fcfdf33d57c86b0cbf6e0c03555e00
Message
Rework exit policy stats so that they can handle a multi-line response from the Tor daemon (utilities/telegraf-plugins#4)
14-May-22 11:59
mentioned in commit github-mirror/telegraf-plugins@8311615174f044722b5bae278908c5908d64a7a8
Message
Collect stats on exit policies (utilities/telegraf-plugins#4)
This collects aggregate statistics on the number of policies, what they relate to and what action they specify
14-May-22 12:31
Closing this as Done - I think we've collected everything we can
14-May-22 12:59
mentioned in commit github-mirror/telegraf-plugins@8b6003510480be323cbcb1589a0c1d1edbf2dee7
Message
Provide breakdown of counters between accept and reject (utilities/telegraf-plugins#4)