Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.6 dev cbom #347

Merged
merged 33 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
a1697ef
Added schema documentation generation for v1.6
Sep 20, 2023
f1c9fe2
Initial commit and port of IBM/CBOM
Sep 20, 2023
7801028
Removed duplicate curves
Sep 21, 2023
6f38f48
CBOM: merges relatedCryptoMaterial and key asset types
bhess Oct 11, 2023
e91b9f0
fix size type and formatting
bhess Oct 12, 2023
8d1c9a4
Merges detectionContext properties with component evidence
bhess Oct 18, 2023
29373d7
remove remaining confidenceLevel
bhess Oct 19, 2023
17019b0
Corrected strict schema violations
stevespringett Oct 21, 2023
fae707b
Merge branch '1.6-dev-cbom' into bhe-cbom-evidence
stevespringett Oct 21, 2023
419d536
Merges detectionContext properties with component evidence (#325)
stevespringett Oct 21, 2023
5af5623
CBOM: merges relatedCryptoMaterial and key asset types (#313)
stevespringett Oct 21, 2023
dd517f6
CBOM: adds 'parameterSetIdentifier' property, replacing 'variant'
bhess Nov 16, 2023
779121c
CBOM: adds 'parameterSetIdentifier' property, replacing 'variant' (#339)
stevespringett Nov 16, 2023
d39b039
Description and minor field updates
Nov 16, 2023
77ab457
Merge branch '1.6-dev' into 1.6-dev-cbom
jkowalleck Nov 28, 2023
224f756
Review description fields of 'algorithmProperties'
bhess Nov 29, 2023
cbc6ee5
Review description fields of 'algorithmProperties' (#350)
jkowalleck Nov 30, 2023
ad47938
Added key to enum
stevespringett Dec 7, 2023
800ad2a
Commits as of last meeting
stevespringett Dec 12, 2023
32ffcc0
add 'combiner' as primitive
bhess Dec 12, 2023
915c7cc
Support for hybrids/combiners: add 'combiner' as primitive (#353)
stevespringett Dec 14, 2023
551d7ff
Updates from todays CBOM meeting
Dec 14, 2023
0e1e922
Merge branch '1.6-dev' into 1.6-dev-cbom
jkowalleck Dec 15, 2023
2908720
Normalizing CBOM and porting to XML and Protobuf. Adding test files.
stevespringett Jan 5, 2024
81858fe
Removing support for protected-by dependency type
stevespringett Jan 22, 2024
82ddeb0
Updated signatureAlgorithm and subjectPublicKey to include 'Ref'.
stevespringett Jan 22, 2024
83daf62
Merge branch 'master' into 1.6-dev-cbom
stevespringett Jan 22, 2024
57ab8bf
Merge branch '1.6-dev' into 1.6-dev-cbom
stevespringett Jan 22, 2024
9a9fab8
Added missing evidence in XSD and Protobuf originally missed when por…
stevespringett Jan 23, 2024
3446cce
Made certificationLevel an array. Updated test cases.
stevespringett Jan 23, 2024
29fc0a6
Renamed lineNumber to line to align properties with those in callstac…
stevespringett Jan 23, 2024
d8ae85e
rework dependency type to `provides`
jkowalleck Jan 26, 2024
56e936e
rework dependency type to `provides` (#366)
stevespringett Jan 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
261 changes: 261 additions & 0 deletions schema/bom-1.6.proto
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ enum Classification {
CLASSIFICATION_MACHINE_LEARNING_MODEL = 11;
// A collection of discrete values that convey information.
CLASSIFICATION_DATA = 12;
// Cryptographic asset including algorithms, protocols, certificates, keys, tokens, and secrets.
CLASSIFICATION_CRYPTOGRAPHIC_ASSET = 13;
}

message Commit {
Expand Down Expand Up @@ -137,6 +139,8 @@ message Component {
optional ModelCard modelCard = 25;
// This object SHOULD be specified for any component of type `data` and MUST NOT be specified for other component types.
optional ComponentData data = 26;
// Cryptographic assets have properties that uniquely define them and that make them actionable for further reasoning. As an example, it makes a difference if one knows the algorithm family (e.g. AES) or the specific variant or instantiation (e.g. AES-128-GCM). This is because the security level and the algorithm primitive (authenticated encryption) is only defined by the definition of the algorithm variant. The presence of a weak cryptographic algorithm like SHA1 vs. HMAC-SHA1 also makes a difference.
optional CryptoProperties cryptoProperties = 27;
}

// Specifies the data flow.
Expand Down Expand Up @@ -167,9 +171,16 @@ enum DataFlowDirection {
}

message Dependency {
enum DependencyType {
stevespringett marked this conversation as resolved.
Show resolved Hide resolved
DEPENDENCY_TYPE_IMPLEMENTS = 0;
DEPENDENCY_TYPE_USES = 1;
}
// References a component or service by the its bom-ref attribute
string ref = 1;
// The bom-ref identifiers of the components or services that are dependencies of this dependency object.
repeated Dependency dependencies = 2;
// Defines and characterizes the type of dependency
optional DependencyType type = 3;
}

message Diff {
Expand Down Expand Up @@ -715,6 +726,14 @@ message EvidenceOccurrences {
optional string bom_ref = 1;
// The location or path to where the component was found.
string location = 2;
// The line number where the component was found.
optional int32 line = 3;
// The offset where the component was found.
optional int32 offset = 4;
// The symbol name that was found associated with the component.
optional string symbol = 5;
// Any additional context of the detected component (e.g. a code snippet).
optional string additionalContext = 6;
}

enum EvidenceFieldType {
Expand Down Expand Up @@ -1685,3 +1704,245 @@ message Definition {
}
repeated Standard standards = 1;
}

message CryptoProperties {
enum CryptoAssetType {
CRYPTO_ASSET_TYPE_ALGORITHM = 0;
CRYPTO_ASSET_TYPE_CERTIFICATE = 1;
CRYPTO_ASSET_TYPE_PROTOCOL = 2;
CRYPTO_ASSET_TYPE_RELATED_CRYPTO_MATERIAL = 3;
}
message AlgorithmProperties {
enum CryptoPrimitive {
CRYPTO_PRIMITIVE_DRBG = 0;
CRYPTO_PRIMITIVE_MAC = 1;
CRYPTO_PRIMITIVE_BLOCK_CIPHER = 2;
CRYPTO_PRIMITIVE_STREAM_CIPHER = 3;
CRYPTO_PRIMITIVE_SIGNATURE = 4;
CRYPTO_PRIMITIVE_HASH = 5;
CRYPTO_PRIMITIVE_PKE = 6;
CRYPTO_PRIMITIVE_XOF = 7;
CRYPTO_PRIMITIVE_KDF = 8;
CRYPTO_PRIMITIVE_KEY_AGREE = 9;
CRYPTO_PRIMITIVE_KEM = 10;
CRYPTO_PRIMITIVE_AE = 11;
CRYPTO_PRIMITIVE_COMBINER = 12;
CRYPTO_PRIMITIVE_OTHER = 13;
CRYPTO_PRIMITIVE_UNKNOWN = 14;
}
enum CryptoExecutionEnvironment {
CRYPTO_EXECUTION_ENVIRONMENT_SOFTWARE_PLAIN_RAM = 0;
CRYPTO_EXECUTION_ENVIRONMENT_SOFTWARE_ENCRYPTED_RAM = 1;
CRYPTO_EXECUTION_ENVIRONMENT_SOFTWARE_TEE = 2;
CRYPTO_EXECUTION_ENVIRONMENT_HARDWARE = 3;
CRYPTO_EXECUTION_ENVIRONMENT_OTHER = 4;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the case of other, is there a provision to provide a custom value?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not currently. But perhaps in a future version if there is demand.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bhess your thoughts here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the JSON schema it is currently defined as an enum. I think we considered to externally defining the enums to make them easier extensible, might this be an option for a future version?

CRYPTO_EXECUTION_ENVIRONMENT_UNKNOWN = 5;
}
enum CryptoImplementationPlatform {
CRYPTO_IMPLEMENTATION_PLATFORM_GENERIC = 0;
CRYPTO_IMPLEMENTATION_PLATFORM_X86_32 = 1;
CRYPTO_IMPLEMENTATION_PLATFORM_X86_64 = 2;
CRYPTO_IMPLEMENTATION_PLATFORM_ARMV7A = 3;
CRYPTO_IMPLEMENTATION_PLATFORM_ARMV7M = 4;
CRYPTO_IMPLEMENTATION_PLATFORM_ARMV8A = 5;
CRYPTO_IMPLEMENTATION_PLATFORM_ARMV8M = 6;
CRYPTO_IMPLEMENTATION_PLATFORM_ARMV9A = 7;
CRYPTO_IMPLEMENTATION_PLATFORM_ARMV9M = 8;
CRYPTO_IMPLEMENTATION_PLATFORM_X390X = 9;
CRYPTO_IMPLEMENTATION_PLATFORM_PPC64 = 10;
CRYPTO_IMPLEMENTATION_PLATFORM_PPC64LE = 11;
CRYPTO_IMPLEMENTATION_PLATFORM_OTHER = 12;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same request as above. A place for providing custom value would be nice.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not currently. Let me discuss with with FWG this week.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bhess Your thoughts here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thought as with the executionEnvironment above. I think custom values for implementationPlatform will occur more often as for executionEnvironment.

CRYPTO_IMPLEMENTATION_PLATFORM_UNKNOWN = 13;
}
enum CryptoAlgorithmMode {
CRYPTO_ALGORITHM_MODE_CBC = 0;
CRYPTO_ALGORITHM_MODE_ECB = 1;
CRYPTO_ALGORITHM_MODE_CCM = 2;
CRYPTO_ALGORITHM_MODE_GCM = 3;
CRYPTO_ALGORITHM_MODE_CFB = 4;
CRYPTO_ALGORITHM_MODE_OFB = 5;
CRYPTO_ALGORITHM_MODE_CTR = 6;
CRYPTO_ALGORITHM_MODE_OTHER = 7;
CRYPTO_ALGORITHM_MODE_UNKNOWN = 8;
}
enum CryptoAlgorithmPadding {
CRYPTO_ALGORITHM_PADDING_PKCS5 = 0;
CRYPTO_ALGORITHM_PADDING_PKCS7 = 1;
CRYPTO_ALGORITHM_PADDING_PKCS1V15 = 2;
CRYPTO_ALGORITHM_PADDING_OAEP = 3;
CRYPTO_ALGORITHM_PADDING_RAW = 4;
CRYPTO_ALGORITHM_PADDING_OTHER = 5;
CRYPTO_ALGORITHM_PADDING_UNKNOWN = 6;
}
enum CryptoAlgorithmFunction {
CRYPTO_ALGORITHM_FUNCTION_GENERATE = 0;
CRYPTO_ALGORITHM_FUNCTION_KEYGEN = 1;
CRYPTO_ALGORITHM_FUNCTION_ENCRYPT = 2;
CRYPTO_ALGORITHM_FUNCTION_DECRYPT = 3;
CRYPTO_ALGORITHM_FUNCTION_DIGEST = 4;
CRYPTO_ALGORITHM_FUNCTION_TAG = 5;
CRYPTO_ALGORITHM_FUNCTION_KEYDERIVE = 6;
CRYPTO_ALGORITHM_FUNCTION_SIGN = 7;
CRYPTO_ALGORITHM_FUNCTION_VERIFY = 8;
CRYPTO_ALGORITHM_FUNCTION_ENCAPSULATE = 9;
CRYPTO_ALGORITHM_FUNCTION_DECAPSULATE = 10;
CRYPTO_ALGORITHM_FUNCTION_OTHER = 11;
CRYPTO_ALGORITHM_FUNCTION_UNKNOWN = 12;
}
// Cryptographic building blocks used in higher-level cryptographic systems and protocols. Primitives represent different cryptographic routines: deterministic random bit generators (drbg, e.g. CTR_DRBG from NIST SP800-90A-r1), message authentication codes (mac, e.g. HMAC-SHA-256), blockciphers (e.g. AES), streamciphers (e.g. Salsa20), signatures (e.g. ECDSA), hash functions (e.g. SHA-256), public-key encryption schemes (pke, e.g. RSA), extended output functions (xof, e.g. SHAKE256), key derivation functions (e.g. pbkdf2), key agreement algorithms (e.g. ECDH), key encapsulation mechanisms (e.g. ML-KEM), authenticated encryption (ae, e.g. AES-GCM) and the combination of multiple algorithms (combiner, e.g. SP800-56Cr2).
optional CryptoPrimitive primitive = 1;
// An identifier for the parameter set of the cryptographic algorithm. Examples: in AES128, '128' identifies the key length in bits, in SHA256, '256' identifies the digest length, '128' in SHAKE128 identifies its maximum security level in bits, and 'SHA2-128s' identifies a parameter set used in SLH-DSA (FIPS205).
optional string parameterSetIdentifier = 2;
// The specific underlying Elliptic Curve (EC) definition employed which is an indicator of the level of security strength, performance and complexity. Absent an authoritative source of curve names, CycloneDX recommends use of curve names as defined at [https://neuromancer.sk/std/](https://neuromancer.sk/std/), the source from which can be found at [https://github.com/J08nY/std-curves](https://github.com/J08nY/std-curves).
optional string curve = 3;
// The target and execution environment in which the algorithm is implemented in.
optional CryptoExecutionEnvironment executionEnvironment = 4;
// The target platform for which the algorithm is implemented. The implementation can be 'generic', running on any platform or for a specific platform.
optional CryptoImplementationPlatform implementationPlatform = 5;
// The certification that the implementation of the cryptographic algorithm has received, if any. Certifications include revisions and levels of FIPS 140 or Common Criteria of different Extended Assurance Levels (CC-EAL).
repeated string certificationLevel = 6;
// The mode of operation in which the cryptographic algorithm (block cipher) is used.
optional CryptoAlgorithmMode mode = 7;
// The padding scheme that is used for the cryptographic algorithm.
optional CryptoAlgorithmPadding padding = 8;
// The cryptographic functions implemented by the cryptographic algorithm.
repeated CryptoAlgorithmFunction cryptoFunctions = 9;
// The classical security level that a cryptographic algorithm provides (in bits).
optional int32 classicalSecurityLevel = 10;
// The NIST security strength category as defined in https://csrc.nist.gov/projects/post-quantum-cryptography/post-quantum-cryptography-standardization/evaluation-criteria/security-(evaluation-criteria). A value of 0 indicates that none of the categories are met.
optional int32 nistQuantumSecurityLevel = 11;
} // end of AlgorithmProperties
message CertificateProperties {
// The subject name for the certificate
optional string subjectName = 1;
// The issuer name for the certificate
optional string issuerName = 2;
// The date and time according to ISO-8601 standard from which the certificate is valid
optional google.protobuf.Timestamp notValidBefore = 3;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we include notBefore and notAfter to track both usage and validity? This is consistent with RFC 5280.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.. Will bring this up in FWG meeting this week.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bhess your thoughts here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prabhu you refer to privateKeyUsagePeriod in RFC 5280, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usage then relates to the private key and validity to the certificate. Following RFC 5280, perhaps add privateKeyUsagePeriodNotBefore and privateKeyUsagePeriodNotAfter to be sure this relates to the private key?

// The date and time according to ISO-8601 standard from which the certificate is not valid anymore
optional google.protobuf.Timestamp notValidAfter = 4;
// The bom-ref to signature algorithm used by the certificate
optional string signatureAlgorithmRef = 5;
// The bom-ref to the public key of the subject
optional string subjectPublicKeyRef = 6;
// The format of the certificate. Examples include X.509, PEM, DER, and CVC.
optional string certificateFormat = 7;
// The file extension of the certificate. Examples include crt, pem, cer, der, and p12.
optional string certificateExtension = 8;
} // end of CertificateProperties
message RelatedCryptoMaterialProperties {
enum CryptoRelatedType {
CRYPTO_RELATED_TYPE_PRIVATE_KEY = 0;
CRYPTO_RELATED_TYPE_PUBLIC_KEY = 1;
CRYPTO_RELATED_TYPE_SECRET_KEY = 2;
CRYPTO_RELATED_TYPE_KEY = 3;
CRYPTO_RELATED_TYPE_CIPHERTEXT = 4;
CRYPTO_RELATED_TYPE_SIGNATURE = 5;
CRYPTO_RELATED_TYPE_DIGEST = 6;
CRYPTO_RELATED_TYPE_INITIALIZATION_VECTOR = 7;
CRYPTO_RELATED_TYPE_NONCE = 8;
CRYPTO_RELATED_TYPE_SEED = 9;
CRYPTO_RELATED_TYPE_SALT = 10;
CRYPTO_RELATED_TYPE_SHARED_SECRET = 11;
CRYPTO_RELATED_TYPE_TAG = 12;
CRYPTO_RELATED_TYPE_ADDITIONAL_DATA = 13;
CRYPTO_RELATED_TYPE_PASSWORD = 14;
CRYPTO_RELATED_TYPE_CREDENTIAL = 15;
CRYPTO_RELATED_TYPE_TOKEN = 16;
CRYPTO_RELATED_TYPE_OTHER = 17;
CRYPTO_RELATED_TYPE_UNKNOWN = 18;
}
enum CryptoRelatedState {
CRYPTO_RELATED_STATE_PRE_ACTIVATION = 0;
CRYPTO_RELATED_STATE_ACTIVE = 1;
CRYPTO_RELATED_STATE_SUSPENDED = 2;
CRYPTO_RELATED_STATE_DEACTIVATED = 3;
CRYPTO_RELATED_STATE_COMPROMISED = 4;
CRYPTO_RELATED_STATE_DESTROYED = 5;
}
message CryptoRelatedSecuredBy {
// Specifies the mechanism by which the cryptographic asset is secured by. Examples include HSM, TPM, SGX, Software, and None
optional string mechanism = 1;
// The bom-ref to the algorithm.
optional string algorithmRef = 2;
}
// The type for the related cryptographic material
optional CryptoRelatedType type = 1;
// The optional unique identifier for the related cryptographic material.
optional string id = 2;
// The key state as defined by NIST SP 800-57.
optional CryptoRelatedState state = 3;
// The bom-ref to the algorithm used to generate the related cryptographic material.
optional string algorithmRef = 4;
// The date and time (timestamp) when the related cryptographic material was created.
optional google.protobuf.Timestamp creationDate = 5;
// The date and time (timestamp) when the related cryptographic material was activated.
optional google.protobuf.Timestamp activationDate = 6;
// The date and time (timestamp) when the related cryptographic material was updated.
optional google.protobuf.Timestamp updateDate = 7;
// The date and time (timestamp) when the related cryptographic material expires.
optional google.protobuf.Timestamp expirationDate = 8;
// The associated value of the cryptographic material.
optional string value = 9;
// The size of the cryptographic asset (in bits).
optional int64 size = 10;
// The format of the related cryptographic material (e.g. P8, PEM, DER).
optional string format = 11;
// The mechanism by which the cryptographic asset is secured by.
optional CryptoRelatedSecuredBy securedBy = 12;
} // end of RelatedCryptoMaterialProperties
message ProtocolProperties {
enum CryptoProtocolType {
CRYPTO_PROTOCOL_TYPE_TLS = 0;
CRYPTO_PROTOCOL_TYPE_SSH = 1;
CRYPTO_PROTOCOL_TYPE_IPSEC = 2;
CRYPTO_PROTOCOL_TYPE_IKE = 3;
CRYPTO_PROTOCOL_TYPE_SSTP = 4;
CRYPTO_PROTOCOL_TYPE_WPA = 5;
CRYPTO_PROTOCOL_TYPE_OTHER = 6;
CRYPTO_PROTOCOL_TYPE_UNKNOWN = 7;
}
message CryptoProtocolCipherSuite {
// A common name for the cipher suite. For example: TLS_DHE_RSA_WITH_AES_128_CCM
optional string name = 1;
// A list of algorithms related to the cipher suite. Use the bom-ref to the algorithm cryptographic asset.
repeated string algorithms = 2;
// A list of common identifiers for the cipher suite. For example: 0xC0 and 0x9E
repeated string identifiers = 3;
}
message Ikev2TransformTypes {
// Transform Type 1: encryption algorithms
repeated string encr = 1;
// Transform Type 2: pseudorandom functions
repeated string prf = 2;
// Transform Type 3: integrity algorithms
repeated string integ = 3;
// Transform Type 4: Key Exchange Method (KE) per RFC9370, formerly called Diffie-Hellman Group (D-H)
repeated string ke = 4;
// Specifies if an Extended Sequence Number (ESN) is used.
optional bool esn = 5;
// IKEv2 Authentication method
repeated string auth = 6;
}
// The concrete protocol type.
optional CryptoProtocolType type = 1;
// The version of the protocol. Examples include 1.0, 1.2, and 1.99.
optional string version = 2;
// A list of cipher suites related to the protocol.
repeated CryptoProtocolCipherSuite cipherSuites = 3;
// The IKEv2 transform types supported (types 1-4), defined in RFC7296 section 3.3.2, and additional properties.
optional Ikev2TransformTypes ikev2TransformTypes = 4;
} // end of ProtocolProperties
// 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.
optional CryptoAssetType assetType = 1;
// Additional properties specific to a cryptographic algorithm.
optional AlgorithmProperties algorithmProperties = 2;
// Properties for cryptographic assets of asset type 'certificate'
optional CertificateProperties certificateProperties = 3;
// Properties for cryptographic assets of asset type: `related-crypto-material`
optional RelatedCryptoMaterialProperties relatedCryptoMaterialProperties = 4;
// Properties specific to cryptographic assets of type: `protocol`.
optional ProtocolProperties protocolProperties = 5;
// The object identifier (OID) of the cryptographic asset.
optional string oid = 6;
}
Loading