summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2022-01-26 09:28:46 +0100
committerMarius Bakke <marius@gnu.org>2022-01-26 09:31:46 +0100
commit078f5bfae7ee174177791defcfd350117a503a6d (patch)
treea5a783e7dc702078de884630c49d8aa7afa2c665 /gnu
parent440ad14128f27d511f3b8ec4cce964b94304e4dc (diff)
services: zabbix-server: Do not write database password to the store.
* gnu/services/monitoring.scm (zabbix-front-end-config): Read the secret file from zabbix.conf.php at runtime instead of embedding the contents.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/services/monitoring.scm11
1 files changed, 5 insertions, 6 deletions
diff --git a/gnu/services/monitoring.scm b/gnu/services/monitoring.scm
index 53371614628..1b49dbd3cb7 100644
--- a/gnu/services/monitoring.scm
+++ b/gnu/services/monitoring.scm
@@ -577,7 +577,7 @@ $DB['SERVER'] = '" db-host "';
577$DB['PORT'] = '" (number->string db-port) "'; 577$DB['PORT'] = '" (number->string db-port) "';
578$DB['DATABASE'] = '" db-name "'; 578$DB['DATABASE'] = '" db-name "';
579$DB['USER'] = '" db-user "'; 579$DB['USER'] = '" db-user "';
580$DB['PASSWORD'] = '" (let ((file (location-file %location)) 580$DB['PASSWORD'] = " (let ((file (location-file %location))
581 (line (location-line %location)) 581 (line (location-line %location))
582 (column (location-column %location))) 582 (column (location-column %location)))
583 (if (string-null? db-password) 583 (if (string-null? db-password)
@@ -592,15 +592,14 @@ $DB['PASSWORD'] = '" (let ((file (location-file %location))
592 (condition 592 (condition
593 (&error-location 593 (&error-location
594 (location %location))))) 594 (location %location)))))
595 (string-trim-both 595 (string-append "trim(file_get_contents('"
596 (with-input-from-file db-secret-file 596 db-secret-file "'));\n"))
597 read-string)))
598 (begin 597 (begin
599 (display-hint (format #f (G_ "~a:~a:~a: ~a: 598 (display-hint (format #f (G_ "~a:~a:~a: ~a:
600Consider using @code{db-secret-file} instead of @code{db-password} for better 599Consider using @code{db-secret-file} instead of @code{db-password} for better
601security.") file line column 'zabbix-front-end-configuration)) 600security.") file line column 'zabbix-front-end-configuration))
602 db-password))) "'; 601 db-password)))
603 602"
604// Schema name. Used for IBM DB2 and PostgreSQL. 603// Schema name. Used for IBM DB2 and PostgreSQL.
605$DB['SCHEMA'] = ''; 604$DB['SCHEMA'] = '';
606 605