Update an inventory rule
Changes a rule or turns it off with enabled: false. Only the fields you send are changed, and the inventory is refreshed afterwards. Scripts the rule already decided keep that decision until their hash changes or someone reviews them, so changing action does not revisit them.
Requires the manager role on the website and the compliance plan feature.
AuthorizationBearer <JWT>An OpenID Connect access token from signing in to CentralCSP, acting as the signed-in user.
workspaceId*stringThe workspace's id.
websiteId*stringThe website's id.
ruleId*stringThe inventory rule's id.
application/json- body
Only the fields you send are changed.
name?stringNew display name.
1 <= length <= 255urlPattern?stringNew pattern to match script URLs against.
1 <= length <= 1024patternType?PatternTypeHow urlPattern is read. glob uses * wildcards and is the default. regex is a regular expression; one with too many unbounded repetitions is rejected.
"glob""regex"action?RuleActionWhat happens to a script the rule matches. justify (the default) records it as reviewed and allowed. reject records it as unauthorized, a finding that stays in the inventory until the script stops loading. exclude takes it out of PCI scope, the compliance figures and script alerts; use it only for scripts a visitor's own software injects, such as a browser extension. No rule overrides a decision a person made.
"justify""reject""exclude"justification?stringNew text recorded on matching scripts.
1 <= length <= 4096tagIds?array<string>Tags to apply to every script this rule matches.
items <= 50enabled?booleanTurn the rule on or off.
sortOrder?|Rules are tried from the lowest value up, and the first match wins. Put the most specific rules first.
0 <= valueA rule that decides matching scripts automatically: justifying them, rejecting them, or excluding them from PCI scope.
application/json- response
id*stringworkspaceId*stringwebsiteId*stringname*stringDisplay name.
urlPattern*stringPattern matched against the script URL.
patternType*PatternTypeHow urlPattern is read. glob uses * wildcards and is the default. regex is a regular expression; one with too many unbounded repetitions is rejected.
"glob""regex"action*RuleActionWhat happens to a script the rule matches. justify (the default) records it as reviewed and allowed. reject records it as unauthorized, a finding that stays in the inventory until the script stops loading. exclude takes it out of PCI scope, the compliance figures and script alerts; use it only for scripts a visitor's own software injects, such as a browser extension. No rule overrides a decision a person made.
"justify""reject""exclude"justification*stringApplied to every script this rule matches: the justification on a justify rule, the reason on a reject or exclude one.
tagIds*array<string>Tags applied to matching scripts.
enabled*booleanA disabled rule matches nothing.
sortOrder*|Rules are tried from the lowest value up, and the first match wins. Put the most specific rules first.
0 <= valuecreatedAt*stringdate-timeupdatedAt*stringdate-timecurl -X PATCH 'https://api.centralcsp.com/v1/workspaces/01936b7a-6f2e-7c31-9a4d-2f8e1c5b7d90/websites/01936b7a-6f2e-7c31-9a4d-2f8e1c5b7d90/compliance/rules/01936b7a-6f2e-7c31-9a4d-2f8e1c5b7d90' \ -H 'Content-Type: application/json' \ -d '{}'{ "id": "string", "workspaceId": "string", "websiteId": "string", "name": "Stripe", "urlPattern": "https://*.stripe.com/*", "patternType": "glob", "action": "justify", "justification": "string", "tagIds": [ "string" ], "enabled": true, "sortOrder": 0, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}