image/svg+xml Checkov home
  • Docs
    • Quick start
    • Overview
    • Integrations
  • Download
  • Docs
    • Quick start
    • Overview
    • Integrations

Checkov Documentation

  • 1.Welcome
    • What is Checkov?
    • Terms and Concepts
    • Quick Start
    • Feature Descriptions
    • Migration
  • 2.Basics
    • Installing Checkov
    • CLI Command Reference
    • Suppressing and Skipping Policies
    • Hard and soft fail
    • Scanning Credentials and Secrets
    • Reviewing Scan Results
    • Visualizing Checkov Output
    • Handling Variables
  • 3.Custom Policies
    • Custom Policies Overview
    • Python Custom Policies
    • YAML Custom Policies
    • Custom YAML Policies Examples
    • Sharing Custom Policies
  • 4.Integrations
    • Jenkins
    • Bitbucket Cloud Pipelines
    • GitHub Actions
    • GitLab CI
    • Kubernetes
    • Pre-Commit Hooks
    • Docker
  • 5.Policy Index
    • all resource scans
    • ansible resource scans
    • argo_workflows resource scans
    • arm resource scans
    • azure_pipelines resource scans
    • bicep resource scans
    • bitbucket_configuration resource scans
    • bitbucket_pipelines resource scans
    • circleci_pipelines resource scans
    • cloudformation resource scans
    • dockerfile resource scans
    • github_actions resource scans
    • github_configuration resource scans
    • gitlab_ci resource scans
    • gitlab_configuration resource scans
    • kubernetes resource scans
    • openapi resource scans
    • secrets resource scans
    • serverless resource scans
    • terraform resource scans
  • 6.Contribution
    • Checkov Runner Contribution Guide
    • Implementing CI Metadata extractor
    • Implementing ImageReferencer
    • Contribution Overview
    • Contribute Python-Based Policies
    • Contribute YAML-based Policies
    • Contribute New Terraform Provider
    • Contribute New Argo Workflows configuration policy
    • Contribute New Azure Pipelines configuration policy
    • Contribute New Bitbucket configuration policy
    • Contribute New GitHub configuration policy
    • Contribute New Gitlab configuration policy
  • 7.Scan Examples
    • Terraform Plan Scanning
    • Terraform Scanning
    • Helm
    • Kustomize
    • AWS SAM configuration scanning
    • Ansible configuration scanning
    • Argo Workflows configuration scanning
    • Azure ARM templates configuration scanning
    • Azure Pipelines configuration scanning
    • Azure Bicep configuration scanning - {:.toctree-l3} Example misconfigured Bicep file - {:.toctree-l3} Running in CLI - {:.toctree-l3} Example output
    • Bitbucket configuration scanning
    • AWS CDK configuration scanning
    • Cloudformation configuration scanning
    • Dockerfile configuration scanning
    • GitHub configuration scanning
    • Gitlab configuration scanning
    • Kubernetes configuration scanning
    • OpenAPI configuration scanning
    • SCA scanning
    • Serverless framework configuration scanning
  • 8.Outputs
    • CSV
    • CycloneDX BOM
    • GitLab SAST
    • JUnit XML
    • SARIF
  • Docs
  • 7.scan examples
  • Azure Bicep configuration scanning
Edit on GitHub

Azure Bicep configuration scanning

Checkov supports the evaluation of policies on your Bicep files. When using checkov to scan a directory that contains a Bicep file it will validate if it is compliant with Azure best practices such as having logging and auditing enabled, Ensure that ‘Public access level’ is set to Private for blob containers, Ensure no SQL Databases allow ingress from 0.0.0.0/0 (ANY IP), and more.

Full list of ARM templates policies checks can be found here.

Example misconfigured Bicep file

@description('The location in which all resources should be deployed.')
param location string = resourceGroup().location

@description('The name of the app to create.')
param appName string = uniqueString(resourceGroup().id)

var appServicePlanName = '${appName}${uniqueString(subscription().subscriptionId)}'
var appServicePlanSku = 'S1'

resource appServicePlan 'Microsoft.Web/serverfarms@2020-06-01' = {
  name: appServicePlanName
  location: location
  sku: {
    name: appServicePlanSku
  }
  kind: 'app'
}

resource webApp 'Microsoft.Web/sites@2020-06-01' = {
  name: appName
  location: location
  kind: 'app'
  properties: {
    serverFarmId: appServicePlan.id
  }
}

Running in CLI

checkov -d . --framework bicep

Example output

       _               _              
   ___| |__   ___  ___| | _______   __
  / __| '_ \ / _ \/ __| |/ / _ \ \ / /
 | (__| | | |  __/ (__|   < (_) \ V / 
  \___|_| |_|\___|\___|_|\_\___/ \_/  
                                      
By Prisma Cloud | version: x.x.x 

bicep scan results:

Passed checks: 0, Failed checks: 5, Skipped checks: 0

Check: CKV_AZURE_15: "Ensure web app is using the latest version of TLS encryption"
        FAILED for resource: Microsoft.Web/sites.webApp
        File: anton/bicep/playground/example.bicep:19-26
        Guide: https://docs.prismacloud.io/en/enterprise-edition/policy-reference/azure-policies/azure-networking-policies/bc-azr-networking-6

                19 | resource webApp 'Microsoft.Web/sites@2020-06-01' = {
                20 |   name: appName
                21 |   location: location
                22 |   kind: 'app'
                23 |   properties: {
                24 |     serverFarmId: appServicePlan.id
                25 |   }
                26 | }

Check: CKV_AZURE_17: "Ensure the web app has 'Client Certificates (Incoming client certificates)' set"
        FAILED for resource: Microsoft.Web/sites.webApp
        File: anton/bicep/playground/example.bicep:19-26
        Guide: https://docs.prismacloud.io/en/enterprise-edition/policy-reference/azure-policies/azure-networking-policies/bc-azr-networking-7

                19 | resource webApp 'Microsoft.Web/sites@2020-06-01' = {
                20 |   name: appName
                21 |   location: location
                22 |   kind: 'app'
                23 |   properties: {
                24 |     serverFarmId: appServicePlan.id
                25 |   }
                26 | }

Check: CKV_AZURE_14: "Ensure web app redirects all HTTP traffic to HTTPS in Azure App Service"
        FAILED for resource: Microsoft.Web/sites.webApp
        File: anton/bicep/playground/example.bicep:19-26
        Guide: https://docs.prismacloud.io/en/enterprise-edition/policy-reference/azure-policies/azure-networking-policies/bc-azr-networking-5

                19 | resource webApp 'Microsoft.Web/sites@2020-06-01' = {
                20 |   name: appName
                21 |   location: location
                22 |   kind: 'app'
                23 |   properties: {
                24 |     serverFarmId: appServicePlan.id
                25 |   }
                26 | }

Check: CKV_AZURE_16: "Ensure that Register with Azure Active Directory is enabled on App Service"
        FAILED for resource: Microsoft.Web/sites.webApp
        File: anton/bicep/playground/example.bicep:19-26
        Guide: https://docs.prismacloud.io/en/enterprise-edition/policy-reference/azure-policies/azure-iam-policies/bc-azr-iam-1

                19 | resource webApp 'Microsoft.Web/sites@2020-06-01' = {
                20 |   name: appName
                21 |   location: location
                22 |   kind: 'app'
                23 |   properties: {
                24 |     serverFarmId: appServicePlan.id
                25 |   }
                26 | }

Check: CKV_AZURE_18: "Ensure that 'HTTP Version' is the latest if used to run the web app"
        FAILED for resource: Microsoft.Web/sites.webApp
        File: anton/bicep/playground/example.bicep:19-26
        Guide: https://docs.prismacloud.io/en/enterprise-edition/policy-reference/azure-policies/azure-networking-policies/bc-azr-networking-8

                19 | resource webApp 'Microsoft.Web/sites@2020-06-01' = {
                20 |   name: appName
                21 |   location: location
                22 |   kind: 'app'
                23 |   properties: {
                24 |     serverFarmId: appServicePlan.id
                25 |   }
                26 | }

Powered By

  • Slack Community
  • Prisma Cloud
  • Terms of use
  • GitHub
  • Docs
  • Privacy policy