Skip to content

Commit 9365348

Browse files
Merge pull request #275047 from normesta/normesta-reg-updates-14
Fixing content to respond to a GitHub issue
2 parents 5203852 + fdab88b commit 9365348

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

articles/storage/blobs/blob-storage-monitoring-scenarios.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: normesta
66
ms.service: azure-blob-storage
77
ms.topic: conceptual
88
ms.author: normesta
9-
ms.date: 07/30/2021
9+
ms.date: 05/10/2023
1010
ms.custom: "monitoring"
1111
---
1212

@@ -163,19 +163,23 @@ StorageBlobLogs
163163
| project TimeGenerated, AuthenticationType, AuthenticationHash, OperationName, Uri
164164
```
165165

166-
For security reasons, SAS tokens don't appear in logs. However, the SHA-256 hash of the SAS token will appear in the `AuthenticationHash` field that is returned by this query.
166+
For security reasons, SAS tokens don't appear in logs. However, the SHA-256 hash of the SAS token signature will appear in the `AuthenticationHash` field that is returned by this query.
167167

168-
If you've distributed several SAS tokens, and you want to know which SAS tokens are being used, you'll have to convert each of your SAS tokens to an SHA-256 hash, and then compare that hash to the hash value that appears in logs.
168+
If you've distributed several SAS tokens, and you want to know which SAS tokens are being used, you'll have to convert the signature portion of each of your SAS tokens to an SHA-256 hash, and then compare that hash to the hash value that appears in logs.
169169

170-
First decode each SAS token string. The following example decodes a SAS token string by using PowerShell.
170+
First decode each SAS token string. The following example decodes the signature portion of the SAS token string by using PowerShell.
171171

172172
```powershell
173-
[uri]::UnescapeDataString("<SAS token goes here>")
173+
[uri]::UnescapeDataString("<SAS signature here>")
174174
```
175175

176-
Then, you can pass that string to the [Get-FileHash](/powershell/module/microsoft.powershell.utility/get-filehash) PowerShell cmdlet. For an example, see [Example 4: Compute the hash of a string](/powershell/module/microsoft.powershell.utility/get-filehash#example-4--compute-the-hash-of-a-string).
176+
You can use any tool or SDK to convert the decoded signature to the SHA-256 has of that signature. For example, on a Linux system, you could use the following command:
177177

178-
Alternatively, you can pass the decoded string to the [hash_sha256()](/azure/data-explorer/kusto/query/sha256hashfunction) function as part of a query when you use Azure Data Explorer.
178+
```bash
179+
echo -n "<Decoded SAS signature>" | python3 -c "import sys; from urllib.parse import unquote; print(unquote(sys.stdin.read()), end='');" | sha256sum
180+
```
181+
182+
Another way to convert the decoded signature is to pass the decoded string to the [hash_sha256()](/azure/data-explorer/kusto/query/sha256hashfunction) function as part of a query when you use Azure Data Explorer.
179183

180184
SAS tokens do not contain identity information. One way to track the activities of users or organizations, is to keep a mapping of users or organizations to various SAS token hashes.
181185

0 commit comments

Comments
 (0)