Update rule
/orgs/{org_name}/governance/policies/{policy_id}/rules/{rule_id} Partially updates a rule. Only fields present in the request body are updated; absent fields are left unchanged. Returns the rule in both its old and new states.
Changing actions across domains (for example, from network actions to
filesystem actions) is rejected. Changes may take up to five minutes to
reach developer machines.
Connection and access
API connection and authentication guidance
https://hub.docker.com/v2
Use one of these alternatives. Requirements within an alternative apply together.
bearerAuth
Parameters
org_name
path
Required
Type:
string
All schema constraints and annotations
{
"type": "string"
}policy_id
path
Required
Type:
string
All schema constraints and annotations
{
"type": "string"
}rule_id
path
Required
Type:
string
All schema constraints and annotations
{
"type": "string"
}Request and responses
Request
application/json
Schema:
UpdateRuleRequest
default
{
"resources": [
"research.mitre.org"
]
}Response
200
application/json
Schema:
UpdateRuleResponse
default
{
"new": {
"actions": [
"connect:tcp",
"connect:udp"
],
"decision": "allow",
"id": "rule_06evsm9qjm1pdsk0a8nkfaxy7jna",
"name": "allow research mirrors",
"resources": [
"research.mitre.org"
]
},
"old": {
"actions": [
"connect:tcp",
"connect:udp"
],
"decision": "allow",
"id": "rule_06evsm9qjm1pdsk0a8nkfaxy7jna",
"name": "allow research mirrors",
"resources": [
"research.mitre.org",
"cve.mitre.org"
]
}
}Response
400
application/json
Schema:
Error
default
{
"error": {
"code": "invalid_argument",
"message": "name is required"
}
}Response
401
application/json
Schema:
Error
default
{
"error": {
"code": "unauthenticated",
"message": "unauthenticated"
}
}Response
403
application/json
Schema:
Error
default
{
"error": {
"code": "permission_denied",
"message": "permission denied"
}
}Response
404
application/json
Schema:
Error
default
{
"error": {
"code": "not_found",
"message": "policy not found"
}
}Response
409
application/json
Schema:
Error
default
{
"error": {
"code": "conflict",
"message": "policy name already in use"
}
}Response
500
application/json
Schema:
Error
default
{
"error": {
"code": "internal",
"message": "internal error"
}
}Referenced schemas
#/components/schemas/UpdateRuleRequest
#/components/schemas/UpdateRuleResponse
Complete operation contract
{
"description": "Partially updates a rule. Only fields present in the request body are\nupdated; absent fields are left unchanged. Returns the rule in both its\nold and new states.\n\nChanging `actions` across domains (for example, from network actions to\nfilesystem actions) is rejected. Changes may take up to five minutes to\nreach developer machines.\n",
"operationId": "updateRule",
"requestBody": {
"content": {
"application/json": {
"examples": {
"default": {
"value": {
"resources": [
"research.mitre.org"
]
}
}
},
"schema": {
"$ref": "#/components/schemas/UpdateRuleRequest"
}
}
},
"description": "Fields to update. Absent fields are left unchanged.",
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"examples": {
"default": {
"value": {
"new": {
"actions": [
"connect:tcp",
"connect:udp"
],
"decision": "allow",
"id": "rule_06evsm9qjm1pdsk0a8nkfaxy7jna",
"name": "allow research mirrors",
"resources": [
"research.mitre.org"
]
},
"old": {
"actions": [
"connect:tcp",
"connect:udp"
],
"decision": "allow",
"id": "rule_06evsm9qjm1pdsk0a8nkfaxy7jna",
"name": "allow research mirrors",
"resources": [
"research.mitre.org",
"cve.mitre.org"
]
}
}
}
},
"schema": {
"$ref": "#/components/schemas/UpdateRuleResponse"
}
}
},
"description": "Rule updated, returns old and new states."
},
"400": {
"$ref": "#/components/responses/InvalidArgument"
},
"401": {
"$ref": "#/components/responses/Unauthenticated"
},
"403": {
"$ref": "#/components/responses/PermissionDenied"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"409": {
"$ref": "#/components/responses/Conflict"
},
"500": {
"$ref": "#/components/responses/InternalError"
}
},
"summary": "Update rule",
"tags": [
"rules"
]
}