Understanding the Risks of Azure SAS Tokens | Cyera Blog (2024)

The responsibility of data ownership and stewardship is no longer centralized. Various departments, business units, and teams continuously handle data, utilizing it to meet their specific objectives. However, such a dispersed approach to data ownership can leave companies vulnerable.

One very probable cause of potential cybersecurity issues is when Azure Shared Access Signature (SAS) tokens are revealed in code repositories and other data sources or shared with third parties, which can then be accessed by the public and misused for malicious purposes. This can include cases such as leaking confidential information or accessing privileged files. In this blog, we will focus on the most popular type – Account SAS tokens (Azure).

What is an Azure SAS Token?

A Shared Access Signature (SAS) token is a unique string of encrypted text that encapsulates all the necessary details needed to authenticate a shared signature to access Azure Storage services. It also determines which service and resource can be accessed, the permissions granted, and the validity period of the signature.

If we look at the specifics of these tokens, there are 3 types of SAS tokens: Account SAS, Service SAS, and User Delegation SAS. This blog walks through Account SAS tokens specifically, as this is the type of token used to access storage, which is a critical (if not the most critical) point of failure in data security.

Account SAS Tokens

SAS tokens are encrypted codes in the form of URIs (Uniform Resource Identifier) that grant specific access rights to one or more Azure Storage resources, such as Azure Blob Storage, Azure File Storage, and Azure Queue Storage. Compared to other tokens, this extensive access means it's crucial to handle Account SAS carefully to prevent unauthorized data access.

Furthermore, the efficacy of a SAS token lies in its signature, a special parameter added to the storage resource's URI. This system ensures controlled access without revealing sensitive credentials, which is vital when users need access but shouldn't have overarching permissions. Azure Storage then verifies this signature to authorize access and allows clients direct access to specified resources for a predetermined time. Once it expires, a new token is required.

As observed in Microsoft’s documentation, here’s an example of a SAS token in a URI:

Understanding the Risks of Azure SAS Tokens | Cyera Blog (1)

Once the token is generated, users may be granted permissions such as read and/or write. There are two notable use cases:

  • Clients can upload and download data via a front-end proxy service that authenticates the signature.
  • A specific service authenticates the user and then generates an Account SAS code to directly access storage account resources.

What are the Risks of Using SASTokens?

While Account SAS tokens are incredibly useful for accessing storage resources, there are a set of risks that businesses must consider.

Tracking generated tokens. One major challenge is the inherent lack of visibility into how many tokens are currently in circulation. Once tokens are generated, they can be accessed and utilized by any unauthorized entity.

Longer than intended timestamps. Secondly, there is the potential for users to set exceedingly long expiration dates when generating tokens, thus leaving data vulnerable for longer periods of time than originally intended. Service disruptions may also occur when tokens expire, impacting any services that rely upon them.

Once generated, a SAS token can't be revoked. To avoid such human errors, it is a best practice to specify a short lifespan on the signed key start and expiration date and time.

Mistaken permissions. To exacerbate these problems, SAS tokens might grant more access than originally intended. For instance, a user wanting to provide access to a specific file might inadvertently create a SAS token that allows access to the entire associated storage container including all the files in it. Also, a user wanting to provide "read" access to files might inadvertently create a SAS token that allows “write” or “manage” permissions instead of just “read,” so anyone who has the token at hand can write and manage the storage account.

Let’s look at a few best practices to avoid incorrect permissions and exposing unauthorized access.

Best Practices for Working with Azure SASTokens

We recommend a number of best practices when working with Azure SAS tokens:

Apply principle of least privilege:

  • Limit SAS tokens to essential resources (e.g., one blob).
  • Only grant necessary permissions (e.g., read-only).

Use short-lived SAS:

  • Apply a shorter expiration time for SAS tokens and have clients request new SAS tokens when needed.
  • Refresh SAS tokens as per Microsoft’s recommended time: 1 hour or less.

Handle SAS with care:

  • Treat SAS tokens as confidential.
  • Only share with clients who need access to a storage account.

Revocation strategy:

  • Link SAS tokens to stored access policy to revoke them more easily.
  • Be prepared to delete the stored access policy or change storage account keys if leaks occur.

Monitor and audit:

  • Enable Azure Monitor and Storage Logs to oversee storage account access.
  • Implement a SAS expiration policy to identify long-lived SAS use.

In addition to all these standard best practices, Cyera has specific actions that your organization can take today to ensure secure use of SAS tokens.

How Cyera can Help

As explained earlier, using SAS tokens to allow access to your data introduces potential data loss risks. Since revoking a specific SAS token is not possible, organizations can rotate the storage account’s access key, which invalidates all tokens and not only the SAS tokens associated with the storage account. Unfortunately, the main issue with this alternative solution is service degradation.

Alternatively, Cyera offers a multifaceted approach for businesses looking to manage and secure their SAS tokens, ensuring they are used appropriately and safely.

Visibility into SAS tokens. Cyera can scan a broad spectrum of IaaS, PaaS, and SaaS datastores and identifies Azure SAS tokens in both structured and unstructured data, such as databases and files within Microsoft 365 and various cloud storage services. This provides visibility of the presence and location of SAS tokens.

Audit access to SAS tokens. Cyera can provide insights into the users, groups, and other identities that can access datastores or files that contain SAS tokens, as well as the purpose for why these identities have access to the data.

Misplacement detection. Cyera can flag when tokens are found in less secure environments. For example, some companies may decide that SAS tokens should only reside in certain production environments. If the SAS tokens end up in a development environment with open access to many employees, it may violate company policies, triggering an alert.

Unauthorized token creation detection. Cyera can generate an alert when an Azure storage account has broad permissions that allow for unintended users to create SAS tokens. Security teams can set policies to monitor and limit these permissions and thus enforce a safer storage environment.

Unprotected token detection. Cyera can generate an alert when SAS tokens are found in a datastore with public access or if the SAS token itself is exposed as plaintext, allowing anyone with access to the datastore to utilize the token.

Conclusion

Improperly generating or exposing Azure Storage SAS tokens can be a major security risk to your sensitive data. Cyera helps mitigate these risks by enhancing the visibility, auditability, and detection of SAS token exposures.

Cyera takes a data-centric approach to security, assessing the exposure to your data at rest and in use and applying multiple layers of defense. Because Cyera applies deep data context holistically across your data landscape, we are the only solution that can empower security teams to know where their data is, what exposes it to risk, and take immediate action to remediate exposures and assure compliance without disrupting the business.

To learn more about how you can secure your data, schedule a demo today.

Understanding the Risks of Azure SAS Tokens | Cyera Blog (2024)
Top Articles
50 PI to INR - Exchange - How much Indian Rupee (INR) is 50 PiCoin (PI) ? Exchange Rates by Walletinvestor.com
Is Uphold Safe and Legit
Yogabella Babysitter
Chicago Neighborhoods: Lincoln Square & Ravenswood - Chicago Moms
Occupational therapist
Online Reading Resources for Students & Teachers | Raz-Kids
Ixl Elmoreco.com
biBERK Business Insurance Provides Essential Insights on Liquor Store Risk Management and Insurance Considerations
Milk And Mocha GIFs | GIFDB.com
Washington Poe en Tilly Bradshaw 1 - Brandoffer, M.W. Craven | 9789024594917 | Boeken | bol
5 high school volleyball stars of the week: Sept. 17 edition
fort smith farm & garden - craigslist
Find Such That The Following Matrix Is Singular.
Pekin Soccer Tournament
Unterwegs im autonomen Freightliner Cascadia: Finger weg, jetzt fahre ich!
Ukc Message Board
SF bay area cars & trucks "chevrolet 50" - craigslist
Wsop Hunters Club
R. Kelly Net Worth 2024: The King Of R&B's Rise And Fall
UMvC3 OTT: Welcome to 2013!
Dark Entreaty Ffxiv
Prep Spotlight Tv Mn
Greensboro sit-in (1960) | History, Summary, Impact, & Facts
1145 Barnett Drive
Page 2383 – Christianity Today
Ticket To Paradise Showtimes Near Cinemark Mall Del Norte
Mynahealthcare Login
Marlene2995 Pagina Azul
Tomb Of The Mask Unblocked Games World
Ihs Hockey Systems
Emuaid Max First Aid Ointment 2 Ounce Fake Review Analysis
FREE Houses! All You Have to Do Is Move Them. - CIRCA Old Houses
Taktube Irani
Devargasfuneral
Blue Beetle Movie Tickets and Showtimes Near Me | Regal
Today's Final Jeopardy Clue
Sams La Habra Gas Price
State Legislatures Icivics Answer Key
Hell's Kitchen Valley Center Photos Menu
Craigslist Boats Dallas
Dinar Detectives Cracking the Code of the Iraqi Dinar Market
Sdn Fertitta 2024
Frigidaire Fdsh450Laf Installation Manual
Citizens Bank Park - Clio
Random Animal Hybrid Generator Wheel
Aloha Kitchen Florence Menu
Meet Robert Oppenheimer, the destroyer of worlds
A Man Called Otto Showtimes Near Cinemark Greeley Mall
Blippi Park Carlsbad
Costco Gas Price Fort Lauderdale
What Are Routing Numbers And How Do You Find Them? | MoneyTransfers.com
Latest Posts
Article information

Author: Van Hayes

Last Updated:

Views: 6037

Rating: 4.6 / 5 (46 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Van Hayes

Birthday: 1994-06-07

Address: 2004 Kling Rapid, New Destiny, MT 64658-2367

Phone: +512425013758

Job: National Farming Director

Hobby: Reading, Polo, Genealogy, amateur radio, Scouting, Stand-up comedy, Cryptography

Introduction: My name is Van Hayes, I am a thankful, friendly, smiling, calm, powerful, fine, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.