{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://auditstatus.com/schema/registry.schema.json",
  "title": "Audit Status registry file",
  "description": "A project in the public registry, registry/<project>.yml in the Audit Status repository. Generated from lib/registry.js. See https://auditstatus.com/docs/registry/#the-registry-file",
  "type": "object",
  "properties": {
    "project": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[^\\u0000-\\u001F\\u007F]{1,80}$"
        },
        "url": {
          "type": "string",
          "minLength": 1,
          "pattern": "^https:\\/\\/[a-z\\d](?:[a-z\\d.-]{0,251}[a-z\\d])?(?::\\d{1,5})?(?:\\/[\\w.~%+/-]*)?$"
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1,
          "pattern": "^[^\\u0000-\\u001F\\u007F]{1,200}$"
        },
        "contact": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[\\w.+-]{1,64}@[a-z\\d](?:[a-z\\d-]{0,61}[a-z\\d])?(?:\\.[a-z\\d](?:[a-z\\d-]{0,61}[a-z\\d])?)+$"
        },
        "github": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1,
          "pattern": "^[a-z\\d](?:[a-z\\d-]{0,37}[a-z\\d])?$"
        }
      },
      "required": [
        "name",
        "url",
        "contact"
      ],
      "additionalProperties": false
    },
    "setup": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "apt": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string",
            "minLength": 1,
            "pattern": "^[a-z\\d][a-z\\d.+-]{1,63}$"
          }
        },
        "node": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1,
          "pattern": "^(?:1[89]|[2-9]\\d)(?:\\.\\d{1,3}){0,2}$"
        }
      },
      "additionalProperties": false
    },
    "version": {
      "enum": [
        2,
        null
      ]
    },
    "repository": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "url": {
          "type": "string",
          "minLength": 1,
          "pattern": "^https:\\/\\/[a-z\\d](?:[a-z\\d.-]{0,251}[a-z\\d])?(?::\\d{1,5})?\\/[\\w.~%+/-]+$"
        },
        "branch": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1,
          "pattern": "^[\\w./-]{1,200}$"
        },
        "webUrl": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1,
          "pattern": "^https:\\/\\/[a-z\\d](?:[a-z\\d.-]{0,251}[a-z\\d])?(?::\\d{1,5})?\\/[\\w.~%+/-]+$"
        },
        "version": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1,
          "pattern": "^(?:any|latest|latest-release|[\\da-f]{40}|(?!-)(?!.*\\.\\.)(?!.*\\.lock$)[\\w.+/-]{1,200}(?<![./]))$"
        }
      },
      "required": [
        "url"
      ],
      "additionalProperties": false
    },
    "services": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "pattern": "^[\\w.-]{1,64}$"
          },
          "repository": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "url": {
                "type": "string",
                "minLength": 1,
                "pattern": "^https:\\/\\/[a-z\\d](?:[a-z\\d.-]{0,251}[a-z\\d])?(?::\\d{1,5})?\\/[\\w.~%+/-]+$"
              },
              "branch": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1,
                "pattern": "^[\\w./-]{1,200}$"
              },
              "webUrl": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1,
                "pattern": "^https:\\/\\/[a-z\\d](?:[a-z\\d.-]{0,251}[a-z\\d])?(?::\\d{1,5})?\\/[\\w.~%+/-]+$"
              },
              "version": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1,
                "pattern": "^(?:any|latest|latest-release|[\\da-f]{40}|(?!-)(?!.*\\.\\.)(?!.*\\.lock$)[\\w.+/-]{1,200}(?<![./]))$"
              }
            },
            "required": [
              "url"
            ],
            "additionalProperties": false
          },
          "build": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "command": {
                "type": "string",
                "minLength": 1
              },
              "outputs": {
                "description": "Patterns of files the build produces; never under node_modules",
                "type": "array",
                "minItems": 1,
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "^(?!(?:\\.\\/)?node_modules(?:\\/|$))"
                }
              },
              "env": {
                "type": [
                  "object",
                  "null"
                ],
                "propertyNames": {
                  "pattern": "^[A-Za-z_]\\w{0,127}$"
                },
                "additionalProperties": {
                  "type": "string"
                }
              },
              "timeoutSeconds": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 60,
                "maximum": 7200
              }
            },
            "required": [
              "command",
              "outputs"
            ],
            "additionalProperties": false
          },
          "lockfiles": {
            "description": "Lockfile paths in the repository, by ecosystem",
            "type": [
              "object",
              "null"
            ],
            "propertyNames": {
              "enum": [
                "npm",
                "pypi",
                "rubygems",
                "hex",
                "composer",
                "maven",
                "nuget",
                "cargo"
              ]
            },
            "additionalProperties": {
              "type": "string",
              "pattern": "^(?!.*\\.\\.)"
            }
          },
          "goModule": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "pattern": "^[\\w./-]+$"
          },
          "root": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "pattern": "^\\/(?:[^/\\0]+\\/)*[^/\\0]+$"
          },
          "artifact": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "signer": {
                "type": "object",
                "properties": {
                  "repository": {
                    "type": "string",
                    "minLength": 1,
                    "pattern": "^[\\w.-]+\\/[\\w.-]+$"
                  },
                  "workflow": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "minLength": 1,
                    "pattern": "^\\.github\\/workflows\\/[\\w./-]+\\.ya?ml$"
                  },
                  "ref": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "minLength": 1,
                    "pattern": "^refs\\/[\\w./-]+$"
                  }
                },
                "required": [
                  "repository"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "signer"
            ],
            "additionalProperties": false
          },
          "image": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "signer": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "repository": {
                    "type": "string",
                    "minLength": 1,
                    "pattern": "^[\\w.-]+\\/[\\w.-]+$"
                  },
                  "workflow": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "minLength": 1,
                    "pattern": "^\\.github\\/workflows\\/[\\w./-]+\\.ya?ml$"
                  },
                  "ref": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "minLength": 1,
                    "pattern": "^refs\\/[\\w./-]+$"
                  }
                },
                "required": [
                  "repository"
                ],
                "additionalProperties": false
              },
              "repository": {
                "anyOf": [
                  {
                    "description": "An image repository without a tag or digest (ghcr.io/owner/name), or a list of them",
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^(?:[\\w.-]+(?::\\d+)?\\/)?[\\w.-]+(?:\\/[\\w.-]+)*$"
                      },
                      {
                        "type": "array",
                        "minItems": 1,
                        "items": {
                          "type": "string",
                          "pattern": "^(?:[\\w.-]+(?::\\d+)?\\/)?[\\w.-]+(?:\\/[\\w.-]+)*$"
                        }
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "compareFiles": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "allowChanges": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              }
            },
            "additionalProperties": false
          },
          "executables": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "^\\/\\S+$"
                },
                "checksums": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "url": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "^(?:https:\\/\\/|http:\\/\\/(?:127\\.0\\.0\\.1|localhost)[:/])"
                    },
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "minLength": 1,
                      "pattern": "^[^\\s/]\\S*$"
                    },
                    "signature": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "url": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "minLength": 1,
                          "pattern": "^(?:https:\\/\\/|http:\\/\\/(?:127\\.0\\.0\\.1|localhost)[:/])"
                        },
                        "publicKey": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "minLength": 1,
                          "pattern": "^[A-Za-z\\d+/=]{56}$"
                        },
                        "identity": {
                          "description": "Certificate claims to require; a value written /.../ is a regular expression",
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        "type": {
                          "enum": [
                            "minisign",
                            "sigstore"
                          ]
                        }
                      },
                      "required": [
                        "type"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "url"
                  ],
                  "additionalProperties": false
                },
                "sha256": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "pattern": "^[\\da-f]{64}$"
                  }
                }
              },
              "required": [
                "path"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      }
    },
    "build": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "command": {
          "type": "string",
          "minLength": 1
        },
        "outputs": {
          "description": "Patterns of files the build produces; never under node_modules",
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "minLength": 1,
            "pattern": "^(?!(?:\\.\\/)?node_modules(?:\\/|$))"
          }
        },
        "env": {
          "type": [
            "object",
            "null"
          ],
          "propertyNames": {
            "pattern": "^[A-Za-z_]\\w{0,127}$"
          },
          "additionalProperties": {
            "type": "string"
          }
        },
        "timeoutSeconds": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 60,
          "maximum": 7200
        }
      },
      "required": [
        "command",
        "outputs"
      ],
      "additionalProperties": false
    },
    "policy": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "allowUntracked": {
          "description": "Patterns of files allowed though not in the commit; none may match every file",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string",
            "pattern": "[^*/.]"
          }
        },
        "modifiedAfterStart": {
          "enum": [
            "fail",
            "warn",
            null
          ]
        },
        "metadataChangedAfterStart": {
          "enum": [
            "fail",
            "warn",
            null
          ]
        },
        "unofficialNode": {
          "enum": [
            "fail",
            "warn",
            null
          ]
        },
        "unverifiedAuditor": {
          "enum": [
            "fail",
            "warn",
            null
          ]
        },
        "maxEvidenceAgeSeconds": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 10,
          "maximum": 86400
        },
        "maxCommitAgeDays": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 1,
          "maximum": 3650
        },
        "unverifiablePackages": {
          "enum": [
            "fail",
            "warn",
            null
          ]
        },
        "buildOutputs": {
          "enum": [
            "fail",
            "warn",
            null
          ]
        },
        "retryAfterSeconds": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0,
          "maximum": 3600
        },
        "versionMismatch": {
          "enum": [
            "fail",
            "warn",
            null
          ]
        },
        "versionGraceSeconds": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0,
          "maximum": 86400
        },
        "unexplainedCode": {
          "enum": [
            "fail",
            "warn",
            null
          ]
        },
        "containerCode": {
          "enum": [
            "fail",
            "warn",
            null
          ]
        },
        "bytecode": {
          "enum": [
            "fail",
            "warn",
            null
          ]
        },
        "builtPackages": {
          "enum": [
            "fail",
            "warn",
            null
          ]
        },
        "unpinnedPackages": {
          "enum": [
            "fail",
            "warn",
            null
          ]
        },
        "containerChanges": {
          "enum": [
            "fail",
            "warn",
            null
          ]
        },
        "monitor": {
          "enum": [
            "fail",
            "warn",
            null
          ]
        },
        "codePaths": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "additionalProperties": false
    },
    "references": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "npmProvenance": {
          "type": [
            "boolean",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "ssh": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "user": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1,
          "pattern": "^[a-z_][\\w-]{0,31}$"
        },
        "port": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 1,
          "maximum": 65535
        },
        "timeoutSeconds": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 5,
          "maximum": 3600
        }
      },
      "additionalProperties": false
    },
    "servers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "pattern": "^[\\w.-]{1,64}$"
          },
          "port": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 65535
          },
          "user": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "pattern": "^[a-z_][\\w-]{0,31}$"
          },
          "minProcesses": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 100000
          },
          "services": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string",
              "minLength": 1,
              "pattern": "^[\\w.-]{1,64}$"
            }
          },
          "tpm": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "required": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "ima": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "publicKey": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1,
                "pattern": "-{5}BEGIN PUBLIC KEY-{5}[\\s\\S]+-{5}END PUBLIC KEY-{5}"
              },
              "expectedPcrs": {
                "description": "Expected PCR values: bank, then PCR index, then hex value",
                "type": [
                  "object",
                  "null"
                ],
                "propertyNames": {
                  "enum": [
                    "sha1",
                    "sha256",
                    "sha384",
                    "sha512"
                  ]
                },
                "additionalProperties": {
                  "type": "object",
                  "propertyNames": {
                    "pattern": "^\\d{1,2}$"
                  },
                  "additionalProperties": {
                    "type": "string",
                    "pattern": "^(?:0x)?[\\da-fA-F]+$"
                  }
                }
              },
              "ekCertificate": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1,
                "pattern": "^[A-Za-z\\d+/=\\s]+$"
              }
            },
            "additionalProperties": false,
            "anyOf": [
              {
                "properties": {
                  "required": {
                    "enum": [
                      false,
                      null
                    ]
                  },
                  "ima": {
                    "enum": [
                      false,
                      null
                    ]
                  }
                }
              },
              {
                "required": [
                  "publicKey"
                ],
                "properties": {
                  "publicKey": {
                    "type": "string"
                  }
                }
              }
            ]
          },
          "confidential": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "required": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "type": {
                "enum": [
                  "sev-snp",
                  "tdx",
                  null
                ]
              },
              "measurements": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "^[\\da-fA-F]{32,128}$"
                }
              },
              "mrConfigId": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1,
                "pattern": "^[\\da-fA-F]{32,128}$"
              },
              "mrOwner": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1,
                "pattern": "^[\\da-fA-F]{32,128}$"
              }
            },
            "additionalProperties": false
          },
          "host": {
            "description": "A public host name or IPv4 address: not a private, loopback, link-local, shared or multicast address, nor a local name",
            "type": "string",
            "pattern": "^(?!(?:0|10|127)\\.|169\\.254\\.|192\\.168\\.|172\\.(?:1[6-9]|2\\d|3[01])\\.|100\\.(?:6[4-9]|[7-9]\\d|1[01]\\d|12[0-7])\\.|(?:22[4-9]|2[3-5]\\d)\\.|localhost$|.*\\.(?:localhost|local|internal|home\\.arpa)$|\\[)(?:[a-zA-Z\\d](?:[a-zA-Z\\d-]{0,61}[a-zA-Z\\d])?(?:\\.[a-zA-Z\\d](?:[a-zA-Z\\d-]{0,61}[a-zA-Z\\d])?)*|\\d{1,3}(?:\\.\\d{1,3}){3}|\\[[\\da-fA-F:]+\\])$"
          },
          "hostKeys": {
            "description": "The server's SSH host keys, as in /etc/ssh/ssh_host_ed25519_key.pub (\"ssh-ed25519 AAAA...\") or as ssh-keyscan prints them",
            "type": [
              "array",
              "null"
            ],
            "minItems": 1,
            "items": {
              "type": "string",
              "pattern": "^(?:\\S+\\s+)?(?:ssh-ed25519|ecdsa-sha2-nistp(?:256|384|521)|ssh-rsa|sk-ssh-ed25519@openssh\\.com|sk-ecdsa-sha2-nistp256@openssh\\.com)\\s+[A-Za-z\\d+/]{44,}={0,2}(?:\\s.*)?$"
            }
          }
        },
        "required": [
          "name",
          "host"
        ],
        "additionalProperties": false
      },
      "minItems": 1
    }
  },
  "required": [
    "project",
    "servers"
  ],
  "additionalProperties": false,
  "anyOf": [
    {
      "required": [
        "repository"
      ],
      "properties": {
        "repository": {
          "type": "object"
        }
      }
    },
    {
      "required": [
        "services"
      ],
      "properties": {
        "services": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "required": [
                  "repository"
                ],
                "properties": {
                  "repository": {
                    "type": "object"
                  }
                }
              },
              {
                "required": [
                  "image"
                ],
                "properties": {
                  "image": {
                    "type": "object"
                  }
                }
              }
            ]
          }
        }
      }
    }
  ]
}
