Skip to content

Commit 15b2e42

Browse files
committed
Modify devstack-base to allow for fips
devstack-base is changed to descend from openstack-multinode-fips which is defined in project-config. This allows jobs to execute the enable_fips playbook to enable FIPS mode on the node, but only if they opt-in by setting enable_fips to True. Otherwise, this is a no-op. Change-Id: I5631281662dbd18056ffba291290ed0978ab937e
1 parent fa42b3c commit 15b2e42

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

.zuul.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@
370370

371371
- job:
372372
name: devstack-base
373-
parent: multinode
373+
parent: openstack-multinode-fips
374374
abstract: true
375375
description: |
376376
Base abstract Devstack job.

functions-common

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2545,6 +2545,11 @@ function clean_pyc_files {
25452545
fi
25462546
}
25472547

2548+
function is_fips_enabled {
2549+
fips=`cat /proc/sys/crypto/fips_enabled`
2550+
[ "$fips" == "1" ]
2551+
}
2552+
25482553
# Restore xtrace
25492554
$_XTRACE_FUNCTIONS_COMMON
25502555

lib/databases/mysql

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function recreate_database_mysql {
6969
}
7070

7171
function configure_database_mysql {
72-
local my_conf mysql slow_log
72+
local my_conf mysql slow_log my_client_conf
7373
echo_summary "Configuring and starting MySQL"
7474

7575
if is_ubuntu; then
@@ -86,6 +86,15 @@ function configure_database_mysql {
8686
exit_distro_not_supported "mysql configuration"
8787
fi
8888

89+
# Set fips mode on
90+
if is_ubuntu; then
91+
if is_fips_enabled; then
92+
my_client_conf=/etc/mysql/mysql.conf.d/mysql.cnf
93+
iniset -sudo $my_client_conf mysql ssl-fips-mode "on"
94+
iniset -sudo $my_conf mysqld ssl-fips-mode "on"
95+
fi
96+
fi
97+
8998
# Change bind-address from localhost (127.0.0.1) to any (::)
9099
iniset -sudo $my_conf mysqld bind-address "$(ipv6_unquote $SERVICE_LISTEN_ADDRESS)"
91100

0 commit comments

Comments
 (0)