User Account
SAP Commerce Platform enables you to manage the user account and its security with special properties.
Preventing Password Brute-Force Attacks
It is possible to set a maximum number of unsuccessful login attempts in SAP Commerce to prevent brute-force attacks. After exceeding this number, the user isn't able to log in to the system anymore.
You can set the maximum number of unsuccessful login attempts on per-group basis. If the user belongs to many groups that have this property set to different values, the minimum (most strict) value is used.
Configuration
You can set your maximum number of unsuccessful login attempts for a given group in Backoffice, in the tab. After you select your target group, you have access to the Max brute force login attempts property field in the Administration tab.
Logs
When a user from a target group enters invalid credentials on the login screen, the following log is recorded:
INFO [hybrisHTTP36] [DefaultUserAuditLoginStrategy] user:foo failed 1 logins. Max failed logins allowed:5
and if they exceed the maximum number of login attempts:
INFO [hybrisHTTP37] [DefaultUserAuditLoginStrategy] user:foo has reached the max number of failed logins (5)
As a result, the user cannot log in to the account anymore.
Details
The number of unsuccessful login attempts for each user is stored in the database in BruteForceLoginAttempts items. Those items are persisted between system restarts and work correctly in the cluster environment. When the number of unsuccessful login attempts exceeds your configured value, the User.loginDisabled field is set to true. This prevents the user from logging in to the system until the value is reverted to false. In addition, a BruteForceLoginDisabledAudit item is created to mark the fact that the user account has been disabled because of too many unsuccessful login attempts.
You can customize this mechanism by implementing de.hybris.platform.servicelayer.user.UserAuditLoginStrategy and registering a userAuditLoginStrategy bean.
When disabling user accounts, the configuration also takes into account the number of unsuccessful authentication attempts in OAuth flows where user credentials are provided in request parameters.
Access tokens generated for user accounts disabled as part of brute force attack prevention can no longer be used to access resources as they get deleted from the database. The credentials of disabled users can also no longer be used in OAuth flows, which means that it's impossible to issue a new access token or refresh an existing one by using these credentials in the request. To get a new access token for disabled user accounts, re-enable the accounts first.
{
"error" : "invalid_grant",
"error_description" : "User is disabled"
}
Deactivate User Accounts
The User.deactivationDate property allows you to deactivate a user account. If the deactivation date you set is earlier than the current date and time, you deactivate the account instantly. If the deactivate date is in the future, the account is active up to this date and time, and then it gets deactivated.
Re-Enabling User Accounts
User accounts that have been disabled can be re-enabled through Backoffice in the Password tab for each user.
Client and User Brute Force Attack Prevention
Brute force attack prevention is configured and performed separately for users and OAuth clients. However, in OAuth flows that require both an OAuth client and user credentials, user authentication is not performed in case of unsuccessful client authentication and brute force attempts are counted only for the client, not for the user.
For information on client brute force attack prevention, see OAuth2.

