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): AzureDefenderOnSqlServersVMS - checks resource is a SQL with tier "Standard". #6321

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

unu87
Copy link
Contributor

@unu87 unu87 commented May 19, 2024

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

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

New/Edited policies (Delete if not relevant)

Description

The function scan_resource_conf checks if a specific resource is a SQL Server with tier "Standard". If so, it returns a failure result; otherwise, it returns a success result.

Fix

The function checks if a resource is a SQL Server Virtual Machine with tier "Standard" and returns a pass or fail result accordingly.

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

def __init__(self):
name = "Ensure that Azure Defender is set to On for SQL servers on machines"
id = "CKV_AZURE_79"
supported_resources = ("Microsoft.Cache/Redis",)
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably should be Microsoft.Security/pricings type and not Microsoft.Cache/Redis


def scan_resource_conf(self, conf: Dict[str, Any]) -> CheckResult:
properties = conf.get("properties", {})
resourceType = properties.get("resourceType")
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think there is resourceType in this resource, we can remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so how do we det to the "resourceType": "SqlServerVirtualMachines" to test it?

Copy link
Contributor

Choose a reason for hiding this comment

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

we dont need it for ARM

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

2 participants