Skip to content
Connect an agent

Organisations

Set an organisation's secret scanning

Warn, or block a publish to the library (publish, auto-publish, editor save, public share) that has what looks like a secret, with 422 orgs.publish_blocked listing every finding masked.

PUT/orgs/{org}/secret-scanning

TL;DR

QuestionAnswer
What does it do?Set an organisation's secret scanning.
What does it take?A JSON body of type SecretScanning.
What does it return?Status 200 with a body of type SecretScanning.
What can go wrong?400 the body is not valid; 401 not signed in; 403 only the owner or an admin may change it (orgs.forbidden), or the request came from an origin that may not make changes; 404 no such organisation, or the caller is not a member of it; 422 a hostname pattern cannot be used; the details name each one and why; 429 too many requests; 503 organisations are not set up on this server. Every failure uses the one error envelope.

What it does

Warn, or block a publish to the library (publish, auto-publish, editor save, public share) that has what looks like a secret, with 422 orgs.publish_blocked listing every finding masked. Private addresses and hostname patterns are off by default and count only under block. Pattern-based, not a guarantee. The owner or an admin.

Path parameters

FieldTypeRequiredDescription
orgstringyesThe organisation's id or its slug.

Request body

The body has the type SecretScanning.

FieldTypeRequiredDescription
mode"warn" | "block"yeswarn: a publish to the library goes ahead and every draw warns (W700 to W710). block: a publish, an auto-publish, an editor save or a public share with any finding is refused with 422 orgs.publish_blocked.
privateIpsbooleanyesAlso count private IPv4 addresses (10/8, 172.16/12, 192.168/16) as findings (W709). Off by default; counts only while mode is block.
hostPatternsstring[]yesInternal hostname patterns that count as findings (W710), such as *.corp.example: DNS names in lower case, with * only as the first label. Empty by default; count only while mode is block.

Responses

StatusMeaningBody
200The setting now.SecretScanning
400The body is not valid.ErrorResponse
401Not signed in.ErrorResponse
403Only the owner or an admin may change it (orgs.forbidden), or the request came from an origin that may not make changes.ErrorResponse
404No such organisation, or the caller is not a member of it.ErrorResponse
422A hostname pattern cannot be used; the details name each one and why.ErrorResponse
429Too many requests.ErrorResponse
503Organisations are not set up on this server.ErrorResponse

Response body

A 200 answer has the type SecretScanning.

FieldTypeRequiredDescription
mode"warn" | "block"yeswarn: a publish to the library goes ahead and every draw warns (W700 to W710). block: a publish, an auto-publish, an editor save or a public share with any finding is refused with 422 orgs.publish_blocked.
privateIpsbooleanyesAlso count private IPv4 addresses (10/8, 172.16/12, 192.168/16) as findings (W709). Off by default; counts only while mode is block.
hostPatternsstring[]yesInternal hostname patterns that count as findings (W710), such as *.corp.example: DNS names in lower case, with * only as the first label. Empty by default; count only while mode is block.

See also

DocWhy
API referenceEvery endpoint, and the error envelope
SchemasEvery request and response type
Tool referenceThe operations as callable tools