Skip to content
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

Azure rule 9.4 property change #330

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion bundle/compliance/cis_azure/rules/cis_9_4/rule.rego
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ finding = result {
}

is_client_cert_enabled {
data_adapter.properties.clientCertEnabled == true
# Benchmark and Azure implementation in remediation checks previous implemented value
# Reading the description and rule metadata, we've decided to check the value of the property clientCertMode
data_adapter.properties.clientCertMode == "Required"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also check the data_adapter.properties.clientCertEnabled value for completeness/sanity?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is part of the schema of the ARG.
If the value doesn't exist it will be evaluated as false, do we want to have no evaluation in that case?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In which case should it not exist?

} else = false
4 changes: 2 additions & 2 deletions bundle/compliance/cis_azure/rules/cis_9_4/test.rego
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ test_violation {
)
eval_fail with input as test_data.generate_azure_asset(
"azure-web-site",
{"clientCertEnabled": false},
{"clientCertMode": "NotRequired"},
)
}

test_pass {
eval_pass with input as test_data.generate_azure_asset(
"azure-web-site",
{"clientCertEnabled": true},
{"clientCertMode": "Required"},
)
}

Expand Down