Skip to content

Commit 99c443b

Browse files
committed
Add Security Advisories to .proto
1 parent f116f6a commit 99c443b

5 files changed

Lines changed: 631 additions & 168 deletions

File tree

proto/hex_pb_package.proto

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ message Package {
77
required string name = 2;
88
// Name of repository
99
required string repository = 3;
10+
// All security advisories affecting any release of the package
11+
repeated SecurityAdvisory advisories = 4;
1012
}
1113

1214
message Release {
@@ -23,6 +25,8 @@ message Release {
2325
// sha256 checksum of outer package tarball
2426
// required when encoding but optional when decoding
2527
optional bytes outer_checksum = 5;
28+
// Indexes into Package.advisories for advisories affecting this release
29+
repeated uint32 advisory_indexes = 6;
2630
}
2731

2832
message RetirementStatus {
@@ -38,6 +42,29 @@ enum RetirementReason {
3842
RETIRED_RENAMED = 4;
3943
}
4044

45+
message SecurityAdvisory {
46+
// Advisory identifier (e.g. GHSA-xxxx-xxxx-xxxx or CVE-xxxx-xxxxx)
47+
required string id = 1;
48+
// Short description of the advisory
49+
required string summary = 2;
50+
// OSV web URL for the advisory
51+
required string html_url = 3;
52+
// Severity of the advisory
53+
optional AdvisorySeverity severity = 4;
54+
// CVSS score (0.0–10.0)
55+
optional float cvss_score = 5;
56+
// OSV API URL for the advisory
57+
required string api_url = 6;
58+
}
59+
60+
enum AdvisorySeverity {
61+
SEVERITY_NONE = 0;
62+
SEVERITY_LOW = 1;
63+
SEVERITY_MEDIUM = 2;
64+
SEVERITY_HIGH = 3;
65+
SEVERITY_CRITICAL = 4;
66+
}
67+
4168
message Dependency {
4269
// Package name of dependency
4370
required string package = 1;

proto/hex_pb_versions.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ message Package {
1616
repeated int32 retired = 3 [packed=true];
1717
// If set, the name of the package repository (NEVER USED, DEPRECATED)
1818
// string repository = 4;
19+
// Zero-based indexes of versions with security advisories in the versions field, see package.proto
20+
repeated int32 with_advisories = 5 [packed=true];
1921
}

0 commit comments

Comments
 (0)