Database Configuration Keywords
The following table indicates how each keyword in the database compliance checks can be used:
Keyword |
Example Use and Supported Settings |
---|---|
type |
SQL_POLICY |
description |
This keyword provides the ability to add a brief description of the check that is being performed. It is strongly recommended that the Example: description: "DBMS Password Complexity" |
info |
This keyword is used to add a more detailed description to the check that is being performed such as a regulation, URL, corporate policy or other reason why the setting is required. Multiple Example: info: "Checking that \"password complexity\" requirements are enforced for systems using SQL Server authentication." |
sql_request |
This keyword is used to determine the actual SQL request to be submitted to the database. Arrays of data may be requested and returned from a SQL request by using comma-delimited request/return values. Example: sql_request: "select name from sys.sql_logins where type = 'S' and is_policy_checked <> '1'" Example: sql_request: "select name, value_in_use from sys.configurations where name = 'clr enabled'" |
sql_types |
This keyword has two available options:
Example 1: sql_types: POLICY_VARCHAR For multiple return items, configure Example 2: sql_types: POLICY_VARCHAR,POLICY_INTEGER
|
sql_expect |
A comma separated list of the values, or regular expression, to evaluate the results from the SQL query. The values for each of the columns must match the types that are defined in the sql_types. The number of sql_expect items must match the number of sql_types. Numbers do not need double quotes. For text values, surround the text in double quotes ("). If a returned text value can vary in what is returned, use the regular expression in the form of regex:"<expression>". For cases where cases where no rows are returned, use NO_ROWS_RETURNED. This is more explicit than using check_option. Example: sql_expect: regex:"^.+(Failure|ALL)" Example: sql_expect: NULL Example: sql_expect: "clr enabled",0 |
check_option |
Options that are used to adjust how to handle special cases. The most notable option is how to handle what happens when no results are returned.
|
Usage
<custom_item>
type: SQL_POLICY
description: ["description"]
sql_request: ["sql statement to run"]
sql_types: [POLICY_VARCHAR|POLICY_INTEGER][,....]
sql_expect: ["text"|number|regex:"expr"]
(optional) check_option: [CAN_BE_NULL|CAN_NOT_BE_NULL]
</custom_item>