Skip to content

Commit c6acc8d

Browse files
1.6 dev cbom (#347)
specific goals: - fixes #171 - fixes #291 task list for spec enhacement - [x] schema: JSON - [x] schema: XML - [x] schema: protobuff - [x] examples/test cases
2 parents 63e48c4 + 56e936e commit c6acc8d

9 files changed

+2599
-4
lines changed

schema/bom-1.6.proto

Lines changed: 257 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ enum Classification {
7171
CLASSIFICATION_MACHINE_LEARNING_MODEL = 11;
7272
// A collection of discrete values that convey information.
7373
CLASSIFICATION_DATA = 12;
74+
// Cryptographic asset including algorithms, protocols, certificates, keys, tokens, and secrets.
75+
CLASSIFICATION_CRYPTOGRAPHIC_ASSET = 13;
7476
}
7577

7678
message Commit {
@@ -137,6 +139,8 @@ message Component {
137139
optional ModelCard modelCard = 25;
138140
// This object SHOULD be specified for any component of type `data` and MUST NOT be specified for other component types.
139141
optional ComponentData data = 26;
142+
// 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.
143+
optional CryptoProperties cryptoProperties = 27;
140144
}
141145

142146
// Specifies the data flow.
@@ -169,7 +173,10 @@ enum DataFlowDirection {
169173
message Dependency {
170174
// References a component or service by the its bom-ref attribute
171175
string ref = 1;
176+
// The bom-ref identifiers of the components or services that are dependencies of this dependency object.
172177
repeated Dependency dependencies = 2;
178+
// The bom-ref identifiers of the components or services that define a given specification or standard, which are provided or implemented by this dependency object.
179+
repeated string provides = 3;
173180
}
174181

175182
message Diff {
@@ -715,6 +722,14 @@ message EvidenceOccurrences {
715722
optional string bom_ref = 1;
716723
// The location or path to where the component was found.
717724
string location = 2;
725+
// The line number where the component was found.
726+
optional int32 line = 3;
727+
// The offset where the component was found.
728+
optional int32 offset = 4;
729+
// The symbol name that was found associated with the component.
730+
optional string symbol = 5;
731+
// Any additional context of the detected component (e.g. a code snippet).
732+
optional string additionalContext = 6;
718733
}
719734

720735
enum EvidenceFieldType {
@@ -1685,3 +1700,245 @@ message Definition {
16851700
}
16861701
repeated Standard standards = 1;
16871702
}
1703+
1704+
message CryptoProperties {
1705+
enum CryptoAssetType {
1706+
CRYPTO_ASSET_TYPE_ALGORITHM = 0;
1707+
CRYPTO_ASSET_TYPE_CERTIFICATE = 1;
1708+
CRYPTO_ASSET_TYPE_PROTOCOL = 2;
1709+
CRYPTO_ASSET_TYPE_RELATED_CRYPTO_MATERIAL = 3;
1710+
}
1711+
message AlgorithmProperties {
1712+
enum CryptoPrimitive {
1713+
CRYPTO_PRIMITIVE_DRBG = 0;
1714+
CRYPTO_PRIMITIVE_MAC = 1;
1715+
CRYPTO_PRIMITIVE_BLOCK_CIPHER = 2;
1716+
CRYPTO_PRIMITIVE_STREAM_CIPHER = 3;
1717+
CRYPTO_PRIMITIVE_SIGNATURE = 4;
1718+
CRYPTO_PRIMITIVE_HASH = 5;
1719+
CRYPTO_PRIMITIVE_PKE = 6;
1720+
CRYPTO_PRIMITIVE_XOF = 7;
1721+
CRYPTO_PRIMITIVE_KDF = 8;
1722+
CRYPTO_PRIMITIVE_KEY_AGREE = 9;
1723+
CRYPTO_PRIMITIVE_KEM = 10;
1724+
CRYPTO_PRIMITIVE_AE = 11;
1725+
CRYPTO_PRIMITIVE_COMBINER = 12;
1726+
CRYPTO_PRIMITIVE_OTHER = 13;
1727+
CRYPTO_PRIMITIVE_UNKNOWN = 14;
1728+
}
1729+
enum CryptoExecutionEnvironment {
1730+
CRYPTO_EXECUTION_ENVIRONMENT_SOFTWARE_PLAIN_RAM = 0;
1731+
CRYPTO_EXECUTION_ENVIRONMENT_SOFTWARE_ENCRYPTED_RAM = 1;
1732+
CRYPTO_EXECUTION_ENVIRONMENT_SOFTWARE_TEE = 2;
1733+
CRYPTO_EXECUTION_ENVIRONMENT_HARDWARE = 3;
1734+
CRYPTO_EXECUTION_ENVIRONMENT_OTHER = 4;
1735+
CRYPTO_EXECUTION_ENVIRONMENT_UNKNOWN = 5;
1736+
}
1737+
enum CryptoImplementationPlatform {
1738+
CRYPTO_IMPLEMENTATION_PLATFORM_GENERIC = 0;
1739+
CRYPTO_IMPLEMENTATION_PLATFORM_X86_32 = 1;
1740+
CRYPTO_IMPLEMENTATION_PLATFORM_X86_64 = 2;
1741+
CRYPTO_IMPLEMENTATION_PLATFORM_ARMV7A = 3;
1742+
CRYPTO_IMPLEMENTATION_PLATFORM_ARMV7M = 4;
1743+
CRYPTO_IMPLEMENTATION_PLATFORM_ARMV8A = 5;
1744+
CRYPTO_IMPLEMENTATION_PLATFORM_ARMV8M = 6;
1745+
CRYPTO_IMPLEMENTATION_PLATFORM_ARMV9A = 7;
1746+
CRYPTO_IMPLEMENTATION_PLATFORM_ARMV9M = 8;
1747+
CRYPTO_IMPLEMENTATION_PLATFORM_X390X = 9;
1748+
CRYPTO_IMPLEMENTATION_PLATFORM_PPC64 = 10;
1749+
CRYPTO_IMPLEMENTATION_PLATFORM_PPC64LE = 11;
1750+
CRYPTO_IMPLEMENTATION_PLATFORM_OTHER = 12;
1751+
CRYPTO_IMPLEMENTATION_PLATFORM_UNKNOWN = 13;
1752+
}
1753+
enum CryptoAlgorithmMode {
1754+
CRYPTO_ALGORITHM_MODE_CBC = 0;
1755+
CRYPTO_ALGORITHM_MODE_ECB = 1;
1756+
CRYPTO_ALGORITHM_MODE_CCM = 2;
1757+
CRYPTO_ALGORITHM_MODE_GCM = 3;
1758+
CRYPTO_ALGORITHM_MODE_CFB = 4;
1759+
CRYPTO_ALGORITHM_MODE_OFB = 5;
1760+
CRYPTO_ALGORITHM_MODE_CTR = 6;
1761+
CRYPTO_ALGORITHM_MODE_OTHER = 7;
1762+
CRYPTO_ALGORITHM_MODE_UNKNOWN = 8;
1763+
}
1764+
enum CryptoAlgorithmPadding {
1765+
CRYPTO_ALGORITHM_PADDING_PKCS5 = 0;
1766+
CRYPTO_ALGORITHM_PADDING_PKCS7 = 1;
1767+
CRYPTO_ALGORITHM_PADDING_PKCS1V15 = 2;
1768+
CRYPTO_ALGORITHM_PADDING_OAEP = 3;
1769+
CRYPTO_ALGORITHM_PADDING_RAW = 4;
1770+
CRYPTO_ALGORITHM_PADDING_OTHER = 5;
1771+
CRYPTO_ALGORITHM_PADDING_UNKNOWN = 6;
1772+
}
1773+
enum CryptoAlgorithmFunction {
1774+
CRYPTO_ALGORITHM_FUNCTION_GENERATE = 0;
1775+
CRYPTO_ALGORITHM_FUNCTION_KEYGEN = 1;
1776+
CRYPTO_ALGORITHM_FUNCTION_ENCRYPT = 2;
1777+
CRYPTO_ALGORITHM_FUNCTION_DECRYPT = 3;
1778+
CRYPTO_ALGORITHM_FUNCTION_DIGEST = 4;
1779+
CRYPTO_ALGORITHM_FUNCTION_TAG = 5;
1780+
CRYPTO_ALGORITHM_FUNCTION_KEYDERIVE = 6;
1781+
CRYPTO_ALGORITHM_FUNCTION_SIGN = 7;
1782+
CRYPTO_ALGORITHM_FUNCTION_VERIFY = 8;
1783+
CRYPTO_ALGORITHM_FUNCTION_ENCAPSULATE = 9;
1784+
CRYPTO_ALGORITHM_FUNCTION_DECAPSULATE = 10;
1785+
CRYPTO_ALGORITHM_FUNCTION_OTHER = 11;
1786+
CRYPTO_ALGORITHM_FUNCTION_UNKNOWN = 12;
1787+
}
1788+
// 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).
1789+
optional CryptoPrimitive primitive = 1;
1790+
// 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).
1791+
optional string parameterSetIdentifier = 2;
1792+
// 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).
1793+
optional string curve = 3;
1794+
// The target and execution environment in which the algorithm is implemented in.
1795+
optional CryptoExecutionEnvironment executionEnvironment = 4;
1796+
// The target platform for which the algorithm is implemented. The implementation can be 'generic', running on any platform or for a specific platform.
1797+
optional CryptoImplementationPlatform implementationPlatform = 5;
1798+
// 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).
1799+
repeated string certificationLevel = 6;
1800+
// The mode of operation in which the cryptographic algorithm (block cipher) is used.
1801+
optional CryptoAlgorithmMode mode = 7;
1802+
// The padding scheme that is used for the cryptographic algorithm.
1803+
optional CryptoAlgorithmPadding padding = 8;
1804+
// The cryptographic functions implemented by the cryptographic algorithm.
1805+
repeated CryptoAlgorithmFunction cryptoFunctions = 9;
1806+
// The classical security level that a cryptographic algorithm provides (in bits).
1807+
optional int32 classicalSecurityLevel = 10;
1808+
// 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.
1809+
optional int32 nistQuantumSecurityLevel = 11;
1810+
} // end of AlgorithmProperties
1811+
message CertificateProperties {
1812+
// The subject name for the certificate
1813+
optional string subjectName = 1;
1814+
// The issuer name for the certificate
1815+
optional string issuerName = 2;
1816+
// The date and time according to ISO-8601 standard from which the certificate is valid
1817+
optional google.protobuf.Timestamp notValidBefore = 3;
1818+
// The date and time according to ISO-8601 standard from which the certificate is not valid anymore
1819+
optional google.protobuf.Timestamp notValidAfter = 4;
1820+
// The bom-ref to signature algorithm used by the certificate
1821+
optional string signatureAlgorithmRef = 5;
1822+
// The bom-ref to the public key of the subject
1823+
optional string subjectPublicKeyRef = 6;
1824+
// The format of the certificate. Examples include X.509, PEM, DER, and CVC.
1825+
optional string certificateFormat = 7;
1826+
// The file extension of the certificate. Examples include crt, pem, cer, der, and p12.
1827+
optional string certificateExtension = 8;
1828+
} // end of CertificateProperties
1829+
message RelatedCryptoMaterialProperties {
1830+
enum CryptoRelatedType {
1831+
CRYPTO_RELATED_TYPE_PRIVATE_KEY = 0;
1832+
CRYPTO_RELATED_TYPE_PUBLIC_KEY = 1;
1833+
CRYPTO_RELATED_TYPE_SECRET_KEY = 2;
1834+
CRYPTO_RELATED_TYPE_KEY = 3;
1835+
CRYPTO_RELATED_TYPE_CIPHERTEXT = 4;
1836+
CRYPTO_RELATED_TYPE_SIGNATURE = 5;
1837+
CRYPTO_RELATED_TYPE_DIGEST = 6;
1838+
CRYPTO_RELATED_TYPE_INITIALIZATION_VECTOR = 7;
1839+
CRYPTO_RELATED_TYPE_NONCE = 8;
1840+
CRYPTO_RELATED_TYPE_SEED = 9;
1841+
CRYPTO_RELATED_TYPE_SALT = 10;
1842+
CRYPTO_RELATED_TYPE_SHARED_SECRET = 11;
1843+
CRYPTO_RELATED_TYPE_TAG = 12;
1844+
CRYPTO_RELATED_TYPE_ADDITIONAL_DATA = 13;
1845+
CRYPTO_RELATED_TYPE_PASSWORD = 14;
1846+
CRYPTO_RELATED_TYPE_CREDENTIAL = 15;
1847+
CRYPTO_RELATED_TYPE_TOKEN = 16;
1848+
CRYPTO_RELATED_TYPE_OTHER = 17;
1849+
CRYPTO_RELATED_TYPE_UNKNOWN = 18;
1850+
}
1851+
enum CryptoRelatedState {
1852+
CRYPTO_RELATED_STATE_PRE_ACTIVATION = 0;
1853+
CRYPTO_RELATED_STATE_ACTIVE = 1;
1854+
CRYPTO_RELATED_STATE_SUSPENDED = 2;
1855+
CRYPTO_RELATED_STATE_DEACTIVATED = 3;
1856+
CRYPTO_RELATED_STATE_COMPROMISED = 4;
1857+
CRYPTO_RELATED_STATE_DESTROYED = 5;
1858+
}
1859+
message CryptoRelatedSecuredBy {
1860+
// Specifies the mechanism by which the cryptographic asset is secured by. Examples include HSM, TPM, SGX, Software, and None
1861+
optional string mechanism = 1;
1862+
// The bom-ref to the algorithm.
1863+
optional string algorithmRef = 2;
1864+
}
1865+
// The type for the related cryptographic material
1866+
optional CryptoRelatedType type = 1;
1867+
// The optional unique identifier for the related cryptographic material.
1868+
optional string id = 2;
1869+
// The key state as defined by NIST SP 800-57.
1870+
optional CryptoRelatedState state = 3;
1871+
// The bom-ref to the algorithm used to generate the related cryptographic material.
1872+
optional string algorithmRef = 4;
1873+
// The date and time (timestamp) when the related cryptographic material was created.
1874+
optional google.protobuf.Timestamp creationDate = 5;
1875+
// The date and time (timestamp) when the related cryptographic material was activated.
1876+
optional google.protobuf.Timestamp activationDate = 6;
1877+
// The date and time (timestamp) when the related cryptographic material was updated.
1878+
optional google.protobuf.Timestamp updateDate = 7;
1879+
// The date and time (timestamp) when the related cryptographic material expires.
1880+
optional google.protobuf.Timestamp expirationDate = 8;
1881+
// The associated value of the cryptographic material.
1882+
optional string value = 9;
1883+
// The size of the cryptographic asset (in bits).
1884+
optional int64 size = 10;
1885+
// The format of the related cryptographic material (e.g. P8, PEM, DER).
1886+
optional string format = 11;
1887+
// The mechanism by which the cryptographic asset is secured by.
1888+
optional CryptoRelatedSecuredBy securedBy = 12;
1889+
} // end of RelatedCryptoMaterialProperties
1890+
message ProtocolProperties {
1891+
enum CryptoProtocolType {
1892+
CRYPTO_PROTOCOL_TYPE_TLS = 0;
1893+
CRYPTO_PROTOCOL_TYPE_SSH = 1;
1894+
CRYPTO_PROTOCOL_TYPE_IPSEC = 2;
1895+
CRYPTO_PROTOCOL_TYPE_IKE = 3;
1896+
CRYPTO_PROTOCOL_TYPE_SSTP = 4;
1897+
CRYPTO_PROTOCOL_TYPE_WPA = 5;
1898+
CRYPTO_PROTOCOL_TYPE_OTHER = 6;
1899+
CRYPTO_PROTOCOL_TYPE_UNKNOWN = 7;
1900+
}
1901+
message CryptoProtocolCipherSuite {
1902+
// A common name for the cipher suite. For example: TLS_DHE_RSA_WITH_AES_128_CCM
1903+
optional string name = 1;
1904+
// A list of algorithms related to the cipher suite. Use the bom-ref to the algorithm cryptographic asset.
1905+
repeated string algorithms = 2;
1906+
// A list of common identifiers for the cipher suite. For example: 0xC0 and 0x9E
1907+
repeated string identifiers = 3;
1908+
}
1909+
message Ikev2TransformTypes {
1910+
// Transform Type 1: encryption algorithms
1911+
repeated string encr = 1;
1912+
// Transform Type 2: pseudorandom functions
1913+
repeated string prf = 2;
1914+
// Transform Type 3: integrity algorithms
1915+
repeated string integ = 3;
1916+
// Transform Type 4: Key Exchange Method (KE) per RFC9370, formerly called Diffie-Hellman Group (D-H)
1917+
repeated string ke = 4;
1918+
// Specifies if an Extended Sequence Number (ESN) is used.
1919+
optional bool esn = 5;
1920+
// IKEv2 Authentication method
1921+
repeated string auth = 6;
1922+
}
1923+
// The concrete protocol type.
1924+
optional CryptoProtocolType type = 1;
1925+
// The version of the protocol. Examples include 1.0, 1.2, and 1.99.
1926+
optional string version = 2;
1927+
// A list of cipher suites related to the protocol.
1928+
repeated CryptoProtocolCipherSuite cipherSuites = 3;
1929+
// The IKEv2 transform types supported (types 1-4), defined in RFC7296 section 3.3.2, and additional properties.
1930+
optional Ikev2TransformTypes ikev2TransformTypes = 4;
1931+
} // end of ProtocolProperties
1932+
// 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.
1933+
optional CryptoAssetType assetType = 1;
1934+
// Additional properties specific to a cryptographic algorithm.
1935+
optional AlgorithmProperties algorithmProperties = 2;
1936+
// Properties for cryptographic assets of asset type 'certificate'
1937+
optional CertificateProperties certificateProperties = 3;
1938+
// Properties for cryptographic assets of asset type: `related-crypto-material`
1939+
optional RelatedCryptoMaterialProperties relatedCryptoMaterialProperties = 4;
1940+
// Properties specific to cryptographic assets of type: `protocol`.
1941+
optional ProtocolProperties protocolProperties = 5;
1942+
// The object identifier (OID) of the cryptographic asset.
1943+
optional string oid = 6;
1944+
}

0 commit comments

Comments
 (0)