Updates security.txt
Updates the security.txt file configuration for a zone, which provides security researchers with vulnerability reporting information.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Accepted Permissions (at least one required)
Body ParametersJSON
Methods that researchers should use for reporting vulnerabilities. Can be a URI for an email address, phone number, or URL.
RFC3339-formatted date and time string indicating the time that, after which, the contents of the security.txt file should be considered stale. It is recommended that this value is less than a year into the future.
Link(s) to a page where security researchers are recognised for their reports.
Whether or not to serve the security.txt file in this zone. If false, security.txt requests will pass through to the origin server.
Updates security.txt
curl https://api.cloudflare.com/client/v4/zones/$ZONE_ID/security-center/securitytxt \
-X PUT \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-d '{
"contact": [
"mailto:security@example.com",
"tel:+1-201-555-0123",
"https://example.com/security-contact.html"
],
"expires": "2027-12-31T23:59:59Z",
"acknowledgments": [
"https://example.com/hall-of-fame.html"
],
"canonical": [
"https://www.example.com/.well-known/security.txt"
],
"enabled": true,
"encryption": [
"https://example.com/pgp-key.txt",
"dns:5d2d37ab76d47d36._openpgpkey.example.com?type=OPENPGPKEY",
"openpgp4fpr:5f2de5521c63a801ab59ccb603d49de44b29100f"
],
"hiring": [
"https://example.com/jobs.html"
],
"policy": [
"https://example.com/disclosure-policy.html"
],
"preferred_languages": "en, es, fr"
}'{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"success": true
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"success": true
}