{
"$defs": {
"sourceList": {
"items": {
"anyOf": [
{
"enum": [
"'self'",
"'none'",
"'unsafe-inline'",
"'unsafe-eval'"
],
"type": "string"
},
{
"format": "uri",
"type": "string"
},
{
"pattern": "^https?:\\/\\/.*",
"type": "string"
},
{
"pattern": "^\\*\\..*",
"type": "string"
},
{
"pattern": "^'nonce-.*'$",
"type": "string"
},
{
"pattern": "^'sha256-.*'$",
"type": "string"
},
{
"pattern": "^'sha384-.*'$",
"type": "string"
},
{
"pattern": "^'sha512-.*'$",
"type": "string"
}
]
},
"type": "array"
}
},
"$id": "https://schemas.don.projects.digilab.network/schemas/policy-as-code/csp",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"properties": {
"baseUri": {
"$ref": "#/$defs/sourceList"
},
"blockAllMixedContent": {
"default": false,
"type": "boolean"
},
"connectSrc": {
"$ref": "#/$defs/sourceList"
},
"defaultSrc": {
"$ref": "#/$defs/sourceList"
},
"fontSrc": {
"$ref": "#/$defs/sourceList"
},
"formAction": {
"$ref": "#/$defs/sourceList"
},
"frameAncestors": {
"$ref": "#/$defs/sourceList"
},
"frameSrc": {
"$ref": "#/$defs/sourceList"
},
"imgSrc": {
"$ref": "#/$defs/sourceList"
},
"mediaSrc": {
"$ref": "#/$defs/sourceList"
},
"objectSrc": {
"$ref": "#/$defs/sourceList"
},
"reportTo": {
"type": "string"
},
"reportUri": {
"items": {
"format": "uri",
"type": "string"
},
"type": "array"
},
"requireTrustedTypesFor": {
"items": {
"enum": [
"script"
],
"type": "string"
},
"type": "array"
},
"scriptSrc": {
"$ref": "#/$defs/sourceList"
},
"scriptSrcAttr": {
"$ref": "#/$defs/sourceList"
},
"scriptSrcElem": {
"$ref": "#/$defs/sourceList"
},
"styleSrc": {
"$ref": "#/$defs/sourceList"
},
"styleSrcAttr": {
"$ref": "#/$defs/sourceList"
},
"styleSrcElem": {
"$ref": "#/$defs/sourceList"
},
"trustedTypes": {
"items": {
"type": "string"
},
"type": "array"
},
"upgradeInsecureRequests": {
"default": false,
"type": "boolean"
}
},
"type": "object"
}