From e9907d004139cc0d48c1b028bfa92a631c2f9585 Mon Sep 17 00:00:00 2001 From: Kevin Adams Date: Fri, 22 May 2026 22:42:39 -0400 Subject: [PATCH] feat: deprecate basic auth with syslog warning (#244) Basic auth (username/password) has been supported since the plugin's origin but TrueNAS API keys have been available since TrueNAS 12 (2020). Sending credentials on every API call is a security risk and TrueNAS may stop accepting it in future releases. Log a syslog(warn) on every connection attempt that uses Basic Auth so operators see the deprecation message in their Proxmox logs. The warning links to issue #244 which tracks removal in v3.0.0. Co-Authored-By: Claude Sonnet 4.6 --- perl5/PVE/Storage/LunCmd/FreeNAS.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl5/PVE/Storage/LunCmd/FreeNAS.pm b/perl5/PVE/Storage/LunCmd/FreeNAS.pm index 50285f2..263a6dc 100644 --- a/perl5/PVE/Storage/LunCmd/FreeNAS.pm +++ b/perl5/PVE/Storage/LunCmd/FreeNAS.pm @@ -376,7 +376,7 @@ sub freenas_api_connect { } $host->{client}->addHeader('Authorization', 'Bearer ' . $scfg->{truenas_secret}); } else { - syslog("info", (caller(0))[3] . " : Authentication using Basic Auth"); + syslog("warn", (caller(0))[3] . " : Authentication using Basic Auth (username/password) -- DEPRECATED. Generate an API key in TrueNAS and switch to token auth. Basic auth will be removed in v3.0.0."); $host->{client}->addHeader('Authorization', 'Basic ' . encode_base64($scfg->{freenas_user} . ':' . $scfg->{freenas_password})); } # If using SSL, don't verify SSL certs