mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-08-27 13:33:57 +02:00
security: bind aquamarine metrics exporters to loopback
This commit is contained in:
@@ -121,7 +121,8 @@ in
|
|||||||
|
|
||||||
services.prometheus.exporters.postgres = {
|
services.prometheus.exporters.postgres = {
|
||||||
enable = true;
|
enable = true;
|
||||||
listenAddress = "0.0.0.0";
|
# loopback only: scraped by VictoriaMetrics on the same host
|
||||||
|
listenAddress = "127.0.0.1";
|
||||||
port = 9187;
|
port = 9187;
|
||||||
user = "postgres-exporter";
|
user = "postgres-exporter";
|
||||||
group = "postgres-exporter";
|
group = "postgres-exporter";
|
||||||
|
|||||||
@@ -82,7 +82,8 @@
|
|||||||
# https://github.com/wi1dcard/v2ray-exporter
|
# https://github.com/wi1dcard/v2ray-exporter
|
||||||
services.prometheus.exporters.v2ray = {
|
services.prometheus.exporters.v2ray = {
|
||||||
enable = true;
|
enable = true;
|
||||||
listenAddress = "0.0.0.0";
|
# loopback only: scraped by VictoriaMetrics on the same host
|
||||||
|
listenAddress = "127.0.0.1";
|
||||||
port = 9153;
|
port = 9153;
|
||||||
openFirewall = false;
|
openFirewall = false;
|
||||||
v2rayEndpoint = "127.0.0.1:54321";
|
v2rayEndpoint = "127.0.0.1:54321";
|
||||||
|
|||||||
@@ -95,7 +95,8 @@ in
|
|||||||
# prometheus metrics
|
# prometheus metrics
|
||||||
telemetry = {
|
telemetry = {
|
||||||
bind_port = 10000;
|
bind_port = 10000;
|
||||||
bind_address = "0.0.0.0";
|
# loopback only: scraped by VictoriaMetrics on the same host
|
||||||
|
bind_address = "127.0.0.1";
|
||||||
# auth_user_file = "";
|
# auth_user_file = "";
|
||||||
};
|
};
|
||||||
# multi-factor authentication settings
|
# multi-factor authentication settings
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
outputs,
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
v2rayExporter = "127.0.0.1";
|
||||||
|
pgExporter = "127.0.0.1";
|
||||||
|
sftpgoTelemetry = "127.0.0.1";
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
outputs,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
aqua = outputs.nixosConfigurations.aquamarine.config;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
v2rayExporter = aqua.services.prometheus.exporters.v2ray.listenAddress;
|
||||||
|
pgExporter = aqua.services.prometheus.exporters.postgres.listenAddress;
|
||||||
|
sftpgoTelemetry = aqua.services.sftpgo.settings.telemetry.bind_address;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user