This is cool to see. My approach to this was purely Terraform, no Ansible, and I treat the bridges as very disposable.
My bridges have only rudimentary monitoring, like “is it working?” (checked with bridgestrap) and “am i going over any bandwidth limit?” (checked with the provider API). I also haven’t configured anything fancy with the firewall or anything else, the hosts are very much embracing the defaults of a bare Debian installation. This approach is partly about blending in, and partly about being lazy.
I notice you’re setting the reverse DNS of the hosts. obfs4 makes an effort to hide, and you can only really know it’s an obfs4 bridge by also knowing the certificate it uses, but in this case the reverse DNS will give it away. Sticking to the generic Hetzner reverse DNS will help the bridges last longer.
To handle replacement, I’m tracking bridges in an SQL database, and regular background tasks check for signs of blocks. One source that I’ve not yet configured is the new blocklist=
parameter that rdsys now provides. You could write a Python script to fetch the latest bridge-pool-assignments document, and then rotate your bridges when you see that your bridge is blocked. I think right now that measurements are only done in Russia, but that later this will be a comma-seperated country list. @hiro would know more. Note: this will have the “hashed fingerprint” of the bridge, and you’ll find those in /var/lib/tor/hashed_fingerprint
.
You can learn more about my solution in the docs: Tor Bridges and the source code: guardianproject / Bypass Censorship / portal · GitLab.
If you do write some Python to check for the blocklist=
listing, let me know, that’ll save me writing that code myself.