turbot/steampipe-mod-azure-compliance

Control: 5.7 Ensure that account 'Lockout duration in seconds' is greater than or equal to '60'

Description

The account lockout duration value determines how long an account retains the status of lockout, and therefore how long before a user can continue to attempt to login after passing the lockout threshold.

Account lockout is a method of protecting against brute-force and password spray attacks. Once the lockout threshold has been exceeded, the account enters a lockedout state which prevents all login attempts for a variable duration. The lockout in combination with a reasonable duration reduces the total number of failed login attempts that a malicious actor can execute in a given period of time.

Remediation

Remediate from Azure Portal

  1. From Azure Home select the Portal Menu.
  2. Select Microsoft Entra ID.
  3. Under Manage, select Security.
  4. Under Manage, select Authentication methods.
  5. Under Manage, select Password protection.
  6. Set the Lockout duration in seconds to 60 or higher.
  7. Click Save.

Default Value

By default, Lockout duration in seconds is set to 60.

Usage

Run the control in your terminal:

powerpipe control run azure_compliance.control.cis_v500_5_7

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run azure_compliance.control.cis_v500_5_7 --share

SQL

This control uses a named query:

with distinct_tenant as (
select
distinct tenant_id,
display_name,
subscription_id,
_ctx
from
azure_tenant
)
select
id as resource,
case
when (value)::int >= 60 then 'ok'
else 'alarm'
end as status,
case
when (value)::int >= 60 then t.display_name || ' lockout duration is at least 60 seconds.'
else
t.display_name || ' lockout duration is less than 60 seconds.'
end as reason,
t.tenant_id
from
distinct_tenant as t,
azuread_directory_setting
where
name = 'LockoutDurationInSeconds';

Tags