Skip to content

Commit 839896c

Browse files
Porting JSON changes to protobuf
Signed-off-by: Steve Springett <[email protected]>
1 parent e9a9d93 commit 839896c

File tree

5 files changed

+618
-45
lines changed

5 files changed

+618
-45
lines changed

schema/bom-1.7.proto

Lines changed: 196 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2078,6 +2078,8 @@ message CryptoProperties {
20782078
CRYPTO_PRIMITIVE_AE = 14;
20792079
// A combiner aggregates many candidates for a cryptographic primitive and generates a new candidate for the same primitive.
20802080
CRYPTO_PRIMITIVE_COMBINER = 15;
2081+
// Key-wrap is a cryptographic technique used to securely encrypt and protect cryptographic keys using algorithms like AES.
2082+
CRYPTO_PRIMITIVE_KEY_WRAP = 16;
20812083
}
20822084

20832085
// Execution Environment
@@ -2209,6 +2211,41 @@ message CryptoProperties {
22092211
optional int32 nistQuantumSecurityLevel = 11;
22102212
} // end of AlgorithmProperties
22112213

2214+
// Certificate State
2215+
message CertificateState {
2216+
// Pre-defined certificate states
2217+
enum PredefinedState {
2218+
// ProtoBuff's default value
2219+
PREDEFINED_STATE_UNSPECIFIED = 0;
2220+
// The certificate has been issued by the issuing certificate authority (CA) but has not been authorized for use.
2221+
PREDEFINED_STATE_PRE_ACTIVATION = 1;
2222+
// The certificate may be used to cryptographically protect information, cryptographically process previously protected information, or both.
2223+
PREDEFINED_STATE_ACTIVE = 2;
2224+
// The use of a certificate may be suspended for several possible reasons.
2225+
PREDEFINED_STATE_SUSPENDED = 3;
2226+
// Certificates in the deactivated state shall not be used to apply cryptographic protection but, in some cases, may be used to process cryptographically protected information.
2227+
PREDEFINED_STATE_DEACTIVATED = 4;
2228+
// A revoked certificate is a digital certificate that has been invalidated by the issuing certificate authority (CA) before its scheduled expiration date.
2229+
PREDEFINED_STATE_REVOKED = 5;
2230+
// The certificate has been destroyed.
2231+
PREDEFINED_STATE_DESTROYED = 6;
2232+
}
2233+
2234+
// A reason for the certificate being in this state.
2235+
optional string reason = 1;
2236+
2237+
// The state can be either a predefined state or a custom state
2238+
oneof state {
2239+
// A pre-defined state in the certificate lifecycle.
2240+
PredefinedState predefined_state = 2;
2241+
// The name of the certificate lifecycle state for custom states.
2242+
string name = 3;
2243+
}
2244+
2245+
// The description of the certificate lifecycle state (only used with custom states).
2246+
optional string description = 4;
2247+
}
2248+
22122249
// Certificate Properties
22132250
message CertificateProperties {
22142251
// The subject name for the certificate
@@ -2219,16 +2256,100 @@ message CryptoProperties {
22192256
optional google.protobuf.Timestamp notValidBefore = 3;
22202257
// The date and time according to ISO-8601 standard from which the certificate is not valid anymore
22212258
optional google.protobuf.Timestamp notValidAfter = 4;
2222-
// The bom-ref to signature algorithm used by the certificate
2259+
// [DEPRECATED] Use relatedCryptographicAssets instead. The bom-ref to signature algorithm used by the certificate
22232260
optional string signatureAlgorithmRef = 5;
2224-
// The bom-ref to the public key of the subject
2261+
// [DEPRECATED] Use relatedCryptographicAssets instead. The bom-ref to the public key of the subject
22252262
optional string subjectPublicKeyRef = 6;
22262263
// The format of the certificate. Examples include X.509, PEM, DER, and CVC.
22272264
optional string certificateFormat = 7;
2228-
// The file extension of the certificate. Examples include crt, pem, cer, der, and p12.
2265+
// [DEPRECATED] Use certificateFileExtension instead. The file extension of the certificate. Examples include crt, pem, cer, der, and p12.
22292266
optional string certificateExtension = 8;
2267+
// The serial number is a unique identifier for the certificate issued by a CA.
2268+
optional string serialNumber = 9;
2269+
// The file extension of the certificate. Examples include crt, pem, cer, der, and p12.
2270+
optional string certificateFileExtension = 10;
2271+
// The fingerprint is a cryptographic hash of the certificate excluding it's signature.
2272+
optional Hash fingerprint = 11;
2273+
// The certificate lifecycle is a comprehensive process that manages digital certificates from their initial creation to eventual expiration or revocation. It typically involves several stages.
2274+
repeated CertificateState certificateState = 12;
2275+
// The date and time (timestamp) when the certificate was created or pre-activated.
2276+
optional google.protobuf.Timestamp creationDate = 13;
2277+
// The date and time (timestamp) when the certificate was activated.
2278+
optional google.protobuf.Timestamp activationDate = 14;
2279+
// The date and time (timestamp) when the related certificate was deactivated.
2280+
optional google.protobuf.Timestamp deactivationDate = 15;
2281+
// The date and time (timestamp) when the certificate was revoked.
2282+
optional google.protobuf.Timestamp revocationDate = 16;
2283+
// The date and time (timestamp) when the certificate was destroyed.
2284+
optional google.protobuf.Timestamp destructionDate = 17;
2285+
// A certificate extension is an optional field that provides additional information about the certificate or its use. Extensions are used to convey additional information beyond the standard fields.
2286+
optional CertificateExtensions certificateExtensions = 18;
2287+
// A list of cryptographic assets related to this component.
2288+
optional RelatedCryptographicAssets relatedCryptographicAssets = 19;
22302289
} // end of CertificateProperties
22312290

2291+
// Certificate Extensions
2292+
message CertificateExtensions {
2293+
// Common extension names
2294+
enum CommonExtensionName {
2295+
// ProtoBuff's default value
2296+
COMMON_EXTENSION_NAME_UNSPECIFIED = 0;
2297+
COMMON_EXTENSION_NAME_BASIC_CONSTRAINTS = 1;
2298+
COMMON_EXTENSION_NAME_KEY_USAGE = 2;
2299+
COMMON_EXTENSION_NAME_EXTENDED_KEY_USAGE = 3;
2300+
COMMON_EXTENSION_NAME_SUBJECT_ALTERNATIVE_NAME = 4;
2301+
COMMON_EXTENSION_NAME_AUTHORITY_KEY_IDENTIFIER = 5;
2302+
COMMON_EXTENSION_NAME_SUBJECT_KEY_IDENTIFIER = 6;
2303+
COMMON_EXTENSION_NAME_AUTHORITY_INFORMATION_ACCESS = 7;
2304+
COMMON_EXTENSION_NAME_CERTIFICATE_POLICIES = 8;
2305+
COMMON_EXTENSION_NAME_CRL_DISTRIBUTION_POINTS = 9;
2306+
COMMON_EXTENSION_NAME_SIGNED_CERTIFICATE_TIMESTAMP = 10;
2307+
}
2308+
2309+
// Extension represents either a common extension or a custom extension
2310+
message Extension {
2311+
oneof extension_type {
2312+
// Common extension with predefined name
2313+
CommonExtension commonExtension = 1;
2314+
// Custom extension with user-defined name
2315+
CustomExtension customExtension = 2;
2316+
}
2317+
}
2318+
2319+
// Common extension with predefined name
2320+
message CommonExtension {
2321+
// The name of the extension
2322+
CommonExtensionName name = 1;
2323+
// The value of the certificate extension
2324+
string value = 2;
2325+
}
2326+
2327+
// Custom extension with user-defined name
2328+
message CustomExtension {
2329+
// The name for the custom certificate extension
2330+
string name = 1;
2331+
// The description of the custom certificate extension
2332+
optional string value = 2;
2333+
}
2334+
2335+
// List of certificate extensions
2336+
repeated Extension extensions = 1;
2337+
}
2338+
2339+
// Related Cryptographic Assets
2340+
message RelatedCryptographicAssets {
2341+
// Related Cryptographic Asset
2342+
message RelatedCryptographicAsset {
2343+
// The type of the related cryptographic asset
2344+
string type = 1;
2345+
// The reference to the related cryptographic asset
2346+
string ref = 2;
2347+
}
2348+
2349+
// List of related cryptographic assets
2350+
repeated RelatedCryptographicAsset assets = 1;
2351+
}
2352+
22322353
// Related Cryptographic Material Properties
22332354
message RelatedCryptoMaterialProperties {
22342355

@@ -2285,7 +2406,7 @@ message CryptoProperties {
22852406
optional string id = 2;
22862407
// The key state as defined by NIST SP 800-57.
22872408
optional CryptoRelatedState state = 3;
2288-
// The bom-ref to the algorithm used to generate the related cryptographic material.
2409+
// [DEPRECATED] Use relatedCryptographicAssets instead. The bom-ref to the algorithm used to generate the related cryptographic material.
22892410
optional string algorithmRef = 4;
22902411
// The date and time (timestamp) when the related cryptographic material was created.
22912412
optional google.protobuf.Timestamp creationDate = 5;
@@ -2303,6 +2424,10 @@ message CryptoProperties {
23032424
optional string format = 11;
23042425
// The mechanism by which the cryptographic asset is secured.
23052426
optional CryptoRelatedSecuredBy securedBy = 12;
2427+
// The fingerprint is a cryptographic hash of the asset.
2428+
optional Hash fingerprint = 13;
2429+
// A list of cryptographic assets related to this component.
2430+
optional RelatedCryptographicAssets relatedCryptographicAssets = 14;
23062431
} // end of RelatedCryptoMaterialProperties
23072432

23082433
// Protocol Properties
@@ -2326,6 +2451,20 @@ message CryptoProperties {
23262451
CRYPTO_PROTOCOL_TYPE_SSTP = 7;
23272452
// Wi-Fi Protected Access
23282453
CRYPTO_PROTOCOL_TYPE_WPA = 8;
2454+
// Datagram Transport Layer Security
2455+
CRYPTO_PROTOCOL_TYPE_DTLS = 9;
2456+
// Quick UDP Internet Connections
2457+
CRYPTO_PROTOCOL_TYPE_QUIC = 10;
2458+
// Extensible Authentication Protocol variant
2459+
CRYPTO_PROTOCOL_TYPE_EAP_AKA = 11;
2460+
// Enhanced version of EAP-AKA
2461+
CRYPTO_PROTOCOL_TYPE_EAP_AKA_PRIME = 12;
2462+
// Protection of Inter-Network Signaling
2463+
CRYPTO_PROTOCOL_TYPE_PRINS = 13;
2464+
// Authentication and Key Agreement for 5G
2465+
CRYPTO_PROTOCOL_TYPE_5G_AKA = 14;
2466+
// JSON Object Signing and Encryption
2467+
CRYPTO_PROTOCOL_TYPE_JOSE = 15;
23292468
}
23302469

23312470
// Object representing a cipher suite
@@ -2336,22 +2475,68 @@ message CryptoProperties {
23362475
repeated string algorithms = 2;
23372476
// A list of common identifiers for the cipher suite. For example: 0xC0 and 0x9E
23382477
repeated string identifiers = 3;
2478+
// A list of TLS named groups (formerly known as curves) for this cipher suite. These groups define the parameters for key exchange algorithms like ECDHE.
2479+
repeated string tlsGroups = 4;
2480+
// A list of signature schemes supported for cipher suite. These schemes specify the algorithms used for digital signatures in TLS handshakes and certificate verification.
2481+
repeated string tlsSignatureSchemes = 5;
2482+
}
2483+
2484+
// Encryption Algorithm (ENCR)
2485+
message IkeV2Enc {
2486+
// A name for the encryption method
2487+
optional string name = 1;
2488+
// The key length of the encryption algorithm
2489+
optional int32 keyLength = 2;
2490+
// The bom-ref to algorithm cryptographic asset
2491+
optional string algorithm = 3;
2492+
}
2493+
2494+
// Pseudorandom Function (PRF)
2495+
message IkeV2Prf {
2496+
// A name for the pseudorandom function
2497+
optional string name = 1;
2498+
// The bom-ref to algorithm cryptographic asset
2499+
optional string algorithm = 2;
2500+
}
2501+
2502+
// Integrity Algorithm (INTEG)
2503+
message IkeV2Integ {
2504+
// A name for the integrity algorithm
2505+
optional string name = 1;
2506+
// The bom-ref to algorithm cryptographic asset
2507+
optional string algorithm = 2;
2508+
}
2509+
2510+
// Key Exchange Method (KE)
2511+
message IkeV2Ke {
2512+
// A group identifier for the key exchange algorithm
2513+
optional int32 group = 1;
2514+
// The bom-ref to algorithm cryptographic asset
2515+
optional string algorithm = 2;
2516+
}
2517+
2518+
// IKEv2 Authentication method
2519+
message IkeV2Auth {
2520+
// A name for the authentication method
2521+
optional string name = 1;
2522+
// The bom-ref to algorithm cryptographic asset
2523+
optional string algorithm = 2;
23392524
}
23402525

23412526
// IKEv2 Transform Types
23422527
message Ikev2TransformTypes {
23432528
// Transform Type 1: encryption algorithms
2344-
repeated string encr = 1;
2529+
repeated IkeV2Enc encr = 1;
23452530
// Transform Type 2: pseudorandom functions
2346-
repeated string prf = 2;
2531+
repeated IkeV2Prf prf = 2;
23472532
// Transform Type 3: integrity algorithms
2348-
repeated string integ = 3;
2533+
repeated IkeV2Integ integ = 3;
23492534
// Transform Type 4: Key Exchange Method (KE) per RFC9370, formerly called Diffie-Hellman Group (D-H)
2350-
repeated string ke = 4;
2535+
repeated IkeV2Ke ke = 4;
23512536
// Specifies if an Extended Sequence Number (ESN) is used.
23522537
optional bool esn = 5;
23532538
// IKEv2 Authentication method
2354-
repeated string auth = 6;
2539+
repeated IkeV2Auth auth = 6;
23552540
}
23562541

23572542
// The concrete protocol type.
@@ -2364,6 +2549,8 @@ message CryptoProperties {
23642549
optional Ikev2TransformTypes ikev2TransformTypes = 4;
23652550
// The bom-ref(s) to protocol-related cryptographic assets
23662551
repeated string cryptoRef = 5;
2552+
// A list of cryptographic assets related to this component.
2553+
optional RelatedCryptographicAssets relatedCryptographicAssets = 6;
23672554
} // end of ProtocolProperties
23682555

23692556
// Cryptographic assets occur in several forms. Algorithms and protocols are most commonly implemented in specialized cryptographic libraries. They may, however, also be 'hardcoded' in software components. Certificates and related cryptographic material like keys, tokens, secrets or passwords are other cryptographic assets to be modelled.

schema/bom-1.7.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5396,7 +5396,7 @@
53965396
"deprecated": true,
53975397
"type": "string",
53985398
"title": "Certificate File Extension",
5399-
"description": "The file extension of the certificate",
5399+
"description": "[DEPRECATED] Use certificateFileExtension instead. The file extension of the certificate",
54005400
"examples": [
54015401
"crt",
54025402
"pem",
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# proto-file: schema/bom-1.7.proto
2+
# proto-message: Bom
3+
4+
spec_version: "1.7"
5+
version: 1
6+
serial_number: "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79"
7+
components: [
8+
{
9+
type: CLASSIFICATION_CRYPTOGRAPHIC_ASSET
10+
bom_ref: "9AADCCE0-F5AD-4A26-A1A9-5B3C85323E9B"
11+
name: "example-certificate.example.com"
12+
cryptoProperties: {
13+
assetType: CRYPTO_ASSET_TYPE_CERTIFICATE
14+
certificateProperties: {
15+
serialNumber: "AABBCCDDEEFF00112233"
16+
subjectName: "CN = example.example.com, OU = Security, O = Example Corp, C = US"
17+
issuerName: "CN = Example CA, O = Example Corp, C = US"
18+
notValidBefore {
19+
seconds: 1672531200 # 2023-01-01T00:00:00Z
20+
}
21+
notValidAfter {
22+
seconds: 1704067199 # 2023-12-31T23:59:59Z
23+
}
24+
certificateFormat: "X.509"
25+
certificateFileExtension: "pem"
26+
fingerprint {
27+
alg: HASH_ALG_SHA_256
28+
value: "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
29+
}
30+
certificateState: [
31+
{
32+
predefined_state: PREDEFINED_STATE_ACTIVE
33+
reason: "Certificate is in active use"
34+
}
35+
]
36+
creationDate {
37+
seconds: 1671091200 # 2022-12-15T10:00:00Z
38+
}
39+
activationDate {
40+
seconds: 1672531200 # 2023-01-01T00:00:00Z
41+
}
42+
certificateExtensions {
43+
extensions: [
44+
{
45+
commonExtension {
46+
name: COMMON_EXTENSION_NAME_BASIC_CONSTRAINTS
47+
value: "CA:FALSE"
48+
}
49+
},
50+
{
51+
commonExtension {
52+
name: COMMON_EXTENSION_NAME_KEY_USAGE
53+
value: "Digital Signature, Key Encipherment"
54+
}
55+
},
56+
{
57+
commonExtension {
58+
name: COMMON_EXTENSION_NAME_EXTENDED_KEY_USAGE
59+
value: "TLS Web Server Authentication, TLS Web Client Authentication"
60+
}
61+
},
62+
{
63+
commonExtension {
64+
name: COMMON_EXTENSION_NAME_SUBJECT_ALTERNATIVE_NAME
65+
value: "DNS:example.example.com, DNS:www.example.example.com"
66+
}
67+
},
68+
{
69+
customExtension {
70+
name: "environmentType"
71+
value: "Production"
72+
}
73+
}
74+
]
75+
}
76+
}
77+
oid: "2.5.4.3"
78+
}
79+
}
80+
]

0 commit comments

Comments
 (0)