Pipeline: 4.3 Ensure that 'Enable key rotation reminders' is enabled for each Storage Account
Description
Access Keys authenticate application access requests to data contained in Storage Accounts. A periodic rotation of these keys is recommended to ensure that potentially compromised keys cannot result in a long-term exploitable credential. The "Rotation Reminder" is an automatic reminder feature for a manual procedure.
Reminders such as those generated by this recommendation will help maintain a regular and healthy cadence for activities which improve the overall efficacy of a security program.
Cryptographic key rotation periods will vary depending on your organization's security requirements and the type of data which is being stored in the Storage Account. For example, PCI DSS mandates that cryptographic keys be replaced or rotated 'regularly,' and advises that keys for static data stores be rotated every 'few months.'
For the purposes of this recommendation, 90 days will prescribed for the reminder. Review and adjustment of the 90 day period is recommended, and may even be necessary. Your organization's security requirements should dictate the appropriate setting.
Remediation
From Azure Portal
- Go to
Storage Accounts
. - For each Storage Account that is not compliant, under
Security + networking
, go toAccess keys
. - Click
Set rotation reminder
. - Check
Enable key rotation reminders
. - In the
Send reminders
field selectCustom
, then set theRemind me every
field to90
and the period drop down toDays
. - Click
Save
.
From Powershell
$rgName = <resource group name for the storage>$accountName = <storage account name>$account = Get-AzStorageAccount -ResourceGroupName $rgName -Name $accountNameif ($account.KeyCreationTime.Key1 -eq $null -or $account.KeyCreationTime.Key2 -eq $null){ Write-output ("You must regenerate both keys at least once before setting expiration policy")} else { $account = Set-AzStorageAccount -ResourceGroupName $rgName -Name $accountName -KeyExpirationPeriodInDay 90}$account.KeyPolicy.KeyExpirationPeriodInDays
Default Value
By default, Key rotation reminders is not configured.
Run the pipeline
To run this pipeline from your terminal:
flowpipe pipeline run azure_cis.pipeline.cis_v300_4_3
Use this pipeline
To call this pipeline from your pipeline, use a step:
step "pipeline" "step_name" { pipeline = azure_cis.pipeline.cis_v300_4_3 }
Params
Name | Type | Required | Description | Default |
---|---|---|---|---|
database | connection.steampipe | Yes | Database connection string. | connection.steampipe.default |
notifier | notifier | Yes | The name of the notifier to use for sending notification messages. | notifier.default |
notification_level | string | Yes | The verbosity level of notification messages to send. Valid options are 'verbose', 'info', 'error'. | info |
approvers | list(notifier) | Yes | List of notifiers to be used for obtaining action/approval decisions. | notifier.default |
Outputs
This pipeline has no outputs.