Verify RSA-SHA256 signatures on all PIA API responses
All checks were successful
Check Flake / check-flake (push) Successful in 3m18s
All checks were successful
Check Flake / check-flake (push) Successful in 3m18s
Every PIA API response includes a trailing RSA-SHA256 signature (line 1 = JSON, lines 3+ = base64-encoded signature) which was previously ignored entirely. Add verifyPIAResponse() that checks each response against PIA's public signing key before trusting the data. On verification failure the service aborts and systemd restarts it. Also bump RestartSec to 5m to avoid hammering PIA servers on repeated failures.
This commit is contained in:
@@ -73,7 +73,7 @@ in
|
||||
|
||||
config = { config, pkgs, lib, ... }:
|
||||
let
|
||||
scriptPkgs = with pkgs; [ wireguard-tools iproute2 curl jq iptables coreutils ];
|
||||
scriptPkgs = with pkgs; [ wireguard-tools iproute2 curl jq iptables coreutils openssl ];
|
||||
in
|
||||
{
|
||||
imports = allModules;
|
||||
@@ -133,7 +133,7 @@ in
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
Restart = "always";
|
||||
RestartSec = "10s";
|
||||
RestartSec = "5m";
|
||||
RuntimeMaxSec = "30d";
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user