v1

latestOpenAPI 3.1.02026-07-1781833.4 KB
rules

Update rule

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.

patch/orgs/{org_name}/governance/policies/{policy_id}/rules/{rule_id}

Request body

namestring

Human-readable label for the rule.

actionsstring[]

Network actions: connect:tcp, connect:udp. Filesystem actions: read, write. All actions in a rule must belong to the same domain; mixing network and filesystem actions in one rule is rejected.

resourcesstring[]

Network domain: hostnames (for example, example.com), wildcard subdomains (*.example.com or **.example.com), hostnames with port (for example, example.com:443), or CIDRs in IPv4 or IPv6 notation (for example, 10.0.0.0/8 or 2001:db8::/32). Filesystem domain: paths (for example, /data); * matches within one path segment, ** matches recursively (for example, /data/**).

decision'allow' | 'deny'

Outcome applied when this rule matches a request. deny always wins: if any rule in the policy matches with decision: deny, the request is denied even if other rules match with decision: allow.

Example request

{
  "name": "allow research mirrors",
  "actions": [
    "connect:tcp",
    "connect:udp"
  ],
  "resources": [
    "research.mitre.org",
    "cve.mitre.org"
  ],
  "decision": "allow"
}

Response

Rule updated, returns old and new states.

Example response

{
  "old": {
    "id": "rule_06evsm9qjm1pdsk0a8nkfaxy7jna",
    "name": "allow research mirrors",
    "actions": [
      "connect:tcp",
      "connect:udp"
    ],
    "resources": [
      "research.mitre.org",
      "cve.mitre.org"
    ],
    "decision": "allow"
  },
  "new": {
    "id": "rule_06evsm9qjm1pdsk0a8nkfaxy7jna",
    "name": "allow research mirrors",
    "actions": [
      "connect:tcp",
      "connect:udp"
    ],
    "resources": [
      "research.mitre.org",
      "cve.mitre.org"
    ],
    "decision": "allow"
  }
}