turbot/azure

steampipe plugin install azuresteampipe plugin install azure
On This Page
Get Involved

Table: azure_sql_server

An Azure SQL server is a relational database management system. As a database server, it is a software product with the primary function of storing and retrieving data as requested by other software applications—which may run either on the same computer or on another computer across a network (including the Internet).

Examples

List servers that have auditing disabled

select
name,
id,
audit -> 'properties' ->> 'state' as audit_policy_state
from
azure_sql_server,
jsonb_array_elements(server_audit_policy) as audit
where
audit -> 'properties' ->> 'state' = 'Disabled';

List servers with an audit log retention period less than 90 days

select
name,
id,
(audit -> 'properties' ->> 'retentionDays')::integer as audit_policy_retention_days
from
azure_sql_server,
jsonb_array_elements(server_audit_policy) as audit
where
(audit -> 'properties' ->> 'retentionDays')::integer < 90;

List servers that have advanced data security disabled

select
name,
id,
security -> 'properties' ->> 'state' as security_alert_policy_state
from
azure_sql_server,
jsonb_array_elements(server_security_alert_policy) as security
where
security -> 'properties' ->> 'state' = 'Disabled';

List servers that have Advanced Threat Protection types set to All

select
name,
id,
security -> 'properties' -> 'disabledAlerts' as security_alert_policy_state
from
azure_sql_server,
jsonb_array_elements(server_security_alert_policy) as security,
jsonb_array_elements_text(security -> 'properties' -> 'disabledAlerts') as disabled_alerts,
jsonb_array_length(security -> 'properties' -> 'disabledAlerts') as alert_length
where
alert_length = 1
and disabled_alerts = '';

List servers that do not have an Active Directory admin set

select
name,
id
from
azure_sql_server
where
server_azure_ad_administrator is null;

List servers for which TDE protector is encrypted with the service-managed key

select
name,
id,
encryption ->> 'kind' as encryption_protector_kind
from
azure_sql_server,
jsonb_array_elements(encryption_protector) as encryption
where
encryption ->> 'kind' = 'servicemanaged';

.inspect azure_sql_server

Azure SQL Server

NameTypeDescription
administrator_logintextSpecifies the username of the administrator for this server.
administrator_login_passwordtextThe administrator login password.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
encryption_protectorjsonbThe server encryption protector.
firewall_rulesjsonbA list of firewall rules fro this server.
fully_qualified_domain_nametextThe fully qualified domain name of the server.
idtextContains ID to identify a SQL server uniquely.
kindtextThe Kind of sql server.
locationtextThe resource location.
nametextThe friendly name that identifies the SQL server.
regiontextThe Azure region/location in which the resource is located.
resource_grouptextThe resource group which holds this resource.
server_audit_policyjsonbSpecifies the audit policy configuration for server.
server_azure_ad_administratorjsonbSpecifies the active directory administrator.
server_security_alert_policyjsonbSpecifies the security alert policy configuration for server.
server_vulnerability_assessmentjsonbSpecifies the server's vulnerability assessment.
statetextThe state of the server.
subscription_idtextThe Azure Subscription ID in which the resource is located.
tagsjsonbA map of tags for the resource.
tags_srcjsonbSpecifies the set of tags attached to the server.
titletextTitle of the resource.
typetextThe resource type of the SQL server.
versiontextThe version of the server.