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

Ri refreshv3 #429

Merged
merged 12 commits into from
Mar 1, 2021
Merged

Ri refreshv3 #429

merged 12 commits into from
Mar 1, 2021

Conversation

krnese
Copy link
Contributor

@krnese krnese commented Feb 11, 2021

This PR fixes

  • Update of RIs
  • Added updated policy for NSG Flow Log to Log Analytics (v2)

uday31in
uday31in previously approved these changes Feb 11, 2021
@krnese krnese added do not merge enhancement New feature or request policy labels Feb 11, 2021
@matt-FFFFFF
Copy link
Member

matt-FFFFFF commented Feb 18, 2021

@krnese Please could you add an additional parameter and some additional validation to the deploy-nsg-flowlogs policy ?

Here is a new parameters object, below is the new policyRule...

Improvements

  • targetRegion param allows us to assign this policy multiple times. Once for each region (as the storage account must be in the same region as the NSG).
  • Additional allowedValues checking on params
"Properties": {
  "Description": "Deploys NSG flow logs and traffic analytics to a storageaccountid with a specified retention period. This must be assigned once for each in-scope region because the storage account and NSG must be in the same region. Must also be assigned at a MG Scope that covers the LA workspace and NetworkwatcherRG.",
  "DisplayName": "Deploys NSG flow logs and traffic analytics for a region",
  "Mode": "All",
  "Parameters": {
    "retention": {
      "type": "Integer",
      "metadata": {
        "displayName": "Retention (days)"
      },
      "defaultValue": 5
    },
    "storageAccountResourceId": {
      "type": "String",
      "metadata": {
        "displayName": "Storage Account Resource Id",
        "strongType": "Microsoft.Storage/storageAccounts"
      }
    },
    "trafficAnalyticsInterval": {
      "type": "Integer",
      "metadata": {
        "displayName": "Traffic Analytics processing interval mins (10/60)"
      },
      "defaultValue": 60,
      "allowedValues": [
        10,
        60
      ]
    },
    "flowAnalyticsEnabled": {
      "type": "Boolean",
      "metadata": {
        "displayName": "Enable Traffic Analytics"
      },
      "defaultValue": false,
      "allowedValues": [
        true,
        false
      ]
    },
    "logAnalytics": {
      "type": "String",
      "metadata": {
        "strongType": "omsWorkspace",
        "displayName": "Resource ID of Log Analytics workspace",
        "description": "Select Log Analytics workspace from dropdown list. If this workspace is outside of the scope of the assignment you must manually grant 'Log Analytics Contributor' permissions (or similar) to the policy assignment's principal ID."
      },
      "defaultValue": ""
    },
    "effect": {
      "type": "String",
      "metadata": {
        "displayName": "Effect",
        "description": "Enable or disable the execution of the policy"
      },
      "allowedValues": [
        "DeployIfNotExists",
        "Disabled"
      ],
      "defaultValue": "DeployIfNotExists"
    }
  }
"PolicyRule": {
  "if": {
    "allOf": [
      {
        "field": "type",
        "equals": "Microsoft.Network/networkSecurityGroups"
      },
      {
        "field": "location",
        "equals": "[parameters('targetRegion')]"
      }
    ]
  },

@krnese krnese linked an issue Feb 19, 2021 that may be closed by this pull request
@krnese krnese linked an issue Feb 19, 2021 that may be closed by this pull request
@krnese krnese merged commit 665da8f into Azure:main Mar 1, 2021
@krnese krnese linked an issue Mar 2, 2021 that may be closed by this pull request
@paulgrimley paulgrimley mentioned this pull request Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'Deploy the Log Analytics' Policy Improvements Remediation Task fails due to invalid permissions
3 participants