module/ConfigurationProvider/ControlConfigurations/Services/SQLServer.json

{
  "FeatureName": "SQLServer",
  "Reference": "aka.ms/azsktcp/sqldatabase",
  "IsMaintenanceMode": false,
  "Controls": [
    {
      "ControlID": "Azure_SQLDatabase_AuthZ_Use_AAD_Admin",
      "Description": "Enable Azure AD admin for the SQL Database",
      "Id": "SQLDatabase120",
      "ControlSeverity": "High",
      "Automated": "Yes",
      "MethodName": "CheckSqlServerADAdmin",
      "Rationale": "Using the native enterprise directory for authentication ensures that there is a built-in high level of assurance in the user identity established for subsequent access control. All Enterprise subscriptions are automatically associated with their enterprise directory (xxx.onmicrosoft.com) and users in the native directory are trusted for authentication to enterprise subscriptions.",
      "Recommendation": "1. For SQL servers run command: Set-AzSqlServerActiveDirectoryAdministrator -ResourceGroupName '{ResourceGroupName}' -ServerName '{ServerName}' -DisplayName '{AzureAdAdmin Display Name}' Refer: https://docs.microsoft.com/en-us/powershell/module/az.sql/set-azsqlserveractivedirectoryadministrator. 2. For Synapse Analytics workspaces run command: Set-AzSynapseSqlActiveDirectoryAdministrator -ResourceGroupName '{ResourceGroupName}' -WorkspaceName '{Workspace Name}' -DisplayName '{AzureAdAdmin Display Name}' Refer: https://docs.microsoft.com/en-us/powershell/module/az.synapse/set-azsynapsesqlactivedirectoryadministrator?view=azps-7.2.0",
      "Tags": [
        "SDL",
        "TCP",
        "Automated",
        "AuthZ",
        "Baseline",
        "Daily",
        "CSEOPilotSub"
      ],
      "Enabled": true,
      "ControlScanSource": "MDCorReader",
      "AssessmentProperties": {
        "AssessmentNames": [
          "f0553104-cfdb-65e6-759c-002812e38500"
        ],
        "AssessmentStatusMappings": [
          {
            "AssessmentStatusCode": "NotApplicable",
            "EffectiveVerificationResult": "Failed",
            "AssessmentStatusCausePatterns": "(.)*OffByPolicy|Exempt(.)*",
            "AppendMessageToStatusReason": "Disabling or exempting the policy from getting evaluated is not recommended. The Control will be marked as Failed."
          }
        ]
      },
      "ControlEvaluationDetails": {
        "RequiredProperties": [
          "IsADAdministratorEnabled"
        ]
      },
      "PolicyDefinitionGuid": "1f314764-cb73-4fc9-b863-8eca98ac36e9",
      "DisplayName": "Use AAD Authentication for SQL Database",
      "Category": "Authentication must be enabled on all user accounts and services",
      "ControlRequirements": "Access to data, networks, services, utilities, tools, and applications must be controlled by authentication and authorization mechanisms",
      "CustomTags": [
        "TenantBaseline",
        "CSEOBaseline",
        "MSD",
        "Prod",
        "P1",
        "Wave7",
        "ShadowITActiveBaseline",
        "CSEOPilot",
        "SN:SQL_AADAuth"
      ]
    },
    {
      "ControlID": "Azure_SQLDatabase_DP_Enable_TDE",
      "Description": "Enable Transparent Data Encryption on SQL databases",
      "Id": "SQLDatabase150",
      "ControlSeverity": "High",
      "Automated": "Yes",
      "MethodName": "CheckSqlDatabaseTDE",
      "DisplayName": "Enable Transparent Data Encryption on SQL databases",
      "Category": "Encrypt data at rest",
      "ControlRequirements": "Data must be encrypted in transit and at rest",
      "Rationale": "Using this feature ensures that sensitive data is stored encrypted at rest. This minimizes the risk of data loss from physical theft and also helps meet regulatory compliance requirements.",
      "Recommendation": "Run command Set-AzSqlDatabaseTransparentDataEncryption -ResourceGroupName '{ResourceGroupName}' -ServerName '{ServerName}' -DatabaseName '{DatabaseName}' -State 'Enabled'. Refer: https://docs.microsoft.com/en-us/powershell/module/az.sql/set-azsqldatabasetransparentdataencryption *Note:If Blob Auditing or Threat Detection are enabled on the server, they will always apply to the database, regardless of the database level settings.",
      "Tags": [
        "SDL",
        "TCP",
        "Automated",
        "DP",
        "SqlDatabase",
        "Baseline",
        "Daily",
        "CSEOPilotSub"
      ],
      "Enabled": true,
      "ControlScanSource": "MDCorReader",
      "AssessmentProperties": {
        "AssessmentNames": [
          "651967bf-044e-4bde-8376-3e08e0600105"
        ],
        "AssessmentStatusMappings": [
          {
            "AssessmentStatusCode": "NotApplicable",
            "EffectiveVerificationResult": "Failed",
            "AssessmentStatusCausePatterns": "(.)*OffByPolicy|Exempt(.)*",
            "AppendMessageToStatusReason": "Disabling or exempting the policy from getting evaluated is not recommended. The Control will be marked as Failed."
          }
        ],
        "ResourceDetails": {
          "HasExtendedResourceId": true,
          "ExtendedIdResourceTypes": [
            "Microsoft.Sql/servers/databases"
          ],
          "ExcludeExtendedIdPatterns": ".*/master$"
        }
      },
      "ControlEvaluationDetails": {
        "RequiredProperties": [
          "SQLDatabaseTDEDetails"
        ]
      },
      "PolicyDefinitionGuid": "17k78e20-9358-41c9-923c-fb736d382a12",
      "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/17k78e20-9358-41c9-923c-fb736d382a12",
      "CustomTags": [
        "SOX",
        "CSEOBaseline",
        "MSD",
        "Prod",
        "CSEOPilot",
        "TenantBaseline",
        "P1",
        "Wave6",
        "ShadowITActiveBaseline",
        "SN:SQL_TDE"
      ]
    },
    {
      "ControlID": "Azure_SQLDatabase_Audit_Enable_Threat_Detection_Server",
      "Description": "Enable SQL Server threat detection with email admins option. Do not exclude any detection types",
      "Id": "SQLDatabase160",
      "ControlSeverity": "High",
      "Automated": "Yes",
      "MethodName": "CheckSqlServerThreatDetection",
      "Rationale": "Enabling threat detection helps generate alerts about suspicious activity that might indicate attacks such as SQL Injection, login from a new location, unusual usage patterns and related attacks in a timely manner.",
      "Recommendation": "First run command 'Set-AzSqlServerAudit -ResourceGroupName '{ResourceGroupName}' -ServerName '{ServerName}' -StorageAccountResourceId '{StorageAccountResourceId}' -BlobStorageTargetState 'Enabled' -RetentionInDays 365'.Refer: https://docs.microsoft.com/en-us/powershell/module/az.sql/set-azsqlserveraudit. Then run command 'Update-AzSqlServerAdvancedThreatProtectionSetting -ResourceGroupName '{ResourceGroupName}' -ServerName '{ServerName}' -StorageAccountName '{StorageAccountName}' -EmailAdmins `$true -ExcludedDetectionType 'None''.",
      "Tags": [
        "SDL",
        "TCP",
        "Automated",
        "Audit",
        "Baseline",
        "Daily",
        "CSEOPilotSub"
      ],
      "Enabled": true,
      "ControlEvaluationDetails": {
        "RequiredProperties": [
          "SQLServerAuditSetting",
          "SQLServerAlertPolicies"
        ]
      },
      "ControlSettings": {
        "SecurityContacts": {
          "NotificationsRecipientsRoleName": [
            "Owner",
            "ServiceAdmin"
          ]
        }
      },
      "PolicyDefinitionGuid": "abfb4388-5bf4-4ad7-ba82-2cd2f41ceae9",
      "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/abfb4388-5bf4-4ad7-ba82-2cd2f41ceae9",
      "DisplayName": "Enable advanced data security on your SQL servers",
      "Category": "Monitoring must be enabled",
      "ControlRequirements": "Monitoring and auditing must be enabled and correctly configured according to prescribed organizational guidance",
      "CustomTags": [
        "SOX",
        "TenantBaseline",
        "CSEOBaseline",
        "MSD",
        "Prod",
        "CSEOPilot",
        "P1",
        "Wave6",
        "ShadowITActiveBaseline",
        "SN:SQL_ADS"
      ]
    },
    {
      "ControlID": "Azure_SQLDatabase_AuthZ_Use_IP_Firewall_Rules_DB",
      "Description": "In a SQL Server with multiple databases, setup firewall rules also at the database level",
      "Id": "SQLDatabase190",
      "ControlSeverity": "High",
      "Automated": "No",
      "MethodName": "",
      "Rationale": "Using the IP firewall rules ensures that access to the data or the service is restricted to a specific set of IPs. NOTE: While this control does provide an extra layer of access control protection, it may not always be feasible to implement in all scenarios.",
      "Recommendation": "Wherever feasible, restrict each SQL Database to a limited set of IP addresses/ranges that require access to that database. Refer: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-firewall-configure. Note: In case the IP range is indeterminate (for instance, if the client is a PaaS endpoint), you may need to attest this control.",
      "Tags": [
        "SDL",
        "TCP",
        "Manual",
        "AuthZ",
        "SqlDatabase"
      ],
      "Enabled": false,
      "CustomTags": []
    },
    {
      "ControlID": "Azure_SQLDatabase_AuthN_Dont_Use_SQL_AuthN",
      "Description": "Do not use SQL Authentication. Use AAD-authentication instead",
      "Id": "SQLDatabase210",
      "ControlSeverity": "High",
      "Automated": "No",
      "MethodName": "",
      "Rationale": "Using the native enterprise directory for authentication ensures that there is a built-in high level of assurance in the user identity established for subsequent access control. All Enterprise subscriptions are automatically associated with their enterprise directory (xxx.onmicrosoft.com) and users in the native directory are trusted for authentication to enterprise subscriptions.",
      "Recommendation": "Disable SQL Authentication on the DB and use AAD authentication instead. Refer: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-aad-authentication",
      "Tags": [
        "SDL",
        "TCP",
        "Manual",
        "AuthN"
      ],
      "Enabled": false,
      "CustomTags": []
    },
    {
      "ControlID": "Azure_SQLDatabase_DP_Use_Client_Side_Encryption",
      "Description": "Client-side encryption should be used where appropriate",
      "Id": "SQLDatabase260",
      "ControlSeverity": "Medium",
      "Automated": "No",
      "MethodName": "",
      "Rationale": "Using client-side encryption in 'Always Encrypted' mode helps protect sensitive data at rest on the server, during movement between client and server and ensures that only client applications or app servers that have access to the encryption keys can access plaintext data.",
      "Recommendation": "The recommended client side encryption solution is 'Always Encrypted'. Refer: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-always-encrypted",
      "Tags": [
        "SDL",
        "TCP",
        "Manual",
        "DP"
      ],
      "Enabled": false,
      "CustomTags": []
    },
    {
      "ControlID": "Azure_SQLDatabase_AuthZ_Grant_Min_Access",
      "Description": "Access to SQL Servers and DBs must be granted in accordance with the principle of least privilege",
      "Id": "SQLDatabase320",
      "ControlSeverity": "Medium",
      "Automated": "No",
      "MethodName": "",
      "Rationale": "Granting minimum access ensures that users are granted just enough permissions to perform their tasks. This minimizes exposure of the resources in case of user/service account compromise.",
      "Recommendation": "Using SSMS Object Explorer and T-SQL to assign database roles, e.g. db_datareader, db_datawriter, db_securityadmin: Alter Role db_datareader ADD MEMBER ApplicationUser; to allow ApplicationUser to read data, Alter Role db_datawriter ADD MEMBER ApplicationUser; to allow ApplicationUser to write data. Refer: https://azure.microsoft.com/en-us/documentation/articles/sql-database-security/#authorization, http://blogs.technet.com/b/scotts-it-blog/archive/2014/09/03/adding-accounts-to-database-roles-in-sql-server-2012.aspx",
      "Tags": [
        "SDL",
        "TCP",
        "Manual",
        "AuthZ"
      ],
      "Enabled": false,
      "CustomTags": []
    },
    {
      "ControlID": "Azure_SQLDatabase_NetSec_Dont_Allow_Universal_IP_Range",
      "Description": "Do not use Any-to-Any IP range for Azure SQL Database.",
      "Id": "SQLDatabase360",
      "ControlSeverity": "High",
      "DisplayName": "Do not use Any-to-Any IP range for Azure SQL Database",
      "Category": "Deploy controls to restrict network traffic",
      "ControlRequirements": "Restrict network traffic flows",
      "ControlEvaluationDetails": {
        "RequiredProperties": [
          "FirewallRules"
        ]
      },
      "Automated": "Yes",
      "MethodName": "CheckSqlDatabaseFirewallIPAddressRange",
      "Rationale": "Using the firewall feature ensures that access to the data or the service is restricted to a specific set/group of clients. NOTE: While this control does provide an extra layer of access control protection, it may not always be feasible to implement in all scenarios.",
      "Recommendation": "Do not configure Any to Any firewall IP address. Run command Remove-AzSqlServerFirewallRule -FirewallRuleName '{AnyToAny FirewallRule Name}' -ResourceGroupName '{ResourceGroupName}' -ServerName '{ServerName}'. Refer: https://docs.microsoft.com/en-us/powershell/module/az.sql/Remove-AzSqlServerFirewallRule",
      "Tags": [
        "SDL",
        "Best Practice",
        "Automated",
        "NetSec",
        "Baseline",
        "Weekly"
      ],
      "ControlSettings": {
        "IPRangeStartIP": "0.0.0.0",
        "IPRangeEndIP": "255.255.255.255",
        "FirewallRuleName_AllowAzureIps": "AllowAllWindowsAzureIps"
      },
      "Enabled": true,
      "CustomTags": [
        "SOX"
      ]
    },
    {
      "ControlID": "Azure_SQLDatabase_Audit_Enable_Logging_and_Monitoring_Server",
      "Description": "Enable SQL Server audit with selected event types and retention period of minimum 365 days",
      "Id": "SQLDatabase140",
      "ControlSeverity": "Medium",
      "Automated": "Yes",
      "MethodName": "CheckSqlServerAuditing",
      "DisplayName": "Ensure Azure SQL Server auditing is configured correctly",
      "Category": "Monitoring must be enabled",
      "ControlRequirements": "Monitoring and auditing must be enabled and correctly configured according to prescribed organizational guidance",
      "Rationale": "Auditing enables log collection of important system events pertinent to security. Regular monitoring of audit logs can help to detect any suspicious and malicious activity early and respond in a timely manner.",
      "Recommendation": "Run command Set-AzSqlServerAudit -ResourceGroupName '{ResourceGroupName}' -ServerName '{ServerName}' -StorageAccountResourceId '{StorageAccountResourceId}' -BlobStorageTargetState 'Enabled' -RetentionInDays 365. Refer: https://docs.microsoft.com/en-us/powershell/module/az.sql/set-azsqlserveraudit. Through Portal: After logging into subscription, go under Home -> Select Azure SQL server -> Under security section select auditing. Ensure auditing is turned ON. If selecting storage, ensure that the retention period is set to at least 365 days.",
      "Tags": [
        "SDL",
        "TCP",
        "Automated",
        "Audit",
        "Baseline",
        "Weekly"
      ],
      "ControlSettings": {
        "SqlServer": {
          "AuditRetentionPeriod_Min": 365,
          "AuditRetentionPeriod_Forever": 0
        }
      },
      "Enabled": true,
      "CustomTags": [
        "SOX",
        "P1",
        "Wave99",
        "CSEOBaseline",
        "CSEOPilot",
        "SN:SQL_audit"
      ]
    },
    {
      "ControlID": "Azure_SQLDatabase_Audit_Review_Logs_Periodically",
      "Description": "Logs should be reviewed routinely",
      "Id": "SQLDatabase250",
      "ControlSeverity": "Medium",
      "Automated": "No",
      "MethodName": "",
      "Rationale": "Periodic reviews of diagnostics, activity and audit logs ensures that anomalous activity can be identified early enough instead of after a major compromise.",
      "Recommendation": "Use Azure SQL Audit Logs Excel template to review logs. Refer: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-auditing#subheading-3",
      "Tags": [
        "SDL",
        "TCP",
        "Manual",
        "Audit"
      ],
      "Enabled": false,
      "CustomTags": []
    },
    {
      "ControlID": "Azure_SQLDatabase_DP_Review_Data_Masking_Policy",
      "Description": "Review the Data Masking policy for SQL Database sensitive data columns if in use.",
      "Id": "SQLDatabase370",
      "ControlSeverity": "Medium",
      "Automated": "Yes",
      "MethodName": "CheckSqlServerDataMaskingPolicy",
      "Rationale": "Database dynamic data masking limits sensitive data exposure by masking it to non-privileged users and hides the sensitive data in the result set of a query over designated database fields. When used dynamic data masking should cover all sensitive columns.",
      "Recommendation": "(As applicable) Set Data Masking Rules using the following steps: (1) Run command Set-AzSqlDatabaseDataMaskingRule -ResourceGroupName '{ResourceGroupName}' -ServerName '{ServerName}' -DatabaseName '{DataBaseName}' -SchemaName '{SchemaName}' -TableName '{TableName}' -ColumnName '{ColumnName}'. Refer: https://docs.microsoft.com/en-us/powershell/module/az.sql/set-azsqldatabasedatamaskingrule (2) Verify the privileged users to whom access is granted to view Unmasked data columns.",
      "Tags": [
        "SDL",
        "TCP",
        "Automated",
        "Deploy"
      ],
      "Enabled": false,
      "CustomTags": []
    },
    {
      "ControlID": "Azure_SQLDatabase_AuthZ_Firewall_Deny_Access_AzureServices",
      "Description": "Use the 'Allow access to Azure services' flag only if required.",
      "Id": "SQLDatabase380",
      "ControlSeverity": "Medium",
      "DisplayName": "Use the 'Allow access to Azure services' flag only if required",
      "Category": "Management interfaces and ports must not be open",
      "ControlRequirements": "Restrict network traffic flows",
      "ControlEvaluationDetails": {
        "RequiredProperties": [
          "FirewallRules"
        ]
      },
      "ControlSettings": {
        "FirewallRuleName_AllowAzureIps": "AllowAllWindowsAzureIps"
      },
      "Automated": "Yes",
      "MethodName": "CheckSqlServerFirewallAccessAzureService",
      "Rationale": "The 'Allow access to Azure services' setting configures a very broad range of IP addresses from Azure as permitted to access the SQL Server. Please make sure your scenario really requires this setting before enabling it. Turning it ON exposes your SQL Server to risk of attacks from resources (IPs) owned by others in the Azure region.",
      "Recommendation": "Turn off the allow access to Azure services flag. Run command Remove-AzSqlServerFirewallRule -FirewallRuleName 'AllowAllWindowsAzureIps' -ResourceGroupName '{ResourceGroupName}' -ServerName '{ServerName}'. Refer: https://docs.microsoft.com/en-us/powershell/module/az.sql/remove-azsqlserverfirewallrule",
      "Tags": [
        "SDL",
        "Best Practice",
        "Automated",
        "AuthZ",
        "Baseline",
        "Weekly"
      ],
      "Enabled": true,
      "CustomTags": [
        "SOX"
      ]
    },
    {
      "ControlID": "Azure_SQLDatabase_Audit_Enable_Vuln_Assessment",
      "Description": "Enable SQL Server vulnerability assessments with email admins option.",
      "Id": "SQLDatabase390",
      "ControlSeverity": "Medium",
      "Automated": "Yes",
      "MethodName": "CheckSqlServerVulnerabilityAssessmentSetting",
      "Rationale": "Known database vulnerabilities in a system can be easy targets for attackers. A vulnerability assessment solution can help to detect/warn about vulnerabilities in the system and facilitate addressing them in a timely manner.",
      "Recommendation": "First run command 'Enable-AzSqlServerAdvancedDataSecurity -ResourceGroupName '{ResourceGroupName}' -ServerName '{ServerName}''. Then run command 'Update-AzSqlServerVulnerabilityAssessmentSetting -ResourceGroupName '{ResourceGroupName}' -ServerName '{ServerName}' -StorageAccountName '{StorageAccountName}' -ScanResultsContainerName 'vulnerability-assessment' -RecurringScansInterval Weekly -EmailAdmins $true -NotificationEmail @('mail1@mail.com' , 'mail2@mail.com')'.",
      "Tags": [
        "SDL",
        "TCP",
        "Automated",
        "Audit",
        "Baseline",
        "Weekly"
      ],
      "Enabled": true,
      "ControlEvaluationDetails": {
        "RequiredProperties": [
          "VulnerabilityAssessmentSetting"
        ]
      },
      "DisplayName": "Enable Vulnerability assessment on your SQL servers",
      "Category": "Vulnerability assessments must be enabled on all services",
      "ControlRequirements": "Vulnerability scans must be performed and vulnerabilities remediated according to prescribed organizational guidance",
      "CustomTags": [
        "P1",
        "Wave99",
        "SN:SQL_assessment"
      ]
    },
    {
      "ControlID": "Azure_SQLDatabase_SI_Remediate_Security_Vulnerabilities",
      "Description": "Vulnerabilities on your SQL databases should be remediated.",
      "Id": "SQLDatabase400",
      "ControlSeverity": "High",
      "Automated": "Yes",
      "MethodName": "",
      "DisplayName": "Vulnerabilities on your SQL databases must be remediated",
      "Category": "Vulnerabilities must be remediated",
      "ControlRequirements": "Vulnerability scans must be performed and vulnerabilities remediated according to prescribed organizational guidance",
      "AssessmentName": "fe02b3b7-a722-d4d6-6731-6493776203a6",
      "ControlScanSource": "MDC",
      "AssessmentProperties": {
        "AssessmentNames": [
          "82e20e14-edc5-4373-bfc4-f13121257c37"
        ],
        "AssessmentStatusMappings": [
          {
            "AssessmentStatusCode": "NotApplicable",
            "EffectiveVerificationResult": "Failed",
            "AssessmentStatusCausePatterns": "(.)*OffByPolicy|Exempt|Exempt by Rule|Disabled parent assessment|(.)*",
            "AppendMessageToStatusReason": "Disabling or exempting the policy from getting evaluated is not recommended. The Control will be marked as Failed."
          }
        ],
        "ResourceDetails": {
          "HasExtendedResourceId": true,
          "ExtendedIdResourceTypes": [
            "Microsoft.Sql/servers/databases"
          ],
          "ExcludeExtendedIdPatterns": ".*/master$"
        }
      },
      "Rationale": "Known database vulnerabilities in a system can be easy targets for attackers. A vulnerability assessment solution can help to detect/warn about vulnerabilities in the system and facilitate addressing them in a timely manner.",
      "Recommendation": "Go to security center --> Data & storage --> SQL --> Click on SQL server name --> Click on Recommendation in Recommendation List --> Remediate list of vulnerabilities",
      "Tags": [
        "SDL",
        "Automated",
        "Baseline",
        "Weekly",
        "ExcludedControl"
      ],
      "Enabled": true,
      "CustomTags": []
    },
    {
      "ControlID": "Azure_SQLDatabase_DP_Use_Secure_TLS_Version_Trial",
      "Description": "[Trial] Use approved version of TLS for SQL Server",
      "Id": "SQLDatabase410",
      "ControlSeverity": "High",
      "Automated": "Yes",
      "MethodName": "CheckSqlServerTLSVersion",
      "DisplayName": "[Trial] Use approved version of TLS for SQL Server",
      "Category": "Encrypt data in transit",
      "ControlRequirements": "Data must be encrypted in transit and at rest",
      "Rationale": "TLS provides privacy and data integrity between client and server. Using approved TLS version significantly reduces risks from security design issues and security bugs that may be present in older versions.",
      "Recommendation": "To Configure 'Minimum TLS Version' setting for SQL Server, go to Azure Portal --> Your SQL Server --> Networking --> Connectivity --> Set the Minimum TLS Version to latest version.",
      "Tags": [
        "SDL",
        "TCP",
        "DP",
        "Automated",
        "Baseline",
        "Weekly"
      ],
      "Enabled": true,
      "CustomTags": [ "Daily", "Trial", "SN:SQL_TLS" ],
      "ControlSettings": {
        "MinReqTLSVersion": "1.2"
      }
    }
  ]
}