Skip to main content

πŸ“ Azure Storage Account Shared Access Signature Tokens do not expire within 1 hour 🟒

  • Contextual name: πŸ“ Shared Access Signature Tokens do not expire within 1 hour 🟒
  • ID: /ce/ca/azure/storage/account-sas-tokens-expire-in-1-hour
  • Located in: πŸ“ Azure Storage

Flags​

Our Metadata​

  • Policy Type: COMPLIANCE_POLICY
  • Policy Category:
    • SECURITY

Similar Policies​

Description​

Open File

Description​

Expire shared access signature tokens within an hour.

Rationale​

A shared access signature (SAS) is a URI that grants restricted access rights to Azure Storage resources. A shared access signature can be provided to clients who should not be trusted with the storage account key but for whom it may be necessary to delegate access to certain storage account resources. Providing a shared access signature URI to these clients allows them access to a resource for a specified period of time. This time should be set as low as possible and preferably no longer than an hour.

Audit​

Currently, SAS token expiration times cannot be audited. Until Microsoft makes token expiration time a setting rather than a token creation parameter, this recommendation would require a manual verification.

Default Value​

By default, expiration for shared access signature is set to 8 hours.

References​

  1. https://docs.microsoft.com/en-us/rest/api/storageservices/delegating-access-with-a-shared-access-signature
  2. https://docs.microsoft.com/en-us/azure/storage/common/storage-sas-overview

Remediation​

Open File

Remediation​

When generating shared access signature tokens, use start and end time such that it falls within an hour.

From Azure Portal​

  1. Go to Storage Accounts.
  2. For each storage account where a shared access signature is required, under Security + networking, go to Shared access signature.
  3. Select the appropriate Allowed resource types.
  4. Set the Start and expiry date/time to be within one hour.
  5. Click Generate SAS and connection string.

policy.yaml​

Open File

Linked Framework Sections​

SectionSub SectionsInternal RulesPoliciesFlags
πŸ’Ό CIS Azure v2.1.0 β†’ πŸ’Ό 3.6 Ensure that Shared Access Signature Tokens Expire Within an Hour - Level 1 (Manual)1
πŸ’Ό CIS Azure v3.0.0 β†’ πŸ’Ό 4.5 Ensure that Shared Access Signature Tokens Expire Within an Hour (Manual)1
πŸ’Ό Cloudaware Framework β†’ πŸ’Ό Secure Access43