<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi all,<div><br></div><div>I am currently looking at options defined in [security_compliance] section of keystone.conf [0] and trying to understand how enabling those security features may affect other services.</div><div><br></div><div>The first thing I see is that any project that auto-creates some temporary users may be affected.</div><div>Of the top of my head I can recall only Heat and Tempest doing this.</div><div>For Tempest situation is easier as a) tempest can use static credentials instead of dynamic ones so it is possible to craft appropriate users beforehand and b) those users are relatively short-lived (required for limited time).</div><div>In case of Heat though those users are used for deferred auth (like in autoscaling) which for long lived stacks can happen at arbitrary time in future - which is a problem.</div><div><br></div><div>Below is breakdown of options/features possible to set and what problems that may pose for Heat and ideas on how to work those around:</div><div><br></div><div>- disable_user_account_days_inactive - this may pose a problem for deferred auth, and it seems is not possible to override it via user "options". IMO there's a need to add a new user option to Keystone to ignore this setting for given user, and then use it in Heat to create temporary users.</div><div>- lockout failure options (lockout_failure_attempts, lockout_duration) - can be overridden by user option, but Heat has to set it first. Also the question remains how realistically such problem may arise for an auto-created internal user and whether Heat should set this option at all</div><div>- password expiry options (password_expires_days, unique_last_password_count, minimum_password_age) - poses a problem for deferred auth, but can be overridden by user option, so Heat should definitely set it IMO for users it creates</div><div>- change_password_upon_first_use - poses problem for auto-generated users, can be overridden by a user option, but Heat must set it for its generated users</div><div>- password strength enforcement (password_regex, password_regex_description) - now this is an interesting one. Currently Heat creates passwords for its temporary users with this function [1] falling back to empty password if a resource is not generating one for itself. Depending on regex_password setting in keystone, it may or may not be enough to pass the password strength check.</div><div>I've looked around and (as expected) generating a random string which satisfies a pre-defined arbitrary regex is quite a non-trivial task, couple of existing Python libraries that can do this note that they support only a limited subset of full regex spec.</div><div>So it seems that a most simple solution would be to add yet another user option to Keystone to ignore password strength enforcement for this given user, and amend Heat to set this option as well for internal users it creates.</div><div><br></div><div>We in Heat may also think as to whether it would have any benefit to also set the 'lock_password' user option for the auto-created users which will prohibit such users to change their passwords via API themselves.</div><div><br></div><div>I'd very like to hear opinion from Keystone community as most solutions I named are 'add new user option to Keystone' :-)</div><div><br></div><div>[0] <a href="https://opendev.org/openstack/keystone/src/branch/master/keystone/conf/security_compliance.py">https://opendev.org/openstack/keystone/src/branch/master/keystone/conf/security_compliance.py</a></div><div>[1] <a href="https://opendev.org/openstack/heat/src/branch/master/heat/common/password_gen.py#L112">https://opendev.org/openstack/heat/src/branch/master/heat/common/password_gen.py#L112</a></div><div><br></div><div>Cheers,</div><div>- Pavlo</div><div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Dr. Pavlo Shchelokovskyy<div>Principal Software Engineer</div><div>Mirantis Inc</div><div><a href="http://www.mirantis.com" target="_blank">www.mirantis.com</a></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>