PolicyDefinition is the Schema for the PolicyDefinitions API. Manages a policy rule definition. Policy definitions do not take effect until they are assigned to a scope using a Policy Assignment.
Type
CRD
Group
authorization.azure.upbound.io
Version
v1beta1
apiVersion: authorization.azure.upbound.io/v1beta1
kind: PolicyDefinition
PolicyDefinitionSpec defines the desired state of PolicyDefinition
No description provided.
ProviderConfigReference specifies how the provider that will be used to create, observe, update, and delete this managed resource should be configured.
Policies for referencing.
ProviderReference specifies the provider that will be used to create, observe, update, and delete this managed resource. Deprecated: Please use ProviderConfigReference, i.e. providerConfigRef
Policies for referencing.
PublishConnectionDetailsTo specifies the connection secret config which contains a name, metadata and a reference to secret store config to which any connection details for this managed resource should be written. Connection details frequently include the endpoint, username, and password required to connect to the managed resource.
WriteConnectionSecretToReference specifies the namespace and name of a Secret to which any connection details for this managed resource should be written. Connection details frequently include the endpoint, username, and password required to connect to the managed resource. This field is planned to be replaced in a future release in favor of PublishConnectionDetailsTo. Currently, both could be set independently and connection details would be published to both without affecting each other.
PolicyDefinitionStatus defines the observed state of PolicyDefinition.
No description provided.
A list of role definition id extracted from policy_rule required for remediation.
Conditions of the resource.
example
apiVersion: authorization.azure.upbound.io/v1beta1
kind: PolicyDefinition
metadata:
labels:
testing.upbound.io/example-name: example-auth
name: example
spec:
forProvider:
displayName: my-policy-definition
mode: All
policyRule: |
{
"if": {
"not": {
"field": "location",
"equals": "westeurope"
}
},
"then": {
"effect": "Deny"
}
}
policyType: Custom
policydefinition
apiVersion: authorization.azure.upbound.io/v1beta1
kind: PolicyDefinition
metadata:
annotations:
meta.upbound.io/example-id: policyinsights/v1beta1/resourcepolicyremediation
labels:
testing.upbound.io/example-name: examplepolicy
name: policydefinition
spec:
forProvider:
displayName: policydefinitionqw
mode: All
policyRule: |
{
"if": {
"not": {
"field": "location",
"equals": "westeurope"
}
},
"then": {
"effect": "Deny"
}
}
policyType: Custom
example
apiVersion: authorization.azure.upbound.io/v1beta1
kind: PolicyDefinition
metadata:
annotations:
meta.upbound.io/example-id: authorization/v1beta1/subscriptionpolicyassignment
labels:
testing.upbound.io/example-name: example
name: example
spec:
forProvider:
displayName: somename
mode: All
policyRule: |
{
"if": {
"not": {
"field": "location",
"equals": "westeurope"
}
},
"then": {
"effect": "Deny"
}
}
policyType: Custom
policy-example
apiVersion: authorization.azure.upbound.io/v1beta1
kind: PolicyDefinition
metadata:
annotations:
meta.upbound.io/example-id: policyinsights/v1beta1/subscriptionpolicyremediation
labels:
testing.upbound.io/example-name: example
name: policy-example
spec:
forProvider:
displayName: my-policy-definition
mode: All
policyRule: |
{
"if": {
"not": {
"field": "location",
"equals": "westeurope"
}
},
"then": {
"effect": "Deny"
}
}
policyType: Custom
examplepolicy
apiVersion: authorization.azure.upbound.io/v1beta1
kind: PolicyDefinition
metadata:
annotations:
meta.upbound.io/example-id: authorization/v1beta1/resourcepolicyexemption
upjet.upbound.io/manual-intervention: ResourcePolicyAssignment and
ResourcePolicyExemption depends on existing resource id (Virutal Network
in this example)
labels:
testing.upbound.io/example-name: examplepolicy
name: examplepolicy
spec:
forProvider:
displayName: somename
mode: All
policyRule: |
{
"if": {
"not": {
"field": "location",
"equals": "westeurope"
}
},
"then": {
"effect": "Deny"
}
}
policyType: Custom
policy
apiVersion: authorization.azure.upbound.io/v1beta1
kind: PolicyDefinition
metadata:
annotations:
meta.upbound.io/example-id: authorization/v1beta1/policydefinition
labels:
testing.upbound.io/example-name: policy
name: policy
spec:
forProvider:
displayName: acceptance test policy definition
metadata: |+2
{
"category": "General"
}
mode: Indexed
parameters: |
{
"allowedLocations": {
"type": "Array",
"metadata": {
"description": "The list of allowed locations for resources.",
"displayName": "Allowed locations",
"strongType": "location"
}
}
}
policyRule: |
{
"if": {
"not": {
"field": "location",
"in": "[parameters('allowedLocations')]"
}
},
"then": {
"effect": "audit"
}
}
policyType: Custom
examplepolicy
apiVersion: authorization.azure.upbound.io/v1beta1
kind: PolicyDefinition
metadata:
annotations:
meta.upbound.io/example-id: authorization/v1beta1/resourcepolicyassignment
upjet.upbound.io/manual-intervention: ResourcePolicyAssignment depends on
existing resource id (Virutal Network in this example)
labels:
testing.upbound.io/example-name: examplepolicy
name: examplepolicy
spec:
forProvider:
displayName: somename
mode: All
policyRule: |
{
"if": {
"not": {
"field": "location",
"equals": "westeurope"
}
},
"then": {
"effect": "Deny"
}
}
policyType: Custom
© 2022 Upbound, Inc.
Discover the building blocksfor your internal cloud platform.