Database scanning credential requirements

The credential requirements detailed on this page apply to both vulnerability and policy scans.

Credentials provide InsightVM with the necessary access to scan an asset. Several types of authentication are supported for vulnerability and policy scanning, including authentication for databases such as Microsoft SQL Server (MSSQL), DB2, MySQL, and Oracle.

You add credentials for databases the same way you create shared credentials for authenticated scans. You'll need to add two sets of credentials: one for the database itself and one for the asset host.

For example, if you have Oracle installed on a Linux machine, you'll need to provide the credentials to log in to the Linux machine as well as credentials for the database. If you are scanning a SQL server, you'll need to specify the CIFS/SMB credentials that are needed to connect to the Windows asset.

Requirements for MSSQL credentials

Rapid7 recommends using Windows authentication to run authenticated scans on MSSQL databases.

If you intend to use Windows authentication, your user account must have read permissions for the following tables (permissions are grouped according to MSSQL version):

1
{
2
"Microsoft_SQL_Server_2008_R2": {
3
"dbo.sysproxylogin",
4
"sys.server_principals",
5
"sys.databases",
6
"sys.symmetric_keys",
7
"sys.sql_logins",
8
"sys.configurations",
9
"sts.configurations",
10
"sys.asymmetric_keys",
11
"master.sys.server_permissions",
12
"sys.assemblies",
13
"sys.sql_logins",
14
"msdb.dbo.sysproxylogin",
15
"sys.assemblies",
16
"master.sys.server_permissions",
17
"sys.configurations",
18
"sys.server_principals",
19
"sys.databases"
20
},
21
"Microsoft_SQL_Server_2008_R2_Database_Engine": {
22
"sys.symmetric_keys",
23
"sys.sysusers",
24
"sys.sql_logins",
25
"sys.configurations",
26
"sys.asymmetric_keys",
27
"sts.configurations",
28
"dbo.sysproxylogin",
29
"master.sys.server_permissions",
30
"sys.sql_logins",
31
"sys.assemblies",
32
"sys.server_principals",
33
"sys.server_principals",
34
"sys.databases"
35
},
36
"Microsoft_SQL_Server_2012": {
37
"dbo.sysproxylogin",
38
"sys.server_principals",
39
"sys.sysusers",
40
"sys.server_audit_specification_details",
41
"sys.databases",
42
"sys.symmetric_keys",
43
"sys.sql_logins",
44
"sys.configurations",
45
"sys.asymmetric_keys",
46
"master.sys.server_permissions",
47
"sys.sql_logins",
48
"sys.assemblies",
49
"msdb.dbo.sysproxylogin",
50
"sys.assemblies",
51
"sys.configurations",
52
"sys.server_principals",
53
"master.sys.server_permissions",
54
"sys.database_principals",
55
"sys.databases"
56
},
57
"Microsoft_SQL_Server_2014": {
58
"dbo.sysproxylogin",
59
"sys.server_principals",
60
"sys.sysusers",
61
"sys.asymmetric_keys",
62
"sys.server_audit_specification_details",
63
"sys.databases",
64
"sys.symmetric_keys",
65
"sys.sql_logins",
66
"sys.configurations",
67
"sys.asymmetric_keys",
68
"master.sys.server_permissions",
69
"sys.sql_logins",
70
"sys.assemblies",
71
"msdb.dbo.sysproxylogin",
72
"sys.assemblies",
73
"sys.configurations",
74
"sys.server_principals",
75
"master.sys.server_permissions",
76
"sys.database_principals",
77
"sys.databases"
78
},
79
"Microsoft_SQL_Server_2016": {
80
"dbo.sysproxylogin",
81
"sys.dm_exec_connections",
82
"sys.server_principals",
83
"sys.sysusers",
84
"sys.server_audit_specification_details",
85
"sys.databases",
86
"sys.symmetric_keys",
87
"sys.sql_logins",
88
"sys.configurations",
89
"sys.asymmetric_keys",
90
"master.sys.server_permissions",
91
"sys.sql_logins",
92
"sys.assemblies",
93
"msdb.dbo.sysproxylogin",
94
"sys.assemblies",
95
"sys.configurations",
96
"sys.server_principals",
97
"master.sys.server_permissions",
98
"sys.database_principals",
99
"sys.databases"
100
},
101
"Microsoft_SQL_Server_2017": {
102
"dbo.sysproxylogin",
103
"sys.dm_exec_connections",
104
"sys.server_principals",
105
"sys.sysusers",
106
"sys.server_audit_specification_details",
107
"sys.databases",
108
"sys.symmetric_keys",
109
"sys.sql_logins",
110
"sys.configurations",
111
"sys.asymmetric_keys",
112
"master.sys.server_permissions",
113
"sys.sql_logins",
114
"sys.assemblies",
115
"msdb.dbo.sysproxylogin",
116
"sys.assemblies",
117
"sys.configurations",
118
"sys.server_principals",
119
"master.sys.server_permissions",
120
"sys.database_principals",
121
"sys.databases"
122
},
123
"Microsoft_SQL_Server_2019": {
124
"dbo.sysproxylogin",
125
"sys.dm_exec_connections",
126
"sys.server_principals",
127
"sys.sysusers",
128
"sys.server_audit_specification_details",
129
"sys.databases",
130
"sys.symmetric_keys",
131
"sys.sql_logins",
132
"sys.configurations",
133
"sys.asymmetric_keys",
134
"master.sys.server_permissions",
135
"sys.assemblies",
136
"sys.sql_logins",
137
"msdb.dbo.sysproxylogin",
138
"sys.assemblies",
139
"sys.configurations",
140
"sys.server_principals",
141
"master.sys.server_permissions",
142
"sys.database_principals",
143
"sys.databases"
144
}
145
}

If you choose not to use Windows authentication, you must use the System Administrator (SA) account.

Usage of SA account may be against some policy rules

While the SA account provides all the access you need to scan your MSSQL database, some policies may regard the usage of the SA account as a violation of policy rules. This is why we recommend using Windows authentication.

When configuring this credential in the Security Console, the following information is required for MSSQL databases:

  • Service - The service identifies the type of database you want to add credentials for. In this case, you need to set this option to “Microsoft SQL Server”.
  • Database - This is the name of the MSSQL database you’re using. The database field by default is set to master.
  • Domain - If you choose to use Windows authentication, you need to provide the Windows domain name.
  • Username - The name of the user's account which is used for authenticating to the database. Depending on your authentication option, this will either be your own user account with the necessary permissions, or the SA account.
  • Password - The password for the user's account which is used for authenticating to the database.

Requirements for PostgreSQL credentials

PostgreSQL credentials are the credentials used to access the database, not the credentials used to access the system hosting the database.

The credentials have the following fields:

  • Database - This field can be left blank and will default to “template1” or the value provided in the scan template. This needs to be any valid database to allow us to connect. “template1” is a database template available in all Postgres installations unless it has been explicitly removed.
  • Domain - This is unused and should not be present in the UI.
  • Username - The username for the database login.
  • Password - The user password.

Requirements for DB2 credentials

For DB2 databases, the following information is required:

  • Service - The service identifies the type of database you want to add credentials for. For DB2, set this option to "DB2".
  • Database - This is the name of the DB2 database you're using. The default database for DB2 is "DB2COPY1".
  • Domain - This field is optional and only applicable if Windows authentication is enabled. Leave this field blank if the database is not using Windows authentication.
  • Username - This is the username for the account that will be used for authenticating to the database. The default username is "db2admin" for Windows and "db2inst1" for Linux and AIX.
  • Password - This is the password for the account that will be used for authenticating to the database.

Requirements for MySQL credentials

For MySQL databases, the following information is required for authentication:

  • Database - This is the name of the MySQL database you're using.
  • User name - The user name for the account that will be used for authenticating to the database.
  • Password - The password for the account that will be used for authenticating to the database.
  • Permissions - InsightVM requires create and select permissions to the following tables:
1
information_schema.GLOBAL_VARIABLES
2
information_schema.plugins
3
mysql.user
4
mysql.slave_master_info
5
mysql.db

Requirements for Oracle credentials

For Oracle databases, the following information is required for authentication:

  • Service - The service identifies the type of database you want to add credentials for. In this case, you need to set this option to "Oracle" for authentication by SID or to "Oracle Service Name" to authenticate by Service Name.
  • SID - The SID represents the unique name for the database. The default SID is "orcl". If your Oracle environment has been set up to use multiple SIDs, choose the Oracle Net Listener Password option and enter your listener password to enumerate SIDs from your environment. For more information on configuring your Oracle Net Listener password, see Oracle’s help documentation.
    • If you want the scan to enumerate all the SIDS found, you need to specify the SIDs. Use the root credentials provided for the scan instead of the listener password for SID enumeration. The Oracle Listener password on Oracle 12c is not supported.
  • Service Name - The Service Name is an alias for the Oracle Database instance.
  • Username - The username for the account that will be used for authenticating to the database. You can use the sys as sysdba account, which is a default admin account that is created during installation.
  • Password - The password for the account that will be used for authenticating to the database.
  • Permissions - InsightVM requires access to the following tables:
1
DBA_USERS_WITH_DEFPWD, ALL_USERS, V$PARAMETER, DBA_PROFILES, DBA_USERS, DBA_TAB_PRIVS, DBA_SYS_PRIVS, DBA_ROLE_PRIVS, ALL_TABLES, DBA_PROXIES, DBA_STMT_AUDIT_OPTS, DBA_PRIV_AUDIT_OPTS, DBA_OBJ_AUDIT_OPTS, V$INSTANCE

Table Access Requirements

InsightVM requires access to the sys.registry$history table in order to determine the patch level of the database. If you’re scanning Oracle DB 12.1.0.2 or newer versions, the scanner needs access to the sys.dba_registry_sqlpatch table instead of sys.registry$history.

Creating a user account with limited access

While InsightVM will scan your database when configured to log in as a highly privileged role such as "sysdba," it is not recommended. You can create a user with more limited access by running the following commands:

1
CREATE USER nxpscan IDENTIFIED BY aStrongerPasswordThanThis;
2
GRANT create session TO nxpscan;
3
GRANT select ON sys.registry$history TO nxpscan;

After you create this account, you can configure a site to use your new Oracle credentials.

Policy scanning for Sybase

Policy scanning for Sybase is currently not available.