ESSO

Ethernos ESSO 规范 10430

包管理器官方安全源验证证书格式及发放规定

版本:1.0.2 状态:启用 发布机构:Ethernos Studio - Security Lab 规范编号:ESSO-10430 适用范围:Ethernos 旗下包管理器(包括但不限于 cavly)及其兼容的第三方包管理器实现 最后更新:2026-06-17


目录

  1. 范围与适用性
  2. 规范性引用
  3. 术语与定义
  4. 证书体系架构
  5. 证书格式规范(JSON Schema)
  6. 包指纹(Package Fingerprint)规范
  7. 官方服务器端点定义
  8. 证书发放与更新流程
  9. 客户端验证协议
  10. 安全与合规要求
  11. 附录

1. 范围与适用性

本规范定义了 Ethernos 生态系统中,包管理器对官方认证安全源进行身份验证与完整性校验时所使用的数字证书格式、发放机制及服务器接口标准。

本规范适用于:


2. 规范性引用


3. 术语与定义

术语 定义
cavly Ethernos 官方 Cavvy 包管理器实现,兼容本规范。
包指纹(Package Fingerprint) 分配给每个认证包的唯一、持久、不可变更的标识符,采用 UUID v5 格式。该指纹与包的版本、发布历史、元数据变更无关,终身绑定于该包实体。
安全源(Secure Source) 经过 Ethernos 官方认证,列入 caypak.ethernos.net 索引的代码仓库或二进制分发源。
证书(Certificate) caycert.ethernos.net 签发的 JSON 格式数字凭证,证明特定包指纹对应的包在特定版本下的完整性与来源可信性。
包指纹元信息(Fingerprint Metadata) 存储于 caycert.ethernos.net/{fingerprint}.json 中的包级静态信息,不随版本变化。
包指纹证书(Fingerprint Certificate) 存储于 caycert.ethernos.net/{fingerprint}.cert 中的版本级动态签名数据。

4. 证书体系架构

本规范采用双层证书架构

┌─────────────────────────────────────────┐
│         官方认证安全源服务器              │
│    caypak.ethernos.net           │
│  ┌─────────────┐  ┌─────────────────┐ │
│  │  index.html   │  │   index.json      │ │
│  │  (GA生成)     │  │  (仓库静态文件)    │ │
│  └─────────────┘  └─────────────────┘ │
└─────────────────────────────────────────┘
                    │
                    ▼
┌─────────────────────────────────────────┐
│         官方认证安全证书服务器            │
│    caycert.ethernos.net              │
│  ┌─────────────────────────────────────┐│
│  │  {fingerprint}.json  (元信息)       ││
│  │  {fingerprint}.cert  (证书)         ││
│  └─────────────────────────────────────┘│
└─────────────────────────────────────────┘

4.1 设计原则


5. 证书格式规范

5.1 包指纹元信息文件({fingerprint}.json

该文件包含包的静态属性,在包首次通过认证时创建,此后仅允许以下变更:

文件路径https://caycert.ethernos.net/{fingerprint}.json

JSON Schema

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "ESSO-10430 Package Fingerprint Metadata",
  "type": "object",
  "required": [
    "esso_version",
    "fingerprint",
    "current_name",
    "current_publisher",
    "current_repository",
    "created_at",
    "history",
    "public_keys"
  ],
  "properties": {
    "esso_version": {
      "type": "string",
      "description": "本规范版本号,当前为 1.0.0",
      "pattern": "^\\d+\\.\\d+\\.\\d+$"
    },
    "fingerprint": {
      "type": "string",
      "description": "包唯一指纹,UUID v5 格式",
      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
    },
    "current_name": {
      "type": "string",
      "description": "包当前官方名称",
      "maxLength": 128
    },
    "current_publisher": {
      "type": "string",
      "description": "包当前官方发布者标识",
      "maxLength": 256
    },
    "current_repository": {
      "type": "string",
      "description": "包当前官方仓库地址(HTTPS URL)",
      "format": "uri"
    },
    "created_at": {
      "type": "string",
      "description": "首次认证时间,ISO 8601 格式",
      "format": "date-time"
    },
    "history": {
      "type": "object",
      "description": "历史变更记录",
      "properties": {
        "names": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": { "type": "string" },
              "changed_at": { "type": "string", "format": "date-time" },
              "reason": { "type": "string" }
            }
          }
        },
        "publishers": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "publisher": { "type": "string" },
              "changed_at": { "type": "string", "format": "date-time" },
              "reason": { "type": "string" }
            }
          }
        },
        "repositories": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "repository": { "type": "string", "format": "uri" },
              "changed_at": { "type": "string", "format": "date-time" },
              "reason": { "type": "string" }
            }
          }
        }
      }
    },
    "public_keys": {
      "type": "array",
      "description": "发布者用于签名的 Ed25519 公钥列表(当前及历史)",
      "items": {
        "type": "object",
        "required": ["key_id", "algorithm", "public_key", "activated_at", "status"],
        "properties": {
          "key_id": {
            "type": "string",
            "description": "公钥指纹,SHA-256 前 16 字节十六进制"
          },
          "algorithm": {
            "type": "string",
            "enum": ["Ed25519"],
            "description": "签名算法,当前仅支持 Ed25519"
          },
          "public_key": {
            "type": "string",
            "description": "Base64 编码的原始公钥字节"
          },
          "activated_at": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": ["active", "revoked", "expired"]
          }
        }
      }
    }
  }
}

5.2 版本级证书文件({fingerprint}.cert

该文件包含特定版本的完整性证明动态签名,每次发布新版本时生成。

文件路径https://caycert.ethernos.net/{fingerprint}.cert

JSON Schema

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "ESSO-10430 Version Certificate",
  "type": "object",
  "required": [
    "esso_version",
    "fingerprint",
    "version",
    "name",
    "publisher",
    "repository",
    "commit_hash",
    "package_sha256",
    "certified_at",
    "signatures"
  ],
  "properties": {
    "esso_version": {
      "type": "string",
      "pattern": "^\\d+\\.\\d+\\.\\d+$"
    },
    "fingerprint": {
      "type": "string",
      "description": "包唯一指纹"
    },
    "version": {
      "type": "string",
      "description": "包版本号,遵循 SemVer 2.0.0",
      "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"
    },
    "name": {
      "type": "string",
      "description": "包名称,必须与 {fingerprint}.json 中 current_name 一致"
    },
    "publisher": {
      "type": "string",
      "description": "发布者标识,必须与 {fingerprint}.json 中 current_publisher 一致"
    },
    "repository": {
      "type": "string",
      "format": "uri",
      "description": "仓库地址,必须与 {fingerprint}.json 中 current_repository 一致"
    },
    "commit_hash": {
      "type": "string",
      "description": "Git 提交完整 SHA-1 哈希,40 字符十六进制",
      "pattern": "^[0-9a-f]{40}$"
    },
    "package_sha256": {
      "type": "string",
      "description": "整个分发包(.tar.xz / .zip / .cavpkg 等)的 SHA-256 哈希,64 字符十六进制",
      "pattern": "^[0-9a-f]{64}$"
    },
    "certified_at": {
      "type": "string",
      "format": "date-time",
      "description": "证书签发时间"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "证书过期时间(可选,官方源默认为签发后 5 年)"
    },
    "dependencies": {
      "type": "array",
      "description": "该版本声明的依赖项列表(可选)",
      "items": {
        "type": "object",
        "required": ["fingerprint", "version_constraint"],
        "properties": {
          "fingerprint": {
            "type": "string",
            "description": "依赖包的指纹"
          },
          "version_constraint": {
            "type": "string",
            "description": "版本约束表达式"
          }
        }
      }
    },
    "signatures": {
      "type": "object",
      "description": "多重签名结构",
      "required": ["publisher", "authority"],
      "properties": {
        "publisher": {
          "type": "object",
          "description": "发布者签名",
          "required": ["key_id", "algorithm", "signature"],
          "properties": {
            "key_id": {
              "type": "string",
              "description": "使用的公钥 ID,对应 {fingerprint}.json 中的 key_id"
            },
            "algorithm": {
              "type": "string",
              "enum": ["Ed25519"]
            },
            "signature": {
              "type": "string",
              "description": "Base64 编码的签名值"
            }
          }
        },
        "authority": {
          "type": "object",
          "description": "Ethernos 官方认证机构签名",
          "required": ["key_id", "algorithm", "signature"],
          "properties": {
            "key_id": {
              "type": "string",
              "description": "Ethernos 官方根密钥 ID"
            },
            "algorithm": {
              "type": "string",
              "enum": ["Ed25519"]
            },
            "signature": {
              "type": "string",
              "description": "Base64 编码的签名值"
            }
          }
        }
      }
    }
  }
}

5.3 签名数据规范

签名对象(signatures.*.signature)的生成遵循以下步骤:

  1. 构造签名载荷(Payload): 取证书对象中除 signatures 字段外的所有内容,按 RFC 8785 (JCS) 进行规范化 JSON 序列化。
  2. 载荷字符串: 序列化后的 UTF-8 字节序列。
  3. 签名算法: 使用 Ed25519 对载荷进行签名。
  4. 双重签名要求

    • 发布者签名:证明发布者承认该版本内容。
    • 官方签名:证明 Ethernos 官方已审核并纳入安全源索引。

6. 包指纹(Package Fingerprint)规范

6.1 格式要求

6.2 持久性保证

6.3 生成时机


7. 官方服务器端点定义

7.1 安全源索引服务器

基础地址https://caypak.ethernos.net

端点 类型 说明
/index.html 静态页面 由 GitHub Action 自动生成,提供人类可读的安全源浏览器。
/index.json 静态 JSON 直接存储于仓库,包含所有认证包的索引。

index.json 结构

{
  "esso_version": "1.0.0",
  "generated_at": "2026-06-17T12:41:00Z",
  "packages": [
    {
      "fingerprint": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
      "name": "caytorch",
      "latest_version": "2.1.0",
      "repository": "https://github.com/ethernos/caytorch",
      "latest_commit": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0",
      "latest_sha256": "deadbeef...(64字符)",
      "cert_url": "https://caycert.ethernos.net/a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d.cert",
      "meta_url": "https://caycert.ethernos.net/a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d.json",
      "status": "active"
    }
  ]
}

7.2 安全证书服务器

基础地址https://caycert.ethernos.net

端点 类型 说明
/{fingerprint}.json 静态 JSON 包指纹元信息(静态属性)。
/{fingerprint}.cert 静态 JSON 特定版本的证书(动态签名)。

托管方式:GitHub Pages 静态托管,所有文件通过 GitHub 仓库版本控制,变更历史可追溯。


8. 证书发放与更新流程

8.1 首次认证流程

开发者提交申请
    │
    ▼
┌─────────────────┐
│  官方审核仓库    │  ← 人工 + 自动化扫描
│  (GitHub PR)     │
└─────────────────┘
    │
    ▼
生成 UUID 指纹 → 创建 {fingerprint}.json
    │
    ▼
开发者发布版本 → 提交 commit_hash & package_sha256
    │
    ▼
生成 {fingerprint}.cert(双重签名)
    │
    ▼
更新 index.json → 合并至主分支
    │
    ▼
GitHub Pages 自动部署

8.2 版本更新流程

  1. 开发者发布新版本,提供:
    • version(SemVer)
    • commit_hash(Git 完整哈希)
    • package_sha256(分发包 SHA-256)
  2. 官方 CI 验证:
    • 仓库地址与 commit_hash 是否可访问且一致;
    • package_sha256 是否与构建产物匹配;
    • 版本号是否遵循 SemVer 且高于历史版本。
  3. 生成新的 {fingerprint}.cert 文件;
  4. 更新 index.json 中该包的 latest_versionlatest_commitlatest_sha256
  5. 提交至仓库,GitHub Pages 自动同步。

8.3 元信息变更流程

当发生以下变更时,需更新 {fingerprint}.json 而非 .cert

要求


9. 客户端验证协议

兼容 cavly 及本规范的包管理器,在安装或更新包时必须执行以下验证链:

9.1 验证步骤

1. 从 caypak.ethernos.net/index.json 获取包索引
2. 提取目标包的 fingerprint、latest_sha256、cert_url
3. 下载 caycert.ethernos.net/{fingerprint}.cert
4. 验证证书内 name / publisher / repository 与 index.json 一致
5. 验证证书内 commit_hash 与仓库公开记录一致(可选深度验证)
6. 下载实际分发包
7. 本地计算 SHA-256,与证书内 package_sha256 比对
8. 验证证书双重签名(publisher + authority)
9. 验证通过,执行安装

9.2 失败处理

失败场景 客户端行为
package_sha256 不匹配 立即中止安装,提示完整性校验失败。
签名验证失败 中止安装,提示证书不可信。
证书已过期 警告用户,建议联系发布者或等待官方更新。
仓库地址不可达 降级为仅验证证书与哈希,提示网络隔离风险。
指纹在 index.json 中标记为 retired 拒绝安装,提示该包已退役。

10. 安全与合规要求

10.1 哈希算法

10.2 签名算法

10.3 传输安全

10.4 审计与透明

10.5 降级攻击防护


11. 附录

附录 A:完整示例

index.json 片段

{
  "esso_version": "1.0.0",
  "generated_at": "2026-06-17T12:41:00Z",
  "packages": [
    {
      "fingerprint": "550e8400-e29b-41d4-a716-446655440000",
      "name": "cavvy-std",
      "latest_version": "5.2.0-alpha.1",
      "repository": "https://github.com/ethernos/cavvy-std",
      "latest_commit": "7d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6",
      "latest_sha256": "a3f5c7e9d2b4f6a8c0e2d4b6f8a0c2e4d6b8f0a2c4e6d8b0f2a4c6e8d0b2f4a6c8",
      "cert_url": "https://caycert.ethernos.net/550e8400-e29b-41d4-a716-446655440000.cert",
      "meta_url": "https://caycert.ethernos.net/550e8400-e29b-41d4-a716-446655440000.json",
      "status": "active"
    }
  ]
}

550e8400-e29b-41d4-a716-446655440000.json(元信息)

{
  "esso_version": "1.0.0",
  "fingerprint": "550e8400-e29b-41d4-a716-446655440000",
  "current_name": "cavvy-std",
  "current_publisher": "Ethernos Studio",
  "current_repository": "https://github.com/ethernos/cavvy-std",
  "created_at": "2025-01-15T08:00:00Z",
  "history": {
    "names": [],
    "publishers": [],
    "repositories": []
  },
  "public_keys": [
    {
      "key_id": "a1b2c3d4e5f6a7b8",
      "algorithm": "Ed25519",
      "public_key": "MCowBQYDK2VwAyEA...(Base64)",
      "activated_at": "2025-01-15T08:00:00Z",
      "status": "active"
    }
  ]
}

550e8400-e29b-41d4-a716-446655440000.cert(版本证书)

{
  "esso_version": "1.0.0",
  "fingerprint": "550e8400-e29b-41d4-a716-446655440000",
  "version": "5.2.0-alpha.1",
  "name": "cavvy-std",
  "publisher": "Ethernos Studio",
  "repository": "https://github.com/ethernos/cavvy-std",
  "commit_hash": "7d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6",
  "package_sha256": "a3f5c7e9d2b4f6a8c0e2d4b6f8a0c2e4d6b8f0a2c4e6d8b0f2a4c6e8d0b2f4a6c8",
  "certified_at": "2026-06-17T12:41:00Z",
  "expires_at": "2031-06-17T12:41:00Z",
  "signatures": {
    "publisher": {
      "key_id": "a1b2c3d4e5f6a7b8",
      "algorithm": "Ed25519",
      "signature": "base64encodedpublishersignature..."
    },
    "authority": {
      "key_id": "e5f6a7b8c9d0e1f2",
      "algorithm": "Ed25519",
      "signature": "base64encodedauthoritysignature..."
    }
  }
}

附录 B:版本历史

版本 日期 变更内容
1.0.0 2026-06-17 初始规范发布,定义双层证书架构、UUID 指纹、Ed25519/SHA-256 算法基线。
1.0.1 2026-06-29 修正了官网地址
1.0.2 2026-07-09 更新了RFC4122->RFC9652、添加了链接
1.0.3 2026-07-15 修正UUID版本号

规范制定:Ethernos Studio - Security Lab 技术审核:dhjs0000 生效日期:2026年6月17日