Skip to main content
Question

can you scan for local sql sevrer accounts

  • February 24, 2025
  • 5 replies
  • 152 views

Forum|alt.badge.img+3

trying to scan SQL server databases getting all the databases but no local accounts any help will be greatly appreciated

5 replies

  • BeyondTrust Employee
  • 140 replies
  • February 25, 2025

Yes, Password Safe can scan local SQL accounts. You can refer to this KB on how to onboard Microsoft SQL Server Database Managed System and local MS SQL Accounts

https://beyondtrustcorp.service-now.com/csm?id=kb_article_view&sysparm_article=KB0019885


Forum|alt.badge.img
  • Apprentice
  • 4 replies
  • October 29, 2025

Hi Howard,

 

When we run a detailed discovery scan on MS SQL Database it scans the OS and the DB instance but where it does it enumerate the local accounts of the DB instance. When we create a Managed Account Smart Rule, it expects us to know the name of the local accounts inside the DB instance which defeats the purpose of running the scan where the intention is to identify the local account inside the DB instance having admin privileges. 

 

The same limitation is valid for other DB platforms as well such as Oracle, Postgres.

 

When we run the detailed discovery scan on a Windows server which enumerates the user, accounts details so then we can create the Managed Account Smart Rule basis what the scan has found. The details of the scan are visible on the Advanced Details as well.

  • A Smart Rule must be explicitly configured to include each database account name for it to be visible and managed within Password Safe.
  • This means there must have prior knowledge of every individual local database account in order to onboard and manage them — as Password Safe does not automatically associate local database accounts with the database instances.
  • This introduces additional administrative overhead and dependency on complete account inventories, which could affect scalability and the efficiency of future onboarding efforts.
  1. What does this mean for the discovery and management of local DB accounts? 
  2. Are there any alternative recommendations from BT on local DB account management? 

Forum|alt.badge.img
  • BeyondTrust Employee
  • 10 replies
  • October 30, 2025

Hi ​@abhatia , I’d recommend testing a seperate discovery scan account specific to the MS SQL database type. I have seen scanning works better when using a specific database type like - MS SQL for example. Also ensure that it has the required permissions. MSSQL Scan Account Permissions -BeyondInsight / Password Safe - BeyondTrust Discovery Agent scan account permissions 


rhagerm
Forum|alt.badge.img
  • Rising Star
  • 40 replies
  • October 31, 2025

You will need to target specific accounts per the documentation.

That being said, I have a query I use on my SQL Servers to find accounts and bring them in.

SELECT name FROM sys.database_principals WHERE
type_desc = 'SQL_USER' AND [name] not in ('dbo','guest','INFORMATION_SCHEMA','sys')

If I run this against my dev BT instance, I get 1 account. 

 

If there is a local account but it doesn’t have access to any database, it will not show up in the list. You can also filter accounts by adding them to the “name not in” list.

 

You can probably also do this by running the query in a script and using the RestAPI to onboard/offload the accounts based on query results.

 

I would also caution, not all accounts can be managed. You should appreciate the risks of rotating the beyondtrust_user account and the impact that would have on the system.

 

What I am doing is, I only manage accounts where the SQL password policy is enforced. That means password must be rotated every 90 days or SQL Server will disable the account. Other accounts I treat like a service or non-person account. You can rotate the account, but to avoid breaking applications, I set them to a manual password rotation policy so a proper ticket can be created, an outage scheduled off hours and the account owners can then rotate the password and update their applications.

 

One final note, the documentation does not say you have to use name. It says, “In this example: User Account Attributes, Account Name, equals, the name of the account.” I will play with this today and see if I can get it to discover all accounts not in my exclude list.


Forum|alt.badge.img
  • Apprentice
  • 4 replies
  • November 5, 2025

Hi ​@abhatia , I’d recommend testing a seperate discovery scan account specific to the MS SQL database type. I have seen scanning works better when using a specific database type like - MS SQL for example. Also ensure that it has the required permissions. MSSQL Scan Account Permissions -BeyondInsight / Password Safe - BeyondTrust Discovery Agent scan account permissions 

Hi Bhawik,

 

We’re using the local scan account which has the required permissions on the DB. However, the main point to highlight here is that this discovery is very different when compared to a Win/Linux server discovery which enumerates the users/accounts on the BeyondInsight dashboard. 

 

The discovery for DBs only picks up DB instances on a DB server. We had to create Managed Account which matched the account name to onboard the DB local accounts. This discovery is expecting that the account names are known beforehand which makes us rely on the DBA to run the query and fetch us the local accounts.

 

Is there any future roadmap to enumerate the local DB accounts on BeyondInsight dashboard similar to what’s there for Windows/Linux.

 

Regards,

Aditya Bhatia