Skip to content

Commit 074cc03

Browse files
committed
Security risk of backups from untrusted sources
1 parent 7a9df5e commit 074cc03

File tree

4 files changed

+73
-1
lines changed

4 files changed

+73
-1
lines changed

azure-sql/includes/virtual-machines-best-practices-security.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ SQL Server features and capabilities provide methods of securing data at the dat
3131
- Use [Azure Policy](/azure/governance/policy/overview) to create business rules that can be applied to your environment. Azure Policies evaluate Azure resources by comparing the properties of those resources against rules defined in JSON format.
3232
- Azure Blueprints enables cloud architects and central information technology groups to define a repeatable set of Azure resources that implements and adheres to an organization's standards, patterns, and requirements. Azure Blueprints are [different than Azure Policies](/azure/governance/blueprints/overview#how-its-different-from-azure-policy).
3333
- Use Windows Server 2019 or Windows Server 2022 to be [FIPS](../virtual-machines/windows/security-considerations-best-practices.md#fips-compliance) compliant with SQL Server on Azure VMs.
34-
34+
- Treat restoring backups as a high-risk operation and [never restore a backup from an untrusted source](../virtual-machines/windows/security-considerations-best-practices.md#security-risks-of-restoring-backups-from-untrusted-sources).

azure-sql/managed-instance/recovery-using-backups.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,32 @@ It's essential to acknowledge that geo-restore serves as an appropriate disaster
211211

212212
For more information about business continuity choices, see [Overview of business continuity](../database/business-continuity-high-availability-disaster-recover-hadr-overview.md).
213213

214+
## Security risks of restoring backups from untrusted sources
215+
216+
This section outlines the security risks associated with restoring backups to Azure SQL Managed Instance from untrusted sources.
217+
218+
### Why this matters
219+
220+
Restoring SQL backup files (`.bak`) introduces a potential risk if the backup originates from an untrusted source. The security risk is exacerbated further when SQL managed instances are shared by multiple applications, as it amplifies the area of threat. While backups that remain within a trusted boundary pose no security issue, restoring a malicious backup can compromise the security of the entire environment.
221+
222+
A malicious `.bak` file can:
223+
- Take over the SQL managed instance.
224+
- Escalate privileges and gain unauthorized access to underlying virtual machine (VMs) that hosts the SQL managed instance.
225+
226+
This attack occurs before any validating scripts or security checks can execute, which makes it extremely dangerous. Restoring an untrusted backup is equivalent to running untrusted applications on a critical virtual machine, and introducing arbitrary code execution into your environment.
227+
228+
### Best practices
229+
230+
Since Azure SQL Managed Instance is ring-fenced and isolated from other workloads, backup restore is supported, which is why extra care must be taken when restoring backups.
231+
232+
Follow these backup security best practices to reduce the threat to Azure SQL Managed Instance:
233+
- Treat restoring backups as a high-risk operation.
234+
- Reduce the threat service area by using isolated instances.
235+
- Only allow trusted backups. Never restore backups from unknown or external sources.
236+
- Only allow backups that remained within a trusted boundary. Ensure backups originate from within the trusted boundary.
237+
- Do not bypass security controls for convenience.
238+
239+
214240
## Limitations
215241

216242
Consider the following limitations when working with backups and Azure SQL Managed Instance:

azure-sql/virtual-machines/windows/backup-restore.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,29 @@ The following table summarizes the capabilities of each backup and restore optio
137137
| Monitor backup jobs with SSMS or Transact-SQL scripts | Yes | Yes | Yes |
138138
| Restore databases with SSMS or Transact-SQL scripts | Yes | No | Yes |
139139

140+
## Security risks of restoring backups from untrusted sources
141+
142+
This section outlines the security risks associated with restoring backups to SQL Server on Azure VMs from untrusted sources.
143+
144+
### Why this matters
145+
146+
Restoring SQL backup files (`.bak`) introduces a potential risk if the backup originates from an untrusted source. The security risk is exacerbated further when a SQL Server VM has multiple instances, as it amplifies the area of threat. While backups that remain within a trusted boundary pose no security issue, restoring a malicious backup can compromise the security of the entire environment.
147+
148+
A malicious `.bak` file can:
149+
- Take over the SQL Server on Azure VM.
150+
- Escalate privileges and gain unauthorized access to underlying virtual machine.
151+
152+
This attack occurs before any validating scripts or security checks can execute, which makes it extremely dangerous. Restoring an untrusted backup is equivalent to running untrusted applications on a critical virtual machine, and introducing arbitrary code execution into your environment.
153+
154+
### Best practices
155+
156+
Follow these backup security best practices to reduce the threat to SQL Server on Azure VMs:
157+
- Treat restoring backups as a high-risk operation.
158+
- Reduce the threat service area by using isolated instances.
159+
- Only allow trusted backups: never restore backups from unknown or external sources.
160+
- Only allow backups that remained within a trusted boundary : ensure backups originate from within the trusted boundary.
161+
- Do not bypass security controls for convenience.
162+
140163
## Related content
141164

142165
If you're planning your deployment of SQL Server on Azure VM, you can find provisioning guidance in the following guide: [How to provision a Windows SQL Server virtual machine in the Azure portal](create-sql-vm-portal.md).

azure-sql/virtual-machines/windows/security-considerations-best-practices.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,29 @@ To be FIPS compliant with SQL Server on Azure VMs, you should be on Windows Serv
205205

206206
SQL Server isn't currently FIPS compliant on Linux Azure VMs.
207207

208+
## Security risks of restoring backups from untrusted sources
209+
210+
This section outlines the security risks associated with restoring backups to SQL Server on Azure VMs from untrusted sources.
211+
212+
### Why this matters
213+
214+
Restoring SQL backup files (`.bak`) introduces a potential risk if the backup originates from an untrusted source. The security risk is exacerbated further when a SQL Server VM has multiple instances, as it amplifies the area of threat. While backups that remain within a trusted boundary pose no security issue, restoring a malicious backup can compromise the security of the entire environment.
215+
216+
A malicious `.bak` file can:
217+
- Take over the SQL Server on Azure VM.
218+
- Escalate privileges and gain unauthorized access to underlying virtual machine.
219+
220+
This attack occurs before any validating scripts or security checks can execute, which makes it extremely dangerous. Restoring an untrusted backup is equivalent to running untrusted applications on a critical virtual machine, and introducing arbitrary code execution into your environment.
221+
222+
### Best practices
223+
224+
Follow these backup security best practices to reduce the threat to SQL Server on Azure VMs:
225+
- Treat restoring backups as a high-risk operation.
226+
- Reduce the threat service area by using isolated instances.
227+
- Only allow trusted backups: never restore backups from unknown or external sources.
228+
- Only allow backups that remained within a trusted boundary : ensure backups originate from within the trusted boundary.
229+
- Do not bypass security controls for convenience.
230+
208231
## Related content
209232

210233
Review the security best practices for [SQL Server](/sql/relational-databases/security/) and [Azure VMs](/azure/virtual-machines/security-recommendations), and then review this article for the best practices that apply to SQL Server on Azure VMs specifically.

0 commit comments

Comments
 (0)