Skip to content

Commit 221737e

Browse files
committed
cephadm/services/ingress: configure security user in keepalived template
It is cleaner to enable script security and define a script user for keepalived. Signed-off-by: Bernard Landon <[email protected]>
1 parent 28fe52a commit 221737e

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

src/pybind/mgr/cephadm/templates/services/ingress/keepalived.conf.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# {{ cephadm_managed }}
2+
global_defs {
3+
enable_script_security
4+
script_user root
5+
}
6+
27
vrrp_script check_backend {
38
script "{{ script }}"
49
weight -20

src/pybind/mgr/cephadm/tests/test_services.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,6 +1738,10 @@ def test_ingress_config(self, _run_cephadm, cephadm_module: CephadmOrchestrator)
17381738
{
17391739
'keepalived.conf':
17401740
'# This file is generated by cephadm.\n'
1741+
'global_defs {\n '
1742+
'enable_script_security\n '
1743+
'script_user root\n'
1744+
'}\n\n'
17411745
'vrrp_script check_backend {\n '
17421746
'script "/usr/bin/curl http://1.2.3.7:8999/health"\n '
17431747
'weight -20\n '
@@ -1861,6 +1865,10 @@ def test_ingress_config_ssl_rgw(self, _run_cephadm, cephadm_module: CephadmOrche
18611865
{
18621866
'keepalived.conf':
18631867
'# This file is generated by cephadm.\n'
1868+
'global_defs {\n '
1869+
'enable_script_security\n '
1870+
'script_user root\n'
1871+
'}\n\n'
18641872
'vrrp_script check_backend {\n '
18651873
'script "/usr/bin/curl http://[1::4]:8999/health"\n '
18661874
'weight -20\n '
@@ -1987,6 +1995,10 @@ def test_ingress_config_multi_vips(self, _run_cephadm, cephadm_module: CephadmOr
19871995
{
19881996
'keepalived.conf':
19891997
'# This file is generated by cephadm.\n'
1998+
'global_defs {\n '
1999+
'enable_script_security\n '
2000+
'script_user root\n'
2001+
'}\n\n'
19902002
'vrrp_script check_backend {\n '
19912003
'script "/usr/bin/curl http://1.2.3.7:8999/health"\n '
19922004
'weight -20\n '
@@ -2121,6 +2133,10 @@ def test_keepalive_config_multi_interface_vips(self, _run_cephadm, cephadm_modul
21212133
{
21222134
'keepalived.conf':
21232135
'# This file is generated by cephadm.\n'
2136+
'global_defs {\n '
2137+
'enable_script_security\n '
2138+
'script_user root\n'
2139+
'}\n\n'
21242140
'vrrp_script check_backend {\n '
21252141
'script "/usr/bin/curl http://1.2.3.1:8999/health"\n '
21262142
'weight -20\n '
@@ -2312,6 +2328,10 @@ def test_keepalive_only_nfs_config(self, _run_cephadm, cephadm_module: CephadmOr
23122328
{
23132329
'keepalived.conf':
23142330
'# This file is generated by cephadm.\n'
2331+
'global_defs {\n '
2332+
'enable_script_security\n '
2333+
'script_user root\n'
2334+
'}\n\n'
23152335
'vrrp_script check_backend {\n '
23162336
'script "/usr/bin/false"\n '
23172337
'weight -20\n '

0 commit comments

Comments
 (0)