Profile Applicability:
Level 1
Description:
Shared access signatures (SAS) can be used to grant limited access to Azure Storage resources. When generating a SAS, it is possible to specify the allowed protocols for requests made with the SAS. It is recommended to allow requests over HTTPS only.
Rationale:
If a SAS token is passed over HTTP and intercepted via a man-in-the-middle attack, an attacker can read and misuse the SAS token just as the intended user could. This can potentially compromise sensitive data or allow malicious data corruption.
Impact:
SAS tokens can pose security risks if not managed carefully.
Remediation
Using Azure Portal:
If SAS tokens allowing HTTP were created with a Stored Access Policy (SAP):
Go to Storage accounts.
Select the desired Storage account.
Under Data storage, click Containers, File shares, Queues, or Tables.
Click the three dots next to a listed item.
Click Access policy.
Click the three dots next to the relevant access policy.
Click Delete.
Click Save.
Repeat steps as needed to revoke all SAS tokens created with SAP.
If SAS tokens allowing HTTP were created without a SAP:
Go to Storage accounts.
Select the desired Storage account.
Under Security + networking, click Access keys.
Next to each key, click Rotate key.
Confirm by clicking Yes.
Repeat as needed to revoke SAS tokens.
Note: Rotating access keys can affect applications or Azure services dependent on the storage account keys.
Implementation Plan
Using Azure Portal:
When generating SAS tokens, ensure Allowed protocols is set to HTTPS only.
Review existing SAS tokens and revoke any that allow HTTP using the remediation steps.
Using Azure CLI:
Generate SAS tokens specifying the HTTPS-only protocol.
Rotate access keys if necessary to revoke HTTP-allowed SAS tokens.
Backout Plan
Using Azure Portal:
If HTTPS-only causes issues, SAS tokens allowing HTTP can be temporarily recreated with understanding of security risks.
Restore access keys if rotated during remediation.
Using Azure CLI:
Regenerate SAS tokens without HTTPS-only restriction if needed.
Restore or re-rotate access keys as required.
References:
https://learn.microsoft.com/en-us/azure/storage/common/storage-sas-overview
https://learn.microsoft.com/en-us/azure/storage/common/storage-account-keys-manage