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

Built-in Policy Release d73dc9d4 #1346

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"properties": {
"displayName": "[Preview]: Mutate K8s Container to drop all capabilities",
"policyType": "BuiltIn",
"mode": "Microsoft.Kubernetes.Data",
"description": "Mutates securityContext.capabilities.drop to add in \"ALL\". This drops all capabilities for k8s linux containers",
"metadata": {
"version": "1.0.0-preview",
"category": "Kubernetes",
"preview": true
},
"version": "1.0.0-preview",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "'Mutate' modifies a non-compliant resource to be compliant when creating or updating. 'Disabled' turns off the policy.",
"portalReview": true
},
"allowedValues": [
"Mutate",
"Disabled"
],
"defaultValue": "Mutate"
},
"excludedNamespaces": {
"type": "Array",
"metadata": {
"displayName": "Namespace exclusions",
"description": "List of Kubernetes namespaces to exclude from policy evaluation."
},
"defaultValue": [
"kube-system",
"gatekeeper-system",
"azure-arc"
]
}
},
"policyRule": {
"if": {
"field": "type",
"equals": "Microsoft.ContainerService/managedClusters"
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"mutationInfo": {
"sourceType": "PublicURL",
"url": "https://store.policy.azure.us/kubernetes/mutate-container-allowed-capabilities-containers/v1/mutation.yaml"
},
"excludedNamespaces": "[parameters('excludedNamespaces')]"
}
}
},
"versions": [
"1.0.0-PREVIEW"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/c873b3ba-c605-42e4-a64b-a142a93826fc",
"name": "c873b3ba-c605-42e4-a64b-a142a93826fc"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"properties": {
"displayName": "[Preview]: Mutate K8s Init Container to drop all capabilities",
"policyType": "BuiltIn",
"mode": "Microsoft.Kubernetes.Data",
"description": "Mutates securityContext.capabilities.drop to add in \"ALL\". This drops all capabilities for k8s linux init containers",
"metadata": {
"version": "1.0.0-preview",
"category": "Kubernetes",
"preview": true
},
"version": "1.0.0-preview",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "'Mutate' modifies a non-compliant resource to be compliant when creating or updating. 'Disabled' turns off the policy.",
"portalReview": true
},
"allowedValues": [
"Mutate",
"Disabled"
],
"defaultValue": "Mutate"
},
"excludedNamespaces": {
"type": "Array",
"metadata": {
"displayName": "Namespace exclusions",
"description": "List of Kubernetes namespaces to exclude from policy evaluation."
},
"defaultValue": [
"kube-system",
"gatekeeper-system",
"azure-arc"
]
}
},
"policyRule": {
"if": {
"field": "type",
"equals": "Microsoft.ContainerService/managedClusters"
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"mutationInfo": {
"sourceType": "PublicURL",
"url": "https://store.policy.azure.us/kubernetes/mutate-container-allowed-capabilities-initcontainers/v1/mutation.yaml"
},
"excludedNamespaces": "[parameters('excludedNamespaces')]"
}
}
},
"versions": [
"1.0.0-PREVIEW"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/c812272d-7488-495f-a505-047d34b83f58",
"name": "c812272d-7488-495f-a505-047d34b83f58"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"properties": {
"displayName": "[Preview]: Mutate K8s Container to drop all capabilities",
"policyType": "BuiltIn",
"mode": "Microsoft.Kubernetes.Data",
"description": "Mutates securityContext.capabilities.drop to add in \"ALL\". This drops all capabilities for k8s linux containers",
"metadata": {
"version": "1.0.0-preview",
"category": "Kubernetes",
"preview": true
},
"version": "1.0.0-preview",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "'Mutate' modifies a non-compliant resource to be compliant when creating or updating. 'Disabled' turns off the policy.",
"portalReview": true
},
"allowedValues": [
"Mutate",
"Disabled"
],
"defaultValue": "Mutate"
},
"excludedNamespaces": {
"type": "Array",
"metadata": {
"displayName": "Namespace exclusions",
"description": "List of Kubernetes namespaces to exclude from policy evaluation."
},
"defaultValue": [
"kube-system",
"gatekeeper-system",
"azure-arc"
]
}
},
"policyRule": {
"if": {
"field": "type",
"equals": "Microsoft.ContainerService/managedClusters"
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"mutationInfo": {
"sourceType": "PublicURL",
"url": "https://store.policy.core.windows.net/kubernetes/mutate-container-allowed-capabilities-containers/v1/mutation.yaml"
},
"excludedNamespaces": "[parameters('excludedNamespaces')]"
}
}
},
"versions": [
"1.0.0-PREVIEW"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/c873b3ba-c605-42e4-a64b-a142a93826fc",
"name": "c873b3ba-c605-42e4-a64b-a142a93826fc"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"properties": {
"displayName": "[Preview]: Mutate K8s Init Container to drop all capabilities",
"policyType": "BuiltIn",
"mode": "Microsoft.Kubernetes.Data",
"description": "Mutates securityContext.capabilities.drop to add in \"ALL\". This drops all capabilities for k8s linux init containers",
"metadata": {
"version": "1.0.0-preview",
"category": "Kubernetes",
"preview": true
},
"version": "1.0.0-preview",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "'Mutate' modifies a non-compliant resource to be compliant when creating or updating. 'Disabled' turns off the policy.",
"portalReview": true
},
"allowedValues": [
"Mutate",
"Disabled"
],
"defaultValue": "Mutate"
},
"excludedNamespaces": {
"type": "Array",
"metadata": {
"displayName": "Namespace exclusions",
"description": "List of Kubernetes namespaces to exclude from policy evaluation."
},
"defaultValue": [
"kube-system",
"gatekeeper-system",
"azure-arc"
]
}
},
"policyRule": {
"if": {
"field": "type",
"equals": "Microsoft.ContainerService/managedClusters"
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"mutationInfo": {
"sourceType": "PublicURL",
"url": "https://store.policy.core.windows.net/kubernetes/mutate-container-allowed-capabilities-initcontainers/v1/mutation.yaml"
},
"excludedNamespaces": "[parameters('excludedNamespaces')]"
}
}
},
"versions": [
"1.0.0-PREVIEW"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/c812272d-7488-495f-a505-047d34b83f58",
"name": "c812272d-7488-495f-a505-047d34b83f58"
}