From 74837d5bce419bb210415da244b679010f7b86cc Mon Sep 17 00:00:00 2001 From: urist Date: Thu, 6 Mar 2025 15:41:15 +0100 Subject: [PATCH] finish examples --- opsec/anonymous_server_monitoring/index.html | 28 ++++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/opsec/anonymous_server_monitoring/index.html b/opsec/anonymous_server_monitoring/index.html index 9ce5dbd..4d54de0 100644 --- a/opsec/anonymous_server_monitoring/index.html +++ b/opsec/anonymous_server_monitoring/index.html @@ -269,6 +269,10 @@ sudo systemctl stop tor #stop the tor service mkdir -p /var/lib/tor/auth_keys #create the client auth keys folder to store our second layer of authentication mkdir -p /var/lib/tor/onion/grafana #create the client auth keys folder to store our second layer of authentication chmod 400 -R /var/lib/tor/auth_keys #set restrictive file permissions + +#line below will allow your aggregator to connect to your monitored server. Without it no requests can even reach it +echo "[prometheusclientaddr].onion:descriptor:x25519:DBQW3GP5FCN2KQBDKTDKDAQUQWBEGBZ5TFYJE4KTJFBUOJPKYZBQ" > /var/lib/tor/auth_keys/prometheus_server.auth_private + chmod 400 -R /var/lib/tor/onion #set restrictive file permissions vi /etc/tor/torrc #edit the torrc file to add content @@ -286,7 +290,7 @@ private_key=descriptor:x25519:YCPURSYN4FL4QKQSXFTGLYNBHOVVRCQYRZLFHMZFCUFU5R6DCR public_key=descriptor:x25519:UUQW4LIO447WRQOSRSNDXEW5NZMSR3CYOP65ZIFWH6G2PUKWV5WQ echo "YCPURSYN4FL4QKQSXFTGLYNBHOVVRCQYRZLFHMZFCUFU5R6DCRMQ" > ~/mygrafana_auth_key -echo "UUQW4LIO447WRQOSRSNDXEW5NZMSR3CYOP65ZIFWH6G2PUKWV5WQ" > /var/lib/tor/onion/grafana/0.auth +echo "descriptor:x25519:UUQW4LIO447WRQOSRSNDXEW5NZMSR3CYOP65ZIFWH6G2PUKWV5WQ" > /var/lib/tor/onion/grafana/0.auth chown debian-tor:debian-tor -R /var/lib/tor # make tor owner of this folder @@ -330,17 +334,13 @@ scrape_configs:

Grafana configuration

-First let's start grafana and make it available: as root, +Let's start grafana and make it available: as root, as tor is already configured we can then access it through our torbrowser

-docker run -d -p 3000:3000 --name=grafana grafana/grafana-enterprise
-
+    docker run -d -p 3000:3000 --name=grafana grafana/grafana
+
-As tor is already configured you can find your grafana url by looking at /var/lib/tor/onion/grafana/hostname -

- -Now let's configure a couple of dashboards

@@ -354,8 +354,10 @@ Now let's configure a couple of dashboards
+

+

Connecting to our grafana instance

- On your monitoring server you can find your hostname at /var/lib/tor/grafana/hostname. Use it in the tor browser to reach your instance. You might be prompted for your private key if tor browser doesn't use your system's tor daemon. To avoid that you can change its connection settings.
+ On your monitoring server you can find your hostname at /var/lib/tor/grafana/hostname. Use it in the tor browser to reach your instance. You will be prompted for your private key, you can find it where you saved it earlier ~/mygrafana_auth_key, paste the part after @@ -366,17 +368,21 @@ Now let's configure a couple of dashboards
+
- Now, let's configure it (specifying localhost:9001 as the API port)
- + Now, let's configure it (specifying localhost:9090 as the API port)
+

+
+
And Voila! we have simple system monitoring over tor in a dashboard:
+