Skip to content

Commit 2b76a75

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Improve OpenStack performance by redcuing bcrypt hasing rounds number"
2 parents 3350542 + 2b6e9ac commit 2b76a75

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

lib/keystone

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ KEYSTONE_LOCKOUT_FAILURE_ATTEMPTS=${KEYSTONE_LOCKOUT_FAILURE_ATTEMPTS:-2}
127127
KEYSTONE_LOCKOUT_DURATION=${KEYSTONE_LOCKOUT_DURATION:-5}
128128
KEYSTONE_UNIQUE_LAST_PASSWORD_COUNT=${KEYSTONE_UNIQUE_LAST_PASSWORD_COUNT:-2}
129129

130+
# Number of bcrypt hashing rounds, increasing number exponentially increases required
131+
# resources to generate password hash. This is very effective way to protect from
132+
# bruteforce attacks. 4 is minimal value that can be specified for bcrypt and
133+
# it works way faster than default 12. Minimal value is great for CI and development
134+
# however may not be suitable for real production.
135+
KEYSTONE_PASSWORD_HASH_ROUNDS=${KEYSTONE_PASSWORD_HASH_ROUNDS:-4}
130136

131137
# Functions
132138
# ---------
@@ -225,6 +231,7 @@ function configure_keystone {
225231
fi
226232

227233
iniset $KEYSTONE_CONF identity driver "$KEYSTONE_IDENTITY_BACKEND"
234+
iniset $KEYSTONE_CONF identity password_hash_rounds $KEYSTONE_PASSWORD_HASH_ROUNDS
228235
iniset $KEYSTONE_CONF assignment driver "$KEYSTONE_ASSIGNMENT_BACKEND"
229236
iniset $KEYSTONE_CONF role driver "$KEYSTONE_ROLE_BACKEND"
230237
iniset $KEYSTONE_CONF resource driver "$KEYSTONE_RESOURCE_BACKEND"

0 commit comments

Comments
 (0)