qua_security_verify#
Checks how the Querona instance the session is connected to protects the secrets it keeps - the instance master key, the credentials stored in the metabase and the secrets in the instance configuration file - and returns one row per finding. It only reads: it never creates or changes a key and writes nothing, so it can be run any number of times, also on an instance that serves clients, for example from a monitoring script.
Syntax#
qua_security_verify [;]
Arguments#
None.
Result set#
Column |
Type |
Description |
|---|---|---|
check_id |
nvarchar(128) |
Identifier of the check, listed below. |
status |
nvarchar(10) |
|
message |
nvarchar(max) |
What was found. |
remedy |
nvarchar(max) |
What to do about it, or NULL. |
The rows come in the order of this table. A check can return more than one row, one per problem it found.
check_id |
What it checks |
|---|---|
master-key.state |
The instance has the master key on this node. |
master-key.portable-copy |
The master key has a password-protected copy, made with
CREATE MASTER KEY. |
secrets.last-re-root |
How the last move of stored credentials under the master key ended. It runs
when the instance starts and when the key is recovered on this node with
CREATE MASTER KEY. A second |
secrets.legacy-remaining |
How many stored credentials are still encrypted under the shared secret
rather than the master key, and where they are stored. |
secrets.unavailable-connections |
The connections whose stored credentials could not be read on this node; they are refused when used. Names the connections. |
config.metabase-connection |
Encryption, certificate validation and password storage of the connection to the metabase. |
config.shared-secret |
Strength and storage of the shared secret in the instance configuration file. |
A check that fails is returned as a row, not raised as an error, so one call reports every problem; a check that
cannot run, for example because the metabase cannot be read, is a FAIL row that says why. SKIPPED
means the check does not apply to the instance, for example because it has no metabase of its own. No finding
contains a password, a key or a secret. check_id and status do not change between releases, so scripts can
match on them; the wording of message and remedy can.
The checks see the configuration the instance runs with. After changing the instance configuration file, restart the instance before running the procedure again.
In a cluster the procedure runs on the serving node, because the standby accepts no client connections. Check the
other node after a planned failover, or on the Cluster page, which shows for each node whether the master key is usable;
see Protect stored credentials. On a cluster node that is not a pilot
(ClusterPilotMode), config.shared-secret is SKIPPED: such a node does not use the shared secret while it
runs. Keep the secret in the instance configuration all the same, because an upgrade of a node whose metabase is
reached with SQL authentication needs it. When such a node has no shared secret it can read and its metabase is
reached with SQL authentication, the row is WARN instead; with any other authentication it stays SKIPPED, and
says that an upgrade which switches the metabase connection to SQL authentication needs the secret first.
Permissions#
Requires the CONTROL SERVER permission.
Example#
Checks the instance the session is connected to. The procedure returns every finding; the rows with status FAIL
or WARN are the ones that need attention.
EXEC qua_security_verify;