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

feat(arm): AzureDefenderOStorage #6269

Merged
merged 24 commits into from May 22, 2024

Conversation

shoshiGit
Copy link
Contributor

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Description

We converted the check AzureDefenderOnstorage from TERRAFORM language to the ARM language so that it also works on resources that are defined in the ARM language/

Fixes # (issue)

New/Edited policies (Delete if not relevant)

Description

Ensure that Azure Defender is set to On for Storage.

Fix

To address the issue, ensure that the Azure Defender setting is configured to On for the relevant storage resources. This can typically be done through the Azure Portal by navigating to the Security Center settings for the storage account and enabling Azure Defender.

Checklist:

  • [ x] My code follows the style guidelines of this project
  • [ x] I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • [ x] I have added tests that prove my feature, policy, or fix is effective and works
  • [ x] New and existing tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@shoshiGit shoshiGit changed the title feat(arm) Azuredefenderonstorage feat(arm): AzureDefenderonstorage May 7, 2024
@shoshiGit shoshiGit changed the title feat(arm): AzureDefenderonstorage feat(arm): AzureDefenderOStorage May 7, 2024
resourceType = properties.get("resourceType")
return (
CheckResult.PASSED
if resourceType != "StorageAccounts" or tier == "Standard"
Copy link
Contributor

Choose a reason for hiding this comment

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

the resource type here is not StorageAccounts but Microsoft.Security/pricings

resourceType = properties.get("resourceType", "")
return (
CheckResult.PASSED
if resourceType != "Microsoft.Security/pricings" or tier == "Standard"
Copy link
Contributor

Choose a reason for hiding this comment

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

resourceType = properties.get("resourceType", "")
return (
CheckResult.PASSED
if resourceType != "Microsoft.Security/pricings" or pricingTier == "Standard"
Copy link
Contributor

Choose a reason for hiding this comment

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

You can remove the if resourceType != "Microsoft.Security/pricings" - in ARM it will always be this type.
(Just for terraform it can be other types as well)

@ChanochShayner ChanochShayner merged commit 348a39b into bridgecrewio:main May 22, 2024
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants