From b12b02d17c321c671ba318ad1bfd90e7bc4b5248 Mon Sep 17 00:00:00 2001 From: Nataliia Solomko Date: Tue, 3 Nov 2026 15:34:39 +0200 Subject: webproxy: T9566: Pass LDAP bind password via file instead of command line The LDAP bind password was passed to `basic_ldap_auth` with `-w`, so any local user could read it from `/proc/*/cmdline`. It was also written in plain text to `squid.conf`. The password is now written atomically to /run/squid-ldap.secret (0600, owned by proxy), unchanged including spaces, and passed with -W. The file is removed when LDAP authentication no longer uses a password. --- data/templates/squid/squid.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'data') diff --git a/data/templates/squid/squid.conf.j2 b/data/templates/squid/squid.conf.j2 index 4e3d702a8..129f508c6 100644 --- a/data/templates/squid/squid.conf.j2 +++ b/data/templates/squid/squid.conf.j2 @@ -51,7 +51,7 @@ auth_param basic realm "{{ authentication.realm }}" {# LDAP based Authentication #} {% if authentication.method is vyos_defined %} {% if authentication.ldap is vyos_defined and authentication.method is vyos_defined('ldap') %} -auth_param basic program /usr/lib/squid/basic_ldap_auth -v {{ authentication.ldap.version }} -b "{{ authentication.ldap.base_dn }}" {{ '-D "' ~ authentication.ldap.bind_dn ~ '"' if authentication.ldap.bind_dn is vyos_defined }} {{ '-w "' ~ authentication.ldap.password ~ '"' if authentication.ldap.password is vyos_defined }} {{ '-f "' ~ authentication.ldap.filter_expression ~ '"' if authentication.ldap.filter_expression is vyos_defined }} {{ '-u "' ~ authentication.ldap.username_attribute ~ '"' if authentication.ldap.username_attribute is vyos_defined }} -p {{ authentication.ldap.port }} {{ '-ZZ' if authentication.ldap.use_ssl is vyos_defined }} -R -h "{{ authentication.ldap.server }}" +auth_param basic program /usr/lib/squid/basic_ldap_auth -v {{ authentication.ldap.version }} -b "{{ authentication.ldap.base_dn }}" {{ '-D "' ~ authentication.ldap.bind_dn ~ '"' if authentication.ldap.bind_dn is vyos_defined }} {{ '-W ' ~ ldap_password_file if authentication.ldap.password is vyos_defined }} {{ '-f "' ~ authentication.ldap.filter_expression ~ '"' if authentication.ldap.filter_expression is vyos_defined }} {{ '-u "' ~ authentication.ldap.username_attribute ~ '"' if authentication.ldap.username_attribute is vyos_defined }} -p {{ authentication.ldap.port }} {{ '-ZZ' if authentication.ldap.use_ssl is vyos_defined }} -R -h "{{ authentication.ldap.server }}" {% endif %} acl auth proxy_auth REQUIRED http_access allow auth -- cgit v1.2.3