Microsoft's SQL Server documentation distinguishes server-wide roles from database-level permissions, while its linked-server guidance warns that a shared remote security context can extend a link to every user on the local instance. A database server penetration test should ask which identity can reach the service, which data or administration capability it actually receives, and whether a trusted connection carries it farther than the business intended. An open database port is only the first observation.
Quick answer. Scope database server penetration testing around network reachability, representative application and administrator identities, effective privileges on sensitive objects, linked or foreign-server trust, and the cloud control plane where the database is managed. Use synthetic records and safe role checks instead of copying live data or running destructive commands. Stingrai can include this in human-led internal and external network penetration testing, with database owners defining the permitted proof and operational limits.
This buyer guide is for security leaders, DBAs and procurement owners assessing SQL Server, Oracle Database or PostgreSQL estates. It does not assume that every engine supports the same roles, links or provider controls. The statement of work must name the installed version, operating model and relevant integrations. This is also different from a web application penetration test that checks whether application input can alter a query. The database-server workstream starts from approved network and database identities and asks whether the platform's own access decisions hold.
Decide which database boundary the test must prove
The purchase decision should be written as a business rule. An application service identity may need to read and update its own tables but not finance or HR schemas. A reporting user may need selected views but not raw personal records. A DBA may administer one environment but not every production instance. A database link may be needed for a data exchange but should not grant unrelated local users a broad remote identity. These are examples for scoping, not claims about a customer's systems.
The buyer should identify the protected resource, the lower-trust starting identity, the approved operation and the operation that must fail. That turns “test the database” into an evidence-producing plan. A tester can compare a permitted query against a denied query using invented rows or a dedicated schema. A role membership review can explain why the observed behavior occurs. The report should separate an observed action from a configuration-supported permission that was not exercised for safety reasons.
Network position matters. A database may be inaccessible from ordinary workstations but reachable from an application subnet, backup proxy, jump host or remote support path. A scan from the internet or one internal VLAN cannot represent every route. Ask the network owner to identify the trust zones and exceptions that protect each database service. A general enterprise segmentation test can establish broad paths; the database-specific engagement follows the connection into login, role, object and cross-database decisions.
The scope also needs to distinguish service from host. On a self-managed database, the team may assess operating-system exposure, database engine configuration and network access. On a managed service, the cloud provider owns part of the host and service operation, while the customer controls database users, data, network settings and cloud resource permissions within the provider's model. A proposal that promises “root access to the database server” can be wrong for a managed deployment. Name the model before quoting.
Map the five evidence planes
A useful database assessment has five planes: the path to the listener, the effective login or role, the data or function boundary, the connection to another database or service, and the hosting control plane. Not every engagement needs all five at equal depth, but the quote should make inclusions visible. The buyer should give the tester representative accounts and synthetic objects so each selected plane can be checked without touching confidential records.

Figure 1: A database server scope follows network exposure through effective privileges, protected data, linked trust and the managed control plane. Source: Microsoft SQL Server roles, PostgreSQL predefined roles, and Oracle database links.
The planes have different remediation owners. Network engineering may own an unintended route to the listener. IAM or the DBA may own a service account with excess rights. Application engineering may own an integration identity or query design. The cloud team may own security groups or resource-level IAM. A good report gives each finding a practical fix owner and a retest condition. Generic advice to “harden the database” obscures the decision that actually failed.
Network exposure and connection policy
Start with the approved connection map. Which application tiers, administrative jump hosts, backup systems, analytics jobs and partner networks may connect? Which user networks or cloud workloads must be denied? The assessor should use representative source positions and safe protocol-level checks to observe the result. A failed connection to an offline database is inconclusive; it does not prove segmentation. A successful connection to the listener does not prove a user can authenticate or read data. The report should keep those steps separate.
If the estate uses multiple instances or clusters, sampling must follow policy variation. A primary and replica may have different network paths. A development instance may be intentionally accessible from a broader zone, while production is restricted. A managed instance may use a private endpoint and cloud firewall policy; a self-managed host may use an on-premises firewall and host rules. Name the components and paths in the statement of work rather than assuming one IP address represents an application service.
Database availability is an important safety constraint. The rules of engagement should limit connection attempts, avoid exhaustive authentication trials and coordinate with the DBA and monitoring team. A low-impact test host can demonstrate reachability without flooding production logs or affecting connection pools. If a client requires a specific driver or TLS policy, the tester should record that as part of the path. The scope should not be reduced to a generic TCP port check when the buyer's question concerns effective database access.
Effective roles and privileged operations
The database account's effective privileges are more important than its label. Microsoft's server-level role reference says SQL Server server roles have server-wide scope and the sysadmin role can perform any activity in the server. The buyer should ask which named administrators and service identities hold broad roles, whether that matches their tasks, and whether lower-privilege accounts can obtain protected operations through role membership or an inherited permission. Do not infer one SQL Server version's role set applies to another or to Azure SQL Database.
PostgreSQL's predefined-role documentation shows why a role name can have large consequences. The documented pg_read_all_data and pg_write_all_data roles grant broad data access, while row-level security remains a separate policy consideration. A tester should check the deployed version, effective membership and result on selected synthetic objects. If row-level security is used, the buyer should specify a safe role and record that can show whether the policy narrows access. The report should not claim a role bypasses row-level security when the vendor documentation says it does not.
For Oracle, ask for the relevant system and object privileges, roles and any administrative separation that the organization relies on. The exact grants depend on the Oracle version and deployment. The objective is not to list every system privilege in a blog, but to require a scoped check of the lower-trust identities that protect sensitive data or administration. A report should say which effective privilege was observed, which was inferred from configuration, and which role or object group was not tested.
A single DBA account cannot prove ordinary-user separation. Provide at least one application identity, a restricted reporting or support identity and an approved administrator identity where those populations exist. The buyer can use dedicated test accounts with copied role patterns rather than sharing a production human credential. The test should record whether each account can perform its intended work and whether it is denied adjacent sensitive operations. A role that can do nothing because it was misconfigured is not evidence of successful security.
Sensitive data and object permissions
The buyer should define the data classes and schema boundaries, not send real records to a marketing vendor. A synthetic table or view can represent a protected customer dataset. Another can represent a permitted operational dataset. The tester can check read, write and administrative permissions against the expected policy without exporting production content. If the database uses row-level or column-level restrictions, create test rows and fields whose ownership and sensitivity are known in advance.
The evidence should show a positive and negative case. A reporting role might read an approved aggregate view but be denied the underlying sensitive table. An application identity might update its own synthetic row but be denied an unrelated schema. These cases need an available, harmless object and a known expectation. A denied query on a nonexistent table does not prove access control. A successful connection without a query does not prove data exposure. The tester must be able to distinguish those outcomes.
State changes require care. A live database may drive payments, notifications, inventory or regulatory records. The rules of engagement should prohibit modifying production rows, changing schema or running resource-intensive queries unless a separate safe plan exists. A test schema or staging environment may be appropriate for write checks. If staging differs from production in roles or network policy, the report should not generalize the result without checking the relevant configuration difference. The environment and build are part of every conclusion.
Data classification also affects severity. An unintended read of a synthetic table is meaningful when it demonstrates the same permission boundary as a real protected schema, but the report should say how that equivalence was established. It should avoid claiming that actual customer records were accessed if the team intentionally stopped at a synthetic proof. This protects confidentiality and makes the finding more credible to a later reviewer.
Test cross-database trust without crossing the safety line
Database links and foreign-data connections can turn a local permission into access elsewhere. Microsoft's linked-server documentation says linked servers can read remote data or execute commands against remote database servers. It warns that a configuration using a single default remote security context can let any user on the local instance access the remote server with that context. The buyer should include linked-server inventory, login mappings, intended remote permissions and approved test accounts when this feature exists.
Oracle's database-link reference describes links as objects that let one database access another. Its authentication mode can use a fixed user, a connected user or current-user semantics. The assessor should not assume every Oracle link uses one pattern. Ask the DBA to identify links that cross environments or business units and the role under which a test user would reach the remote object. A safe synthetic remote object can show the effective boundary without reading production data.
PostgreSQL uses different terminology. Its user-mapping documentation says a mapping associates a local user with a foreign server and can encapsulate connection information for the foreign-data wrapper. If foreign servers are deployed, the proposal should name them and the data classes they reach. The tester should examine who may use the mapping and whether a lower-trust local role receives more remote access than intended. Do not describe this as identical to a SQL Server linked server or Oracle database link; the mechanisms and permissions differ.
Cross-system trust deserves a separate evidence line because the network may permit the database server to reach a remote system even when the original user's workstation cannot. The assessor needs the local starting role, the remote identity or mapping, the permitted destination, and the observed operation on a synthetic object. An unexpected ability to read remote data can belong to the database link policy, the remote database role, or both. The report should identify the ownership chain and stop before accessing real sensitive content.
The buyer should explicitly authorize remote targets. A database link that points to a supplier or subsidiary is not automatically within the scope of a pentest on the local instance. If the remote owner has not authorized testing, the assessor can review local configuration and document the untested remote consequence. The statement of work must not treat connectivity as permission to test another organization.
Draw the managed-database boundary correctly
A managed database changes what a customer and its tester can control. AWS's RDS for SQL Server documentation lists server-level roles unavailable to the customer, including sysadmin. A proposal built around unrestricted host or sysadmin testing would therefore misstate the RDS model. The buyer should name the exact managed service, then ask the vendor to test customer-controlled database roles, network access, application identities, resource permissions and any cross-service trust within provider rules.
The same principle applies to other managed platforms, but the details differ. Do not assume Azure SQL Database, Azure SQL Managed Instance, RDS PostgreSQL and self-managed PostgreSQL provide identical privileges or host access. The provider's own documentation and the customer's deployed service tier define the boundary. The assessor should distinguish controls the customer can remediate from those the cloud provider operates. A finding on an overly broad customer role is actionable; a wish to change a provider-owned host setting may not be.
Cloud control-plane access can be as consequential as a database login. An IAM role or administrator may alter network exposure, backup settings or database configuration through provider APIs, subject to that service's permissions. If that control plane is part of the buyer's objective, list the cloud account, resource and test identity separately. A database query test does not establish cloud IAM security, and a cloud configuration review does not prove row-level data authorization. The proposal should state whether both are included.
Rules of engagement for managed services should follow the provider's testing and acceptable-use terms. The buyer and vendor should confirm the current policy before fieldwork. The public article does not prescribe a universal permission rule for every cloud service. The test should use the customer's own resources and controlled accounts, with a stop contact if unexpected cross-tenant data appears.
A database test matrix for procurement
The following is an original buyer worksheet. It is not a test sequence mandated by Microsoft, Oracle, PostgreSQL or NIST. Replace its generic labels with real policy decisions and safe fixtures before seeking quotes.
Boundary | Starting position | Intended result | Evidence to request |
|---|---|---|---|
Listener reachability | User network and approved app subnet | User path denied; app path allowed | Source, destination, protocol and control context |
Database role | Restricted app or reporting account | Only assigned operations work | Effective role, permitted and denied synthetic actions |
Sensitive object | Two test schemas or data classes | Protected object denied to lower role | Object relationship and safe read/write result |
Cross-database trust | Local test account with linked route | Only approved remote object reachable | Local and remote identity, mapping, observed result |
Managed control plane | Restricted cloud operator | Cannot alter protected DB setting | Deployed service, resultant permission and owner |
Retest | Same or equivalent safe fixtures | Forbidden action denied; needed work retained | New build or policy, repeatable outcome and limit |
Give vendors a redacted architecture and ask them to mark each row included, excluded or dependent on test access. A database fleet may need several samples: a critical self-managed SQL Server cluster, an Oracle integration hub, a PostgreSQL service with row-level policy, and a managed RDS instance. The right set is based on trust patterns and business impact, not just the number of instances. A proposal should explain why its sample represents the estate and where it does not.
The matrix also exposes commercial differences. One quote may scan database hosts without credentials. Another may review DBA roles. A third may use controlled lower-privilege accounts and synthetic objects to validate real permission decisions, including linked trust. All can be called a “database pentest” in a sales conversation. Ask for the test identities, safe proof objects and reporting format before comparing price.
Production safety and report quality
Databases are operationally sensitive. The rules of engagement should identify approved source IPs, accounts, instance names, query limits, test windows, prohibited changes, monitoring contacts and a stop route. Avoid high-volume enumeration, destructive statements, heavy joins, lock-generating operations and copying real records. If an important permission can only be validated through a risky action, a dedicated test object or representative staging environment may be needed. The report should state which environment supports the conclusion.
Keep credentials, database connection strings and private schema names out of broad email threads and public materials. Test evidence can be shared through the contracted secure portal with redaction for executives. The technical appendix should retain enough detail for the DBA and security team to reproduce a finding safely: starting identity, effective role, protected object, expected policy, observed result, system version, environment and limitation. Do not include live secrets in the report or a blog.
An unexpected success should be classified by control owner. A network exposure may need a firewall or private endpoint change. An excessive role belongs to the DBA or IAM owner. A linked-server mapping can involve both local and remote DBAs. A cloud control-plane permission belongs to the platform team. NIST SP 800-115 emphasizes planning, analyzing findings and mitigation; the report should be an actionable account of the tested boundary rather than a scan transcript.
After remediation, retest the denied case and the necessary permitted case. If a reporting role loses access to a protected table, confirm it still reads its approved view. If a linked route is restricted, confirm the lower role cannot reach the remote synthetic object while the authorized integration still works. If a network rule closes a user-to-database path, confirm the application path remains available. Fixes that simply disable the database for everyone are not successful security outcomes.
The report should record limitations explicitly. A test of one database version does not prove the same role behavior elsewhere. A role export can support an inference but does not substitute for an observed result. A managed-service test can evaluate customer controls but not provider-owned infrastructure without separate authorization. This transparency makes the conclusion useful for engineering, procurement and assurance reviewers without implying universal coverage.
Cost and timing follow privilege variation
There is no reliable universal price for database server penetration testing. Effort depends on engine families, versions, self-managed versus managed deployment, number of distinct privilege models, network zones, linked trust paths, synthetic fixtures and production safety limits. A large fleet of identical instances may be sampled; a single integration-heavy server may require deeper analysis. Ask bidders to estimate by boundary and role variation rather than by IP address alone.
Timing depends on access preparation. DBAs may need to create synthetic schemas and low-privilege identities. Network engineers may need a test host in an app zone. Cloud owners may need a restricted IAM role. Remote database owners may need to authorize link testing. A proposal should separate that preparation from active work, preliminary findings, final report and retest. Starting before the safe fixtures exist often turns a purchased privilege assessment into a narrow port scan.
If a fixed fee is offered, ask which engines, roles, links, cloud resources and proof cases it includes. Ask how the vendor handles an unexpected linked server or an additional managed service found during scoping. The buyer can then decide whether to add a new workstream or document a limitation. Stingrai offers a tailored quote through Get a Quote; its public fixed web application pricing is for one web application and associated APIs, not a database server engagement.
Where Stingrai fits
Stingrai is a CREST-accredited penetration testing company founded in Toronto. Its human-led internal and external network penetration testing can include database services, privileged identities and segmentation where those paths are written into the scope. The buyer and assigned testers can define the engine versions, starting accounts, synthetic objects, cross-database routes and production-safe proof before testing begins.
Two named penetration testers from a team holding OSCE³, OSWE, OSEP, CREST CRT and CISSP certifications work on every human-led engagement, with team-lead and engagement-partner review. Confirmed findings are posted to Stingrai's PTaaS portal with remediation guidance during testing and can be discussed through live chat. Reports are redactable, and retesting is included. A buyer can choose a one-time annual assessment or a continuous program where database access and integrations change frequently.
This is human-led database and network testing. Snipe, Stingrai's autonomous agent, tests web applications and associated APIs; it is not a database-server configuration tester. If application SQL injection or business logic is also a buyer objective, scope a separate web application test with its own user roles and safe records. Distinguishing the layers makes the final evidence more precise.
Frequently Asked Questions
What should database server penetration testing include?
It should include representative network paths, database logins and effective roles, permissions on sensitive synthetic objects, linked or foreign-server routes, and managed-service control-plane permissions where relevant. The report should identify the tested engine and version, starting identity, expected and observed action, safety limit, owner and retest result. A port scan alone cannot establish those decisions.
Is a database vulnerability scan enough?
No. A scan may reveal exposed services or possible software issues. It does not prove that a lower-trust account is denied a protected table, that a linked-server mapping is appropriately narrow, or that a cloud operator cannot change a database resource. An effective test uses controlled identities, synthetic objects and configuration context to validate selected boundaries.
Should SQL Server linked servers be in scope?
Yes, when the database uses them and the remote owner authorizes the test. Microsoft says linked servers can access remote data and warns that a shared default security context can extend remote access to every local user. The scope should name the link, local and remote identities, permitted objects and safe proof. A third-party remote server is not automatically authorized.
How is PostgreSQL role testing different from SQL Server?
PostgreSQL and SQL Server have different role models. PostgreSQL documents broad predefined data roles and separate row-level security behavior; SQL Server documents server-level and database-level roles. The assessor should use the deployed engine's documentation and effective membership rather than translating a role name from one product into an assumed equivalent in another.
Do Oracle database links create a separate test boundary?
Yes, when an Oracle link connects to another database. Oracle documents fixed-user, connected-user and current-user link semantics, so the effective remote identity can differ by design. The buyer should identify the link, permitted local roles, remote owner and synthetic object, then ask the tester to show the observed access or a clearly labelled configuration inference.
What changes for Amazon RDS or another managed database?
The provider owns some infrastructure controls and limits customer privileges. AWS documents that RDS for SQL Server does not expose the sysadmin role, for example. A managed-database scope should focus on customer-controlled network policy, database roles, data permissions, integrations and cloud resource authorization, with the exact service's rules and limitations recorded.
How much does database server penetration testing cost?
There is no reliable universal price. Quote the engine and version differences, self-managed or managed models, role types, network positions, protected schema classes, linked trust routes, safe fixtures and retest scope. Compare proposals on their observed permission decisions and coverage limits, not only a server or port count.
Can a tester prove a privilege issue without reading real data?
Yes. Controlled accounts and synthetic tables or rows can show whether an identity can read, write or administer the type of object at issue. A read-only permission review or supervised lab check can support a conclusion when a production operation is unsafe. The report should say what was observed, what was inferred and what remained untested.
Related reading
References
Microsoft. SQL Server server-level roles. SQL Server 2025 documentation. Read 15 November 2026.
Microsoft. Create linked servers. SQL Server 2025 documentation. Read 15 November 2026.
PostgreSQL Global Development Group. Predefined roles. PostgreSQL 18 documentation. Read 15 November 2026.
PostgreSQL Global Development Group. CREATE USER MAPPING. PostgreSQL 18 documentation. Read 15 November 2026.
Oracle. CREATE DATABASE LINK. Oracle Database 19c documentation. Read 15 November 2026.
AWS. Microsoft SQL Server security in Amazon RDS. Read 15 November 2026.
NIST. SP 800-115: Technical Guide to Information Security Testing and Assessment. Final September 2008. Read 15 November 2026.
Talk to Stingrai
Share the database engines and versions, network positions, role and schema boundaries, linked systems and safe proof limits through Get a Quote or book a free discovery call. Stingrai can scope a human-led database server penetration test around the effective access decisions you need to prove.


