Authorize SQL Server and follow a scan into evidence
Connect a locally authorized SQL Server database to a managed discovery job, then distinguish a verified connection from a metadata permission gap. This task follows agent enrollment and comes before expanding database privileges or making a migration decision.
Authorize SQL Server and diagnose partial evidence
Loading video…
The demonstration uses a real, disposable SQL Server 2022 database on the Linux lab host, the published native Linux agent, and the production workspace. The database is bound to loopback and uses a short-lived lab certificate explicitly trusted by this connection. The reader has a login but no grants on application tables. No database or control-plane response is mocked. The container, credentials, and temporary agent enrollment are removed afterward.
Get ready
Use an enrolled agent with the database capability, the current native runtime, and an existing private agent configuration. The recording starts with that agent identity already provisioned. It is a database-discovery task, not a second enrollment lesson. If you need the prerequisite, follow agent enrollment and validation and the database agent configuration guide.
Obtain approval to connect to the database. Know the certificate hostname, exact destination IP, port, database name, CA certificate file, and a dedicated metadata-reader account. The lab uses localhost and a temporary loopback port; those values describe the lab topology, not a recommendation to replace your server's certificate hostname with an arbitrary alias.
The reader must be able to authenticate and inspect permitted SQL Server metadata. Start with the narrowest privileges. Additional settings visibility may need an explicitly reviewed grant; it does not justify giving the scanner superuser access or application-table privileges.
Authorize the connection on the agent host
Run the native configuration wizard as the account that will read the agent's local policy:
./agent/runtime/quantum-ready database configure \
--directory /private/qscan/database \
--tenant YOUR_WORKSPACE_ID
Use an actual private directory writable only by the intended account. The path above is illustrative. Keep the policy and credential files on the agent host.
- Enter
sqlserveras the engine. - Enter the hostname on the database server certificate. Certificate identity and destination routing are separate inputs.
- Enter the exact approved destination IP and port.
- Enter the database name, not a connection string containing credentials.
- Supply the absolute path to the CA PEM file that validates the database certificate. Do not bypass certificate verification to make a connection succeed.
- Enter the dedicated reader username. Enter and confirm the password at the hidden prompts.
- Decline optional TDE metadata and aggregate Always Encrypted column metadata for this first task. Each requires a separate permission and scope decision.
- Review and save the authorization. Record its connection ID and policy-file path.
On Linux, credential protection relies on private filesystem ownership and permissions. Keep that distinction separate from Windows user-bound DPAPI protection. Do not describe Linux credential files as encrypted merely because their permissions are restricted.
Attach the policy to the existing agent
Set databasePolicyFile in the existing agent JSON configuration to the policy path reported by the wizard. Preserve the rest of that agent's configuration and credential handling:
{
"databasePolicyFile": "/private/qscan/database/database-policy.json"
}
This is the field to add, not a replacement for your complete agent configuration. Restart or reload the agent using its documented operating mode after configuration changes. Run local preflight as the agent account:
./agent/runtime/quantum-ready database list \
--policy /private/qscan/database/database-policy.json --tenant YOUR_WORKSPACE_ID
./agent/runtime/quantum-ready database check \
--policy /private/qscan/database/database-policy.json --tenant YOUR_WORKSPACE_ID
A successful local check establishes configuration readiness. It is not proof that the database connection or metadata queries will succeed. Confirm the agent's database readiness in the workspace before queuing a job.
Queue the managed discovery task
- Open Discovery scans, then New agent scan.
- Name the job so its purpose is clear in scan history.
- Select Database and enter the saved connection ID.
- Search for and select the agent that owns that authorization. A connection ID belongs to that agent's local policy; it is not interchangeable with another agent's configuration.
- Queue the job once and follow its status. Do not enter a database password into the hosted job form.
- Wait for the job's terminal result and review the accepted observations. A queued job is not an assessment.
Read what was actually observed
Open the matching inventory asset and expand Observation metadata. In this demonstration:
- Certificate verification and exact destination pinning succeed. These are connection checks, not a claim that every session property was observed.
- Version visibility returns SQL Server version
16.0.4305.5and engine edition3. Database definition visibility is false for this reader. - The session metadata probe returns permission denied. The job therefore retains partial coverage and the UI shows coverage gaps.
- TDE and Always Encrypted column metadata are not requested, matching the explicit choices in the local wizard.
- Key establishment and authentication stay unknown. Storage encryption stays not assessed. Do not infer unencrypted storage from a probe that did not run.
Expand Evidence completeness and verification as well. The summary score and confidence fields do not replace the database-specific probes. Preserve coverage gaps when deciding what follow-up work is justified.
Recover from common problems
- No eligible agent appears: confirm the selected agent's database capability, runtime readiness, heartbeat, and local policy. Enrollment alone does not create a database authorization.
- The connection ID is rejected: verify that it is in this agent's policy and belongs to the same workspace. Do not substitute a hostname into the connection-ID field.
- Certificate verification fails: check the certificate hostname, trust chain, validity, CA file, and pinned destination. Do not turn off verification.
- Authentication fails: verify the dedicated account and update its private local credential through the documented configuration path. Keep the password out of logs and tickets.
- Session metadata is permission denied: identify the failed probe and review its documented permission requirement for your SQL Server version and hosting variant with the database administrator. Keep the current result as historical evidence, authorize only the required metadata scope, and rerun. Do not grant
sysadminor application-table access merely to remove the gap. - TDE or column metadata is not requested: decide whether the assessment needs that scope before enabling it locally. Changing a hosted job does not override the local authorization.
- The job is partial: inspect each probe's state. Preserve the distinction between observed, missing, not applicable, permission denied, and failed.
What you accomplished
You approved one SQL Server connection locally, submitted a managed scan referencing that authorization, and traced partial coverage to a specific metadata permission boundary. The next decision is which unanswered cryptographic question matters enough to justify another scoped check.
Narration transcript
Let's connect an enrolled Linux agent to SQL Server and follow the evidence all the way into QScan. This comes after agent enrollment. By the end, you'll have a narrowly authorized connection, a completed scan attempt, and a way to tell missing permissions apart from an insecure database. We're using a temporary SQL Server instance with a login-only reader.
Keep the password here on the agent, under the account that runs it. The prompt hides what you type. We aren't giving this reader access to application tables. For this first scan, leave the optional TDE and encrypted-column probes off. You can authorize those separately when you know which metadata your team needs.
Now create a database discovery job in QScan. Give it a useful name, select the database scanner, and enter the connection identifier from the agent's local configuration. Search for the enrolled agent that owns that policy and select it. Check both values before you submit. This screen schedules the work; it doesn't need your database password.
Start the scan.
Here's the outcome: partial, with one observation. The agent returned evidence, but couldn't answer every question. That isn't a clean bill of health or a failed connection. Find the matching inventory asset and see which probe needs attention.
TLS verification and target pinning passed. Version visibility worked, but session metadata was permission denied. TDE and column inspection say not requested. Key establishment and authentication remain unknown; storage encryption isn't assessed. Missing evidence is not a zero-risk finding.
You've configured SQL Server, scheduled a real scan, and traced a partial result to its permission boundary. Agree on the smallest additional metadata permission with your database administrator before rerunning. Don't broaden the account just to turn a status green.