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): add CKV_AZURE_173 to ensure that API management uses at least TLS 1.2 #6322

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

Conversation

goldyBH
Copy link

@goldyBH goldyBH commented May 19, 2024

APIManagementMinTLS12
Be aware that we use the title to create changelog automatically and therefore only allow specific prefixes
- break: to indicate a breaking change, this supersedes any of the types
- feat: to indicate new features or checks
- fix: to indicate a bugfix or handling of edge cases of existing checks
- docs: to indicate an update to our documentation
- chore: to indicate adjustments to workflow files or dependency updates
- platform: to indicate a change needed for the platform
Additionally a scope is needs to be added to the prefix, which indicates the targeted framework, in doubt choose 'general'.

Description

ensure that API management uses at least TLS 1.2

Checklist:

  • My code follows the style guidelines of this project
  • 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
  • I have added tests that prove my feature, policy, or fix is effective and works
  • New and existing tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules


def scan_resource_conf(self, conf: dict[str, Any]) -> CheckResult:
properties = conf.get('properties', {})
if 'security' in properties:
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no field security in Microsoft.ApiManagement/service type

properties = conf.get('properties', {})
if 'enableClientCertificate' in properties:
enableClientCertificate = properties['enableClientCertificate']
if 'enableFrontendTls10' in enableClientCertificate:
Copy link
Contributor

Choose a reason for hiding this comment

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

enableClientCertificate is a bool value.

@goldyBH goldyBH changed the title feat(arm):add CKV_AZURE_173 to ensure that API management uses at least TLS 1.2 feat(arm): add CKV_AZURE_173 to ensure that API management uses at least TLS 1.2 May 28, 2024
@goldyBH
Copy link
Author

goldyBH commented May 28, 2024

What do I need to do to fix the security?

properties = conf.get('properties', {})
if 'identity' in properties:
identity = properties['identity']
if 'enableFrontendTls10' in identity:
Copy link
Contributor

Choose a reason for hiding this comment

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

this is the identity structure -
"identity": {
"type": "string",
"userAssignedIdentities": {
"{customized property}": {
"clientId": "string",
"principalId": "string"
}
}
}

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