SpnManager Kerberos SPN auditing and repair for Active Directory

Get-SqlSpnDiscoveryEngine

Business value

Available today in SqlSpnManager

SQL Server is where this work started. Get-SqlSpnDiscoveryEngine ships in SqlSpnManager, on the PowerShell Gallery now — Install-Module SqlSpnManager. You can run it today.

SPN Manager takes the same approach across the rest of the directory, 26 service families in all. How the two products relate long term is not settled, and the free edition’s scope may narrow toward auditing in a future release. Any version you install stays yours — the Gallery keeps published versions available.

Business value

The Get-SqlSpnDiscoveryEngine command provides valuable insights into SQL Server identities and their associated TCP ports on Windows services. This information can be used to detect potential security risks, optimize database performance, and ensure compliance with organizational policies.

Who uses this

Database administrators, system engineers, and security teams use this command to identify and resolve issues related to SQL Server identities and port configurations.

Risks

  • Incorrectly configured TCP ports may lead to database connection failures or security vulnerabilities.
  • Failure to identify and update SQL Server identities can result in unauthorized access or data breaches.

When a manager cares

Managers care when: - There are reports of database connectivity issues or errors related to SQL Server identities. - Security audits reveal non-compliant configuration settings for TCP ports. - Performance optimization efforts require insight into SQL Server identity configurations.

Day-to-day use

  1. Run the command: Execute Get-SqlSpnDiscoveryEngine in PowerShell to discover SQL services and their associated TCP ports on the local machine or remote machines via WinRM.
  2. Parse results: Use the returned data to identify potential issues, optimize database performance, and ensure compliance with organizational policies.

Common patterns

  • Running this command as part of regular security audits to ensure correct configuration and access control settings for SQL Server identities.
  • Using it after a change or upgrade to verify that SQL services are properly configured and running under the correct identities.

Code examples

Get-SqlSpnDiscoveryEngine -TargetComputer 'remote_machine'
Get-SqlSpnDiscoveryEngine | Where-Object {$_.Port -eq 1433}

Watchpoints

  • Ensure that network access and permissions are properly configured for WinRM on the target machine.
  • Be cautious when using remote registry access to avoid security risks.

What it does in simple terms

This command scans Windows services to find SQL Server identities, identifies their associated TCP ports from the registry (which may not be 1433), and returns this information along with the current state of each service.

Step-by-step recipes

  1. Identify potential issues: Run Get-SqlSpnDiscoveryEngine on a machine or multiple machines via Invoke-SpnParallel.
  2. Review results: Look for discrepancies in SQL Server identities, port configurations, and service states.
  3. Correct identified issues: Update SQL Server identities and their associated TCP ports as necessary.

What to do when stuck

  • Consult the SpnManager module documentation or seek support from the development team if you encounter any errors during execution.
  • Verify that WinRM and remote registry access are properly configured on target machines for successful remote operations.
Field Value
Vendor Detent Point LLC
Product SpnManager 0.4.0
Licence Proprietary - licensed, not sold. See LICENSE.
Operational impact Read-only. Queries Active Directory and reports findings; changes nothing.
Rights required Directory read access. Some providers additionally need rights to read delegation and encryption-type attributes.
Providers covered SQL.Engine
Approval recommendation Approve for general operational use. It cannot alter directory state.

Licence terms are proprietary and are supplied with the purchase, subscription or evaluation agreement. No open-source licence is granted.

What Why
Windows PowerShell 5.1 or later Declared by the module manifest.
ActiveDirectory 1.0.0.0 Required module. Ships with RSAT; install the Active Directory PowerShell feature.
A reachable domain controller Every provider reads from Active Directory.
An account with directory read access Needed to enumerate accounts and their SPNs.
  • Data handling: Ensure that retrieved data is handled in compliance with organizational policies and relevant regulations (e.g., GDPR, HIPAA).
  • Transit: Protect data during transit using secure protocols such as TLS.
  • At rest: Store sensitive data securely at rest, adhering to established security standards and best practices.
  • Audit trail: Maintain an audit trail of command executions for compliance purposes.

This is the sense step. It reads the current state and produces a candidate; nothing is changed. Its output is normally piped into New-SqlSpnPlan. Providers: SQL.Engine.

Example 1

Get-SqlSpnDiscoveryEngine

Example 2

Get-SqlSpnDiscoveryEngine -TargetComputer 'SQL01'

Example 3

Get-SqlSpnDiscoveryEngine | Where-Object Status -eq 'Running' | Format-Table