Skip to main content

Run database discovery as a restricted macOS service

SECTIGO QUANTUM READY · PLATFORM TRAINING

Run database discovery as a restricted macOS service

Loading video…

3:40 · English narration and captionsTranscriptDownload lesson

This task follows the database connection lessons. It demonstrates a separately enrolled collector, a private SQLite policy, a signed native service installation, a managed discovery job, and its resulting evidence. The recording uses an owned macOS arm64 machine and a small example database.

The lab already has a dedicated scanner account. The temporary installation reuses that account; this lesson does not claim to demonstrate fresh OpenDirectory account provisioning. Its earlier stopped scanner installation is preserved and restored afterward. That preservation is test-environment housekeeping, not a step required on a new customer installation. The separate relay node is untouched. This collector uses direct egress.

Before you start​

  • Obtain permission to enroll an agent and submit database jobs in the workspace.
  • Use an administrator account on the target Mac for installation. The installed scanner runs under a separate restricted account.
  • Download the current unified macOS package and verify its published identity using the macOS package guide.
  • Put the package and installation inputs in a protected directory. Do not place the agent credential in shell arguments or shell history.
  • Decide which database the collector may inspect. An account that can install a service is not automatically the identity that can read its target or database credentials.

Enroll one database collector​

  1. Open Agent fleet, choose Enroll agent, and expand the individual collector choices.
  2. Choose Database cryptography and review the required permissions.
  3. Give the collector a recognizable name, then create the identity.
  4. Save the credential to a protected file and acknowledge that you saved it.
  5. Review scanner approval. The workspace authorizes database tasks; the local policy independently limits the connections that this Mac can inspect.

This path uses a separately enrolled database identity with the service command in the unified package. Do not substitute a bulk enrollment grant that does not authorize database collection.

Prepare the service account's local scope​

Use the database configuration guide and the corresponding engine lesson to create a versioned local policy. For this SQLite task, the policy maps one connection UUID to one absolute file path, uses the sqlite runtime, and leaves tablespace, TDE and column collection disabled.

The policy's tenantId must match the agent credential's workspace. Save the policy in a private directory accessible to the dedicated service account. On this lab Mac that account is _qscanscanner. The policy and example database are readable only by that account, and the containing directory is private. Ordinary users must not be able to replace either file or redirect the target.

Set databasePolicyFile in the agent configuration to the protected policy's absolute path. Keep unrelated network, SSH and repository scopes empty. Enable managed configuration so the workspace can deliver the reviewed settings.

For PostgreSQL, MySQL and SQL Server, use the engine-specific connection and least-privilege instructions. The background account needs access to the protected database credential file and the approved CA file. Do not assume that a credential saved for your interactive login will work in launchd's context. Cloud-hosted engines have the same service-account boundary in addition to their provider-side access controls.

The recording uses Python only to display JSON in the administrator terminal. The installed scanner is compiled and does not require a system Python interpreter.

Install and inspect the native service​

In an administrator terminal, change to the verified package directory. Set these variables to your own protected files; they contain paths, not the credential itself:

export CONFIG_INPUT="/absolute/protected/path/agent.json"
export TOKEN_INPUT="/absolute/protected/path/agent.token"

sudo ./Deploy-QuantumReady.sh scanner-service install \
--config "$CONFIG_INPUT" \
--token-file "$TOKEN_INPUT"

sudo ./Deploy-QuantumReady.sh scanner-service status

The launcher verifies the signed native release before registering the service. Keep the trusted release identity under administrator control. If verification fails, investigate the downloaded files and permissions; do not bypass signature checks or weaken the protected-cache requirement.

Registration is not a health check. Confirm the restricted process identity locally, then open the fleet page and check recent contact, the compiled runtime version, database readiness, and the applied configuration. A service can be registered while its configuration is invalid or its control-plane connection is unavailable.

Submit a job and inspect its evidence​

  1. Open Discovery scans and create an agent scan.
  2. Choose Database cryptography, enter a useful job name, and select this Mac.
  3. Enter the approved connection UUID. Do not enter a new arbitrary local path; the service resolves the UUID through its private local policy.
  4. Submit the job. Refresh the latest results and inspect its terminal status.
  5. Open Cryptographic inventory, locate the resulting asset, and expand observation metadata.
  6. Read the observed engine and metadata alongside unsupported or unknown encryption fields.

A SQLite metadata task can return Coverage gaps while still producing useful evidence. It does not establish disk encryption, application encryption, or server TLS. Use the SQLCipher and server-engine lessons for those different inspection paths. Never translate missing evidence into proof of low risk.

The recording's verification checks that the sample application row was not uploaded and the database file remained unchanged. No external service is mocked in this lesson.

Retire a temporary collector​

sudo ./Deploy-QuantumReady.sh scanner-service stop
sudo ./Deploy-QuantumReady.sh scanner-service remove
sudo ./Deploy-QuantumReady.sh scanner-service status

Then revoke and archive the temporary identity in Agent fleet. Removing the local service and revoking its cloud access are separate actions. The native removal workflow preserves private configuration for controlled recovery; follow your retention policy before deleting it. A permanent collector normally remains installed under its approved configuration.

Recover from common problems​

  • Registered but no heartbeat: inspect the service log, local preflight checks, configuration field names, network route and trust configuration. Registration alone does not prove usable runtime health.
  • Interactive scan succeeds but the service fails: check the dedicated account's access to the policy, target, credentials and CA files.
  • A configuration change is rejected: use the documented managed macOS configuration command. Preserve transaction journals and use its recovery path rather than overwriting protected installed files.
  • Job has coverage gaps: read the returned evidence states and engine visibility limits. A partial result is not equivalent to a failed connection or confirmed encryption.
  • Signature or package-cache error: obtain the correct published package, verify its identity and directory protections, and retry the documented command.

Narration transcript​

Let's carry database discovery into a macOS background service. This follows the database connection lessons and the Windows and Linux service walkthroughs. We'll enroll one collector, give its dedicated account access to one approved SQLite file, install the signed service, and follow a real job into the inventory. By the end, you'll know how to separate installation, local authorization, and successful discovery. Those are three different checks, even when the installer finishes cleanly.

Start by enrolling an individual database collector. Use a name your team can recognize, and save its credential in a protected file. This is a separate identity for this Mac. Approving database cryptography in the workspace lets the device receive that kind of task. It doesn't give the service permission to read every database on the computer. We still need to define its local scope, under the account that will actually run the scan.

Here's that local boundary. The policy maps an opaque connection identifier to one approved SQLite file. Its private directory and read permissions belong to the scanner's dedicated account. Other users can't replace the policy or redirect the target. For a server database, use the engine-specific connection instructions and make its protected credentials and certificate authority file available to this same service identity. Your interactive login's access doesn't automatically carry over into launchd.

We're installing through the unified macOS package's scanner service command. The configuration file and enrollment credential are separate protected inputs. The launcher verifies the signed native release before registering it with launchd. This is a native binary deployment; the scanner doesn't depend on a system Python installation. Keep the downloaded package protected and verify the published release identity. If verification fails, investigate the package or permissions instead of bypassing the check.

Now check both sides. Locally, the service is registered and runs under the dedicated scanner account. In the workspace, look for recent contact, the compiled runtime version, and the applied configuration. A registered launchd job is only an installation result. The workspace also needs a current heartbeat and database readiness before we can call this collector usable. If one of those is missing, check its configuration and local policy before queuing more work.

Create a database discovery task and select this Mac. For the target, enter the approved connection identifier, not an arbitrary local file path. Give the job a useful name, submit it, and refresh the latest results. The service resolves that identifier through its own policy. We're scanning a small owned example database, and the verification checks that its application row stays on the host and the file remains unchanged.

Open the resulting observation and read what it actually proves. We have database metadata from this collector and this task. Unsupported cipher probes and unknown encryption states remain visible. A metadata result doesn't prove that the disk is encrypted, or that an application uses safe cryptography. For SQLCipher or a database server, continue with the matching engine lesson. Keep the evidence boundary attached to the finding when you explain it to someone else.

We've connected the full macOS service path: separate enrollment, restricted local scope, verified native installation, a real managed job, and its evidence. For this temporary collector, we'll stop and remove the service, then revoke and archive its cloud identity. The demonstration restores the Mac's earlier stopped installation afterward. For your permanent collector, leave the approved service installed and move on to rollout policy, monitoring, and the database-specific permission checks.