Turbot Guardrails Hub 
Hub
  • Mods
  • Policy Packs
  • Docs
  • Home
ModsPolicy PacksDocsHome
Policy Packs
Azure CIS v2.0.0 - Section 5 - Logging and Monitoring
  • Azure > Monitor > Stack
  • Azure > Monitor > Stack > Source
  • Azure > Monitor > Stack > Terraform Version
  • Azure > Network Watcher > Flow Log > Approved
  • Azure > Network Watcher > Flow Log > Approved > Custom
  • Azure > Resource Group > Stack
  • Azure > Resource Group > Stack > Source
  • Azure > Resource Group > Stack > Terraform Version
  • Azure > Storage > Container > Public Access Level
Get Involved
Discuss on Slack

Policy Setting: Azure > Network Watcher > Flow Log > Approved > Custom

Policies

This policy setting is dependent on the following policy types:

  • Azure > Network Watcher > Flow Log > Approved > Custom

Source

resource "turbot_policy_setting" "azure_networkwatcher_flowlog_approved_custom" {
resource = turbot_policy_pack.main.id
type = "tmod:@turbot/azure-networkwatcher#/policy/types/flowLogApprovedCustom"
note = "Azure CIS v2.0.0 - Control: 5.1.6"
template_input = <<-EOT
{
flowLog {
logAnalyticsEnabled: get(path: "flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled")
targetResourceId: get(path: "targetResourceId")
}
}
EOT
template = <<-EOT
{%- if $.flowLog.logAnalyticsEnabled and "networkSecurityGroups" in $.flowLog.targetResourceId -%}
{%- set data = {
"title": "Flow Logging to Log Analytics",
"result": "Approved",
"message": "Flow logs are captured and sent to Log Analytics"
} -%}
{%- elif not $.flowLog.logAnalyticsEnabled or $.flowLog.targetResourceId == "" or $.flowLog.targetResourceId == null -%}
{%- set data = {
"title": "Flow Logging to Log Analytics",
"result": "Not approved",
"message": "Flow logs are not captured and sent to Log Analytics"
} -%}
{%- else -%}
{%- set data = {
"title": "Flow Logging to Log Analytics",
"result": "Skip",
"message": "No data for flow log yet"
} -%}
{%- endif -%}
{{ data | json }}
EOT
}
Guardrails
Guardrails Hub
  • Hub
  • Docs
  • Blog
  • Changelog
Products
  • GuardrailsGuardrails
  • PipesPipes
  • SteampipeSteampipe
  • PowerpipePowerpipe
  • FlowpipeFlowpipe
  • TailpipeTailpipe
Turbot
  • Home
  • About us
  • We're hiring!
  • Contact us
Community

Our community of practitioners love to discuss cloud governance & security.

Slack logoJoin us on Slack →

System StatusLegalSecurity
Terms of UseSecurityPrivacy