-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(azure): check for minimal TLS version for Azure SQL server #5745
base: master
Are you sure you want to change the base?
feat(azure): check for minimal TLS version for Azure SQL server #5745
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5745 +/- ##
==========================================
+ Coverage 89.83% 89.86% +0.02%
==========================================
Files 1128 1129 +1
Lines 35154 35173 +19
==========================================
+ Hits 31582 31609 +27
+ Misses 3572 3564 -8 ☔ View full report in Codecov by Sentry. |
@@ -0,0 +1,30 @@ | |||
{ | |||
"Provider": "azure", | |||
"CheckID": "sqlserver_minimal_tls_version", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"CheckID": "sqlserver_minimal_tls_version", | |
"CheckID": "sqlserver_recommended_minimal_tls_version", |
from prowler.providers.azure.services.sqlserver.sqlserver_client import sqlserver_client | ||
|
||
|
||
class sqlserver_minimal_tls_version(Check): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class sqlserver_minimal_tls_version(Check): | |
class sqlserver_recommended_minimal_tls_version(Check): |
report.status = "FAIL" | ||
report.location = sql_server.location | ||
report.status_extended = f"SQL Server {sql_server.name} from subscription {subscription} has no or an deprecated minimal TLS version set." | ||
if sql_server.minimal_tls_version in ("1.2", "1.3"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you make this check configurable? So if in the future version 1.2 is not recommended, you only have to change the configuration file and not the logic of the check. Here are examples of other checks that are configurable: https://docs.prowler.com/projects/prowler-open-source/en/latest/tutorials/configuration_file/#azure
report.resource_id = sql_server.id | ||
report.status = "FAIL" | ||
report.location = sql_server.location | ||
report.status_extended = f"SQL Server {sql_server.name} from subscription {subscription} has no or an deprecated minimal TLS version set." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
report.status_extended = f"SQL Server {sql_server.name} from subscription {subscription} has no or an deprecated minimal TLS version set." | |
report.status_extended = f"SQL Server {sql_server.name} from subscription {subscription} is using TLS version {sql_server.minimal_tls_version} as minimal accepted which is not recommended. Please use one of the recommended versions: {<Here add the minimal recommended or the versions accepted>}" |
|
||
|
||
class sqlserver_minimal_tls_version(Check): | ||
def execute(self) -> Check_Report_Azure: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def execute(self) -> Check_Report_Azure: | |
def execute(self) -> List[Check_Report_Azure]: |
@@ -0,0 +1,22 @@ | |||
from prowler.lib.check.models import Check, Check_Report_Azure | |||
from prowler.providers.azure.services.sqlserver.sqlserver_client import sqlserver_client | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from typing import List |
Context
Verify a secure configuration of SQL servers in Azure
Description
New check for minimum required TLS version of Azure SQL servers.
Checklist
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.