Giter VIP home page Giter VIP logo

azurepolicy's People

Contributors

abaddon82 avatar ikiris04 avatar manuinnz avatar spaelling avatar taoyangmvp avatar tyconsulting avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azurepolicy's Issues

azurepolicy.bastion-la.json contains diagnostics for Microsoft.Web/sites

Seems like copy-paste for web apps without changing config for bastion.
Below are correct fields for policy definition:

        "policyRule": {
          "if": {
            "field": "type",
            "equals": "Microsoft.Network/bastionHosts"
          },

Resource type:

"resources": [
                      {
                        "type": "Microsoft.Network/bastionHosts/providers/diagnosticSettings",

Log and metrics config:

                          "metrics": [],
                          "logs": [
                            {
                              "category": "BastionAuditLogs",
                              "enabled": true
                            }

Wrong parameters for deployment section in azurepolicy.vnet-eh.json

Hi, the above policy has a mistake starting with the parameters on line 88. you copied the parameters from the Log analytics version (it appears). the correct block is below. I hope this helps.
"parameters": {
"diagnosticsSettingNameToUse": {
"type": "string"
},
"resourceName": {
"type": "string"
},
"eventHubName": {
"type": "string"
},
"eventHubAuthorizationRuleId": {
"type": "string"
},

"location": {
"type": "string"
}
},

Metrics category in diagnostic settings for API Management services need to be updated

https://github.com/tyconsulting/azurepolicy/blob/master/policy-definitions/resource-diagnostics-settings/log-analytics/azurepolicy.apiMgmt-la.json

During testing, "create or update resource diagnostic setting" operation failed. The supported Metric categories are "AllMetrics" and should be updated accordingly.

  • Error code = BadRequest
  • Message = Metric category 'Gateway Requests' is not supported, supported categories are: 'AllMetrics'

Diagnostic settings policy on Azure SQL DBs --> non-compliance status if these log categories not added

The azure policy definition is azurepolicy/policy-definitions/resource-diagnostics-settings/log-analytics/azurepolicy.sqlDBs-la.json .These two log categories must be added to the policy else Azure policy compliance evaluation will mark it as non-compliant because the two missing categories are set to "false".

  • DevOpsOperationsAudit
  • SQLSecurityAuditEvents

Azure Portal shows 9 log categories, but the API call is sending 11 log categories.

Existence condition when metrics/logs are disabled

Great policies, just one note regarding existence condition. Due to lack of metrics in diagnostics logs we dont export metrics at all and disable them. However the existence condition checks if metrics are True, even if parameters is set to false. So it will just never be compliant because metrics is never enabled.

Existence condition should check same as parameter input

CDN Diagnostics Logs

Applying the CDN policy ist not working because of the following error:
Error code
RemediatedResourceNotFound

Reason
The resource being remediated '/subscriptions//resourcegroups//providers/microsoft.cdn/profiles//endpoints/' could not be retrieved.

Diagnostic Setting doesn't work for Virtual Machines

I don't believe this works with Virtual Machines anymore. The Virtual Machine blade for Diagnostics doesn't even take a log analytics workspace as input. Is there a different blade menu for Virtual Machines this was intended for that I'm not seeing? See screen shot for reference.

VMDiagnostics

What's the proper syntax for policy when using deploy.ps1

Hi, I am trying to use deploy-policyDef.ps1 using
.\deploy.ps1 -managementGroupName "$mgtGroup" -definitionFile "$file"

I do receive following error:

New-AzPolicyDefinition : Cannot validate argument on parameter 'Name'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
At azurepolicydeploy-policyDef.ps1:70 char:44
+     $deployResult = New-AzPolicyDefinition @deployParams
    + CategoryInfo          : InvalidData: (:) [New-AzPolicyDefinition], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzurePolicyDefinitionCmdlet

My policy definition looks like this:

{
	"properties": {
		"name": "xxx",
		"displayName": "xxx",
		"mode": "Indexed",
		"description": "xxx",
		"metadata": {
			"category": "General"
		},
		"parameters": {
			"regions": {
				"type": "Array",
				"metadata": {
					"description": "The list of locations that can be specified when deploying resources.",
					"strongType": "location",
					"displayName": "Allowed locations"
				},
				"defaultValue": ["westeurope", "northeurope"]
			},
			"effect": {
				"type": "String",
				"metadata": {
					"displayName": "Effect",
					"description": "Enable or disable the execution of the policy"
				},
				"allowedValues": [
					"Audit",
					"Deny"
				],
				"defaultValue": "Audit"
			}
		},
		"policyRule": {
			"if": {
				"allOf": [
					{
						"field": "location",
						"notIn": "[parameters('regions')]"
					},
					{
						"field": "location",
						"notEquals": "global"
					},
					{
						"field": "type",
						"notEquals": "Microsoft.AzureActiveDirectory/b2cDirectories"
					}
				]
			},
			"then": {
				"effect": "[parameters('effect')]"
			}
		}
	}
} 

Open Source License?

Hi Tao,

Great work putting together this great resource!

I'd really love to use some of these policy definitions, but I'm not sure what license they're under.

Could you release these as a Apache 2, MIT or BSD?

Thanks!

Carl

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.