Press "Enter" to skip to content

Category: Security

Moving TDE Certificates without Files

Jordan Boich performs a migration:

I’ve been automating a lot of the tedious and routine migration tasks for our team for the past few months. Leveraging tools like PowerShell and Azure DevOps Pipelines to consistently deliver results and accomplish the majority of the heavy lifting relating to DBA toil allows us to focus on other tasks and initiatives. While improving my pipeline process, I noticed that the TDE cert migration portion was unreliable and failing often. The specific step backed up the .cer and .pvk file to a network share and attempted to assign file share permissions, and restore the cert with its pvk to the destination server. Connectivity to the share was unreliable, and trying to play permission assignments to a share in flight proved to be more challenging than I was hoping. With that, I sought out a new way to skin the cat. Turns out, you can leverage the certificate’s binary metadata to migrate the TDE cert to another server without having to worry about physical .cer and .pvk files to make that possible. You don’t need a pipeline for this to be useful. Here’s what it looks like by hand.

Click through for the process.

Leave a Comment

Managed Identity per Database in Azure SQL DB

Pratim Dasgupta announces a new preview feature:

Say you’re building an AI assistant that answers questions about your customers’ shipments. Each customer has a database in Azure SQL Database and a private blob container full of files. The assistant doesn’t follow a fixed code path: what it reads depends on the question it’s asked. You’d like the boundary between Customer A’s files and Customer B’s to hold even if something above the database goes wrong.

Azure SQL Database can now draw that boundary at the database level. In this public preview, CREATE DATABASE SCOPED CREDENTIAL can use a managed identity that belongs to a single database, with external tables and OPENROWSET as the first features that use it. Software providers and enterprises can keep many databases on a shared logical server and still give each one its own storage permissions.

Click through to learn what was there before, why it isn’t enough, and what this provides.

Leave a Comment

Availability Groups with a Local Service Account

Dualcore DBA doesn’t need your Active Directory trees:

This post is a follow-on from my previous post where we set up a SQL Server Availability Group on a Windows domain. In this post, we’ll run through the process again but this time, our instances will be running under local service accounts and so the process is slightly different. As in the previous post, both instances I will work on are SQL Server 2022 Developer Edition and so benefit from Enterprise Edition features.

Read on to see how the process differs from a scenario with Active Directory.

Leave a Comment

Finding NTLM Connections to SQL Server

Andreas Wolter shares advice and a script:

In short: I recommend finding out now which connections to your SQL Servers still use NTLM, and fixing them before Windows disables NTLM by default. Most of them fall back to NTLM silently, because of a missing SPN, a connection by IP address or an alias. SQL Server itself has no setting for this – the work is in Active Directory, DNS and client connection strings.

Click through for several reasons why users might be connecting via the old and deprecated protocol, and what to do about it.

Leave a Comment

What Happens when You Enable Private Link on a Fabric Workspace

Gilbert Quevauvilliers performs a test:

In this blog post I am going to explain what happens when you enable Private Link on a Fabric Workspace.

I am currently working with an Enterprise customer who is implementing Private Link Workspaces, and I found that there is a lot of information required to understand how to get it successfully planned and implemented for Microsoft Fabric.

A lot of the information below is from a real world implementation based off of the Microsoft Learn Documents and working directly in Microsoft Fabric.

Click through to see what changes and what the limitations look like, including a variety of images to help explain things.

Leave a Comment

Four Years of sp_CheckSecurity

Jeff Iannucci reflects on a tool:

In recent weeks I’ve been conducting a bit more of our own internal SQL Server Security Checks than usual for our clients. This shouldn’t be a surprise, what with all the stories about “rouge AI” breaches and with Microsoft releasing A LOT more security fixes in their recent Windows and SQL Server updates.

In all these Security Checks we use our sp_CheckSecurity stored procedure to collect a big chunk of the findings. I wrote the original version of this tool a while back, and out of curiosity I wanted to see how long ago that was. It turns out I created the first working version of the tool four years ago this week. Wow, four years! And the things that I have found using that tool could, as my late stepfather might say, make your eyes water.

Inspired by my colleague Andy Kelly’s post introducing the sp_CheckActivity tool that he’s been working on in various forms for years, I thought I would share a bit about the history and intention of sp_CheckSecurity in a similar manner.

Read on for its origin story. Between what Jeff has put together and what Andreas Wolter has created, there are two really good procedures for evaluating the security posture of a given SQL Server instance.

Comments closed

Reviewing the Always Encrypted Paper

Anna Hoffman continues a series on reviewing important academic papers in SQL Server’s history:

Encryption at rest solves one threat. It stops someone who walks off with the disk. It does nothing about someone with administrative access to the running server, because the database decrypts data into memory to do anything useful with it.

For a lot of workloads that gap doesn’t matter. For health records, financial data, or anything where the customer’s threat model includes the cloud operator, it matters a great deal.

Azure SQL Database Always Encrypted (SIGMOD 2020) describes how SQL Server runs real queries, including range comparisons and LIKE patterns, against data it never holds the keys to.

Read on for Anna’s thoughts about the paper, its claims at the time, and how Always Encrypted has changed (for the better) since the original paper.

Comments closed

Securing Microsoft Fabric Gen2 Dataflows API Keys

John Kerski saves some keys:

If you’ve ever developed a Gen1 dataflow to connect to an external API (Application Programming Interface), you know the awkward moment when you have to paste an API key into the Power Query script.

There it sits, in plain text, inside an artifact (the proper name for something like a semantic model, report or dataflow created in the service), with limited options for secret rotation or access control.

Thankfully, Gen2 dataflows improve the story considerably – especially when Azure Key Vault, Microsoft Fabric pipelines, and the newer parameters feature are combined.

In this guide, I’ll show you the pattern I now reach for when I need to pass API secrets into a Fabric Gen2 dataflow without leaving them in code or configuration.

Click through to see how.

Comments closed

Using Direct Lake across Public and Private Link Workspaces

Gilbert Quevauvilliers gets all of the data:

Currently in the Microsoft documentation it talks to not being able to connect from a Public Workspace to a Private Link workspace using DirectLake to a Semantic Model.

What this means in my mind is it is where it is a direct connection from a Public Workspace to a Private Link workspace

NOTE: A Private Link workspace is where inbound connectivity is blocked from the public internet.

In this blog post I am going to show you how to work around this, where at the end I will show you how you can still use DirectLake for a Semantic Model between a Public and Private Link Workspace.

Read on for the solution.

Comments closed

Using Managed Identities to Write Backups to Azure

Warwick Rudd continues a series:

In Part 1 we built somewhere safe to put the backups: a storage account with a delete lock and a container with a time-based retention policy.

The next problem is getting SQL Server to write to it without giving it a password. That’s what the Managed Identity is for. The VM gets an identity in Microsoft Entra ID, SQL Server uses it to authenticate to storage, and there’s no SAS token or storage key anywhere to steal, rotate or forget about.

There are a few moving parts to get there, and most of the time spent on this is in Entra ID and networking rather than SQL Server.

Read on to see what needs to happen.

Comments closed