Skip to main content
Connect Microsoft SQL Server to Oleria to see every login, user, role, and permission across your databases. Oleria also flags risky configurations, such as an enabled sa login, sysadmin members, and logins that can impersonate any other login.
This integration supports self-managed SQL Server (VM or on-premises), AWS RDS for SQL Server, Azure SQL Database, Azure SQL Managed Instance, and Google Cloud SQL for SQL Server. Pick the setup path that matches your deployment below.

What Oleria discovers

Risk signals

Oleria reports these risks for SQL Server:
  • SQL Server sysadmin - fixed sysadmin or CONTROL SERVER, including members of a Windows group login.
  • sa login enabled
  • TRUSTWORTHY database owned by a sysadmin
  • Can impersonate any login
  • SQL login without password policy (CHECK_POLICY = OFF)
  • SQL login password never expires (CHECK_EXPIRATION = OFF)
  • SQL login password expired
  • Orphaned database user
  • guest enabled in a user database
  • Permission granted WITH GRANT OPTION - including members of a role that holds the permission.
  • Explicit grant to public - excluding SQL Server’s built-in defaults.

Prerequisites

  • A dedicated SQL Server login for Oleria, with the read permissions listed for your deployment below.
  • Network access from Oleria to your instance on the configured port (default 1433). Google Cloud SQL is the exception: Oleria connects through the Cloud SQL connector, so you don’t need to allowlist IP addresses.
  • Self-managed instances: SQL Server 2016 or later.
  • Optional: additional permissions on that login, if you also want to run remediation actions. See Remediation actions.
SQL Server silently hides catalog rows that a login can’t see. A login without the read permissions below connects successfully but sees almost nothing. To avoid syncing a partial view, Oleria refuses the connection with an error that names the missing permission. Oleria re-checks permissions on every sync. If you later revoke them, the sync stops with an error instead of removing accounts and access from Oleria.

Set up the integration

1

Create a connector login

Connect as an administrator and create a dedicated login for Oleria. Set CHECK_POLICY = ON so the login follows your password policy.
  • VIEW ANY DEFINITION is required. It exposes all object and security metadata.
  • CONNECT ANY DATABASE is required, unless you create a user for the login in every database instead. If you do, also create one in every database you add later. When Oleria can’t enter an online database, it refuses the connection, and a database added later breaks every sync until the login has a user there.
  • VIEW SERVER STATE is needed to read audit status for activity.
  • To read the audit files for activity, also grant VIEW SERVER SECURITY AUDIT (SQL Server 2022 and later) or CONTROL SERVER (2019 and earlier). Without it, Oleria still syncs access but shows no activity, and the Activity row on the integration’s Capabilities tab shows Needs permission.
SQL Server 2019 and earlier have no narrower permission for reading audit files. CONTROL SERVER is effectively sysadmin, so it turns a read-only connector into a privileged login, and Oleria reports that login as a risk. Use SQL Server 2022 or later if you can, or skip activity.
VIEW ANY SECURITY DEFINITION alone isn’t enough. It hides databases, schemas, and tables from the login.
2

Expand Active Directory groups (optional)

On a domain-joined instance, let Oleria expand the members of Windows group logins. Run this in the master database:
Without this grant, Windows group logins still appear, but Oleria doesn’t list their members.
3

Use Windows authentication (optional)

To connect with Windows authentication instead of a SQL login, create the login from a Windows account:
Then grant it the same permissions as above. Oleria supports two Windows authentication types:
  • Windows authentication (NTLM) uses the account’s domain password.
  • Windows authentication (Kerberos) is for domains that turn NTLM off. Oleria needs the Kerberos Realm and the Kerberos KDC (your domain controllers, reachable from Oleria). The server’s service principal name MSSQLSvc/<host>:<port> must be registered in Active Directory, so enter the server’s Active Directory name as Host.
4

Read SQL Server Agent jobs and proxies (optional)

To inventory Agent jobs and proxies, run this in msdb. Without it, Oleria skips SQL Server Agent and syncs everything else:
Oleria never reads the job step command column, because it can hold passwords.
5

Enable SQL Server Audit for activity (optional)

Create and enable a server audit and a server audit specification. Follow Set up SQL Server Audit below. Oleria reads the files of the enabled audit automatically.

Set up SQL Server Audit

Complete this section only if you want Oleria to show activity. Activity appears within about 5 minutes of the event. This section applies to self-managed SQL Server, AWS RDS, and Google Cloud SQL. Azure SQL Database and Azure SQL Managed Instance can’t write audits to a local folder. Use the Azure auditing options in their setup tabs instead.
1

Create the server audit

Create an audit that writes to a file. Use /var/opt/mssql/audit on Google Cloud SQL, D:\rdsdbdata\SQLAudit\ on AWS RDS, or any folder you choose on self-managed instances. Use these settings:
  • MAXSIZE = 50 MB
  • QUEUE_DELAY = 1000
  • ON_FAILURE = CONTINUE
Name the audit OleriaAudit.
2

Create the server audit specification

Create a server audit specification named OleriaAuditSpec for OleriaAudit. Add the action groups in this table.
The data access groups are what let Oleria show which tables an account reads or writes, tied to the table in your access graph. They also generate a high volume of events, so omit them only if you don’t need that resource access activity. BATCH_COMPLETED_GROUP (SQL Server 2022 and later) is also available, but it is very high volume.
3

Exclude the connector login (optional)

To reduce audit volume, exclude the Oleria login from the audit. Run this before you turn the audit on, because SQL Server doesn’t allow changing an enabled audit:
This isn’t required. Oleria already drops its own sessions when it reads the audit.
4

Turn on the audit

Enable the specification and the audit:
Oleria reads every enabled audit on the instance automatically, so there is no path to enter. The audit fields in the connection form are optional extras: Audit Archive in S3 (AWS RDS), Audit Storage URL (Azure SQL Database storage auditing), and Audit Bucket (optional) (Google Cloud SQL).

Connect Microsoft SQL Server to Oleria

1

Open the integration

Sign in to your Oleria workspace and navigate to Integrations -> Microsoft SQL Server -> Connect.
2

Complete the connection form

Select your Deployment first. The form updates to show only the fields that deployment needs.
The Encryption and Trust Server Certificate options appear only for self-managed servers. For managed services, Oleria always requires encryption and verifies the certificate.
3

Complete the connection

Select Authenticate. Oleria validates the connection and its permissions, discovers your SQL Server accounts, resources, and access, and begins the first sync.

Verify the integration

Confirm Microsoft SQL Server appears on the Connected tab of your Oleria Integrations page. After the first sync completes, you can review the discovered accounts, roles, resources, access grants, and activity in your Oleria workspace. If the connection is refused with an error that names a missing permission, grant that permission to the connector login and try again.

Remediation actions

Oleria validates the connector login’s permissions before it runs each action. Disable user accounts, Enable user accounts, and Revoke permission to resource instance require approval in Oleria before they run. The Capabilities tab on the integration’s page shows which actions the login can run. Every action also refuses provider-managed logins, such as Cloud SQL CloudDbSql… logins, the RDS rdsa login, and ##MS_…## logins.
Oleria never changes its own connector login or that login’s role memberships. Oleria also refuses a name that matches more than one principal, which can happen with case-sensitive collations.

Known limitations

  • No account creation or deletion: Oleria assigns and removes roles, disables or re-enables logins and contained database users, and revokes permissions. It can’t create or delete accounts.
  • Azure SQL Database sessions: On Azure SQL Database, sessions belong to a database. Oleria can end them only with the database-level permissions listed above. Without them, Disable user accounts is refused rather than leaving sessions open.
  • Statement text is redacted: Oleria removes data from audited statements and keeps their shape, such as keywords and table and column names. Oleria replaces literal values it recognizes - strings, numbers in value lists and comparisons, long numbers, emails, and comments - with <redacted>. The redaction is pattern-based, so a short number passed as a function argument can stay visible. Statement text is also capped at 500 characters.
  • Synthetic email: SQL Server principals have no email field. Oleria synthesizes one, which may not match a real address. Windows and Microsoft Entra principals correlate through their directory identifiers, so they match your Active Directory and Microsoft Entra ID integrations.
  • Group membership: Oleria expands the members of Windows group logins only on domain-joined instances where the connector login can run xp_logininfo. Cloud SQL always denies it. Microsoft Entra group membership comes from the Microsoft Entra ID integration, not from SQL Server.
  • DENY evaluation: A member denied a permission doesn’t inherit it from a role on the same object. A DENY at a broader scope, such as a schema, appears as its own denial. Oleria doesn’t subtract it from a narrower grant, such as a table inside that schema.
  • Impersonation in non-TRUSTWORTHY databases: Oleria shows it only for database-scoped accounts, because SQL Server confines it to that database.
  • System and provider databases: master, msdb, model, tempdb, rdsadmin*, and gcloud_cloudsqladmin don’t appear as resources. Oleria reads only SQL Server Agent’s tables in msdb, and only if you grant them. On Cloud SQL, the sqlserver user can’t grant the proxy tables, so Oleria shows Agent jobs but not proxies. On RDS, the master user can’t grant the msdb tables either, and RDS supports only T-SQL job steps.
  • Offline or restoring databases: Oleria lists them as skipped, with their state, and doesn’t scan them.
  • Azure SQL Database login visibility: Seeing SQL logins requires ##MS_LoginManager##, which also allows login management. See the setup steps above.
  • Azure Log Analytics: Oleria reads only the AzureDiagnostics table. Auditing set to the Resource specific destination table isn’t supported.

Contact us

For questions about this integration, contact us at support@oleria.com.