Skip to content

Commit e5e53ab

Browse files
authored
Merge pull request ceph#57847 from thegreenbear/keepalived-security-context
cephadm/services/ingress: configure security user in keepalived template Reviewed-by: Adam King <[email protected]> Reviewed-by: John Mulligan <[email protected]>
2 parents 22716d3 + 221737e commit e5e53ab

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
@@ -1874,6 +1874,10 @@ def test_ingress_config(self, _run_cephadm, cephadm_module: CephadmOrchestrator)
18741874
{
18751875
'keepalived.conf':
18761876
'# This file is generated by cephadm.\n'
1877+
'global_defs {\n '
1878+
'enable_script_security\n '
1879+
'script_user root\n'
1880+
'}\n\n'
18771881
'vrrp_script check_backend {\n '
18781882
'script "/usr/bin/curl http://1.2.3.7:8999/health"\n '
18791883
'weight -20\n '
@@ -1997,6 +2001,10 @@ def test_ingress_config_ssl_rgw(self, _run_cephadm, cephadm_module: CephadmOrche
19972001
{
19982002
'keepalived.conf':
19992003
'# This file is generated by cephadm.\n'
2004+
'global_defs {\n '
2005+
'enable_script_security\n '
2006+
'script_user root\n'
2007+
'}\n\n'
20002008
'vrrp_script check_backend {\n '
20012009
'script "/usr/bin/curl http://[1::4]:8999/health"\n '
20022010
'weight -20\n '
@@ -2123,6 +2131,10 @@ def test_ingress_config_multi_vips(self, _run_cephadm, cephadm_module: CephadmOr
21232131
{
21242132
'keepalived.conf':
21252133
'# This file is generated by cephadm.\n'
2134+
'global_defs {\n '
2135+
'enable_script_security\n '
2136+
'script_user root\n'
2137+
'}\n\n'
21262138
'vrrp_script check_backend {\n '
21272139
'script "/usr/bin/curl http://1.2.3.7:8999/health"\n '
21282140
'weight -20\n '
@@ -2257,6 +2269,10 @@ def test_keepalive_config_multi_interface_vips(self, _run_cephadm, cephadm_modul
22572269
{
22582270
'keepalived.conf':
22592271
'# This file is generated by cephadm.\n'
2272+
'global_defs {\n '
2273+
'enable_script_security\n '
2274+
'script_user root\n'
2275+
'}\n\n'
22602276
'vrrp_script check_backend {\n '
22612277
'script "/usr/bin/curl http://1.2.3.1:8999/health"\n '
22622278
'weight -20\n '
@@ -2448,6 +2464,10 @@ def test_keepalive_only_nfs_config(self, _run_cephadm, cephadm_module: CephadmOr
24482464
{
24492465
'keepalived.conf':
24502466
'# This file is generated by cephadm.\n'
2467+
'global_defs {\n '
2468+
'enable_script_security\n '
2469+
'script_user root\n'
2470+
'}\n\n'
24512471
'vrrp_script check_backend {\n '
24522472
'script "/usr/bin/false"\n '
24532473
'weight -20\n '

0 commit comments

Comments
 (0)