OpenSSF "Security" section
we need to document the following sections, with the minimal amount of effort required to meet the ask at https://www.bestpractices.dev/en/projects/9937#security
Secure development knowledge
- [x] The project MUST have at least one primary developer who knows how to design secure software. (See ‘details’ for the exact requirements.) [know_secure_design]
- [x] At least one of the project's primary developers MUST know of common kinds of errors that lead to vulnerabilities in this kind of software, as well as at least one method to counter or mitigate each of them. [know_common_errors]
Use basic good cryptographic practices
Note that some software does not need to use cryptographic mechanisms. If your project produces software that (1) includes, activates, or enables encryption functionality, and (2) might be released from the United States (US) to outside the US or to a non-US-citizen, you may be legally required to take a few extra steps. Typically this just involves sending an email. For more information, see the encryption section of Understanding Open Source Technology & US Export Controls.
- [ ] The software produced by the project MUST use, by default, only cryptographic protocols and algorithms that are publicly published and reviewed by experts (if cryptographic protocols and algorithms are used). [crypto_published]
- [ ] If the software produced by the project is an application or library, and its primary purpose is not to implement cryptography, then it SHOULD only call on software specifically designed to implement cryptographic functions; it SHOULD NOT re-implement its own. [crypto_call]
- [ ] All functionality in the software produced by the project that depends on cryptography MUST be implementable using FLOSS. [crypto_floss]
- [ ] The security mechanisms within the software produced by the project MUST use default keylengths that at least meet the NIST minimum requirements through the year 2030 (as stated in 2012). It MUST be possible to configure the software so that smaller keylengths are completely disabled. [crypto_keylength]
- [ ] The default security mechanisms within the software produced by the project MUST NOT depend on broken cryptographic algorithms (e.g., MD4, MD5, single DES, RC4, Dual_EC_DRBG), or use cipher modes that are inappropriate to the context, unless they are necessary to implement an interoperable protocol (where the protocol implemented is the most recent version of that standard broadly supported by the network ecosystem, that ecosystem requires the use of such an algorithm or mode, and that ecosystem does not offer any more secure alternative). The documentation MUST describe any relevant security risks and any known mitigations if these broken algorithms or modes are necessary for an interoperable protocol. [crypto_working]
- [ ] The default security mechanisms within the software produced by the project SHOULD NOT depend on cryptographic algorithms or modes with known serious weaknesses (e.g., the SHA-1 cryptographic hash algorithm or the CBC mode in SSH). [crypto_weaknesses]
- [ ] The security mechanisms within the software produced by the project SHOULD implement perfect forward secrecy for key agreement protocols so a session key derived from a set of long-term keys cannot be compromised if one of the long-term keys is compromised in the future. [crypto_pfs]
- [ ] If the software produced by the project causes the storing of passwords for authentication of external users, the passwords MUST be stored as iterated hashes with a per-user salt by using a key stretching (iterated) algorithm (e.g., Argon2id, Bcrypt, Scrypt, or PBKDF2). See also OWASP Password Storage Cheat Sheet. [crypto_password_storage]
- [ ] The security mechanisms within the software produced by the project MUST generate all cryptographic keys and nonces using a cryptographically secure random number generator, and MUST NOT do so using generators that are cryptographically insecure. [crypto_random]
Secured delivery against man-in-the-middle (MITM) attacks
- [ ] The project MUST use a delivery mechanism that counters MITM attacks. Using https or ssh+scp is acceptable. [delivery_mitm]
- [ ] A cryptographic hash (e.g., a sha1sum) MUST NOT be retrieved over http and used without checking for a cryptographic signature. [delivery_unsigned]
Publicly known vulnerabilities fixed
- [ ] There MUST be no unpatched vulnerabilities of medium or higher severity that have been publicly known for more than 60 days. [vulnerabilities_fixed_60_days]
- [ ] Projects SHOULD fix all critical vulnerabilities rapidly after they are reported. [vulnerabilities_critical_fixed] Other security issues
- [ ] The public repositories MUST NOT leak a valid private credential (e.g., a working password or private key) that is intended to limit public access. [no_leaked_credentials]
The project MUST have at least one primary developer who knows how to design secure software. (See ‘details’ for the exact requirements.) [know_secure_design]
According to the definition for know_secure_design in the best practice, we can designate the approves in OWNERS file as "primary developer"(s).
https://github.com/kubeflow/model-registry/blob/46d4c020ded8a02eedfa0c0c454164c7829c4a20/OWNERS#L1-L8
The approvers in OWNERS file for the repo (<https://github.com/kubeflow/model-registry/blob/46d4c020ded8a02eedfa0c0c454164c7829c4a20/OWNERS#L1-L8>) match the definition of "primary developer" presented here. Then, at least one "primary developer" has also successfully completed "LFD121: Developing Secure Software" as indicated by this requirement, and at least two "primary developer"(s) have _also_ completed analogous courses on "Secure Software Development" as part of their employment contracts.
At least one "primary developer" has also successfully completed "LFD121: Developing Secure Software":
-
LF9944pxmkbx
at least two "primary developer"(s) have also completed analogous courses on "Secure Software Development" as part of their employment contract:
- https://github.com/kubeflow/model-registry/blob/46d4c020ded8a02eedfa0c0c454164c7829c4a20/OWNERS#L4
- https://github.com/kubeflow/model-registry/blob/46d4c020ded8a02eedfa0c0c454164c7829c4a20/OWNERS#L5
At least one of the project's primary developers MUST know of common kinds of errors that lead to vulnerabilities in this kind of software, as well as at least one method to counter or mitigate each of them. [know_common_errors]
As above
If your project produces software that (1) includes, activates, or enables encryption functionality, and (2) might be released from the United States (US) to outside the US or to a non-US-citizen, you may be legally required to take a few extra steps. Typically this just involves sending an email. For more information, see the encryption section of Understanding Open Source Technology & US Export Controls.
following the requirements for the badge, since we just use standard cryptographic libraries for secure communications and we do NOT (re)implement cryptography, there are no special requirements we need to follow-up on:
Projects that use encryption
As of 2021, if an open source project uses standard cryptography, there are no additional requirements or analysis required.
The software produced by the project MUST use, by default, only cryptographic protocols and algorithms that are publicly published and reviewed by experts (if cryptographic protocols and algorithms are used). [crypto_published] These cryptographic criteria do not always apply because some software has no need to directly use cryptographic capabilities.
Being a cloud-native project, the Model Registry can be deployed leveraging standard Kubernetes projects that ensure secure communications (e.g.: Istio) as it's the case for Kubeflow.
The software relies on standard TLS/SSL coming from the standard library or common FOSS libraries where applicable.
For example the MR Py client uses the standard TLS/SSL wrapper for socket objects <https://github.com/kubeflow/model-registry/blob/46d4c020ded8a02eedfa0c0c454164c7829c4a20/clients/python/src/mr_openapi/rest.py#L14> to be passed to the common `aiohttp` REST client.
For another example, the Go REST client uses the standard `http.Client` <https://github.com/kubeflow/model-registry/blob/46d4c020ded8a02eedfa0c0c454164c7829c4a20/pkg/openapi/configuration.go#L85> which can accept `http.Transport` being `tls.Config`.
For another example, here is the list of uses (in Go) of the crypto(TLS) [standard library](https://pkg.go.dev/crypto/tls):
https://github.com/search?q=repo%3Akubeflow%2Fmodel-registry%20crypto%2Ftls&type=code
The project does not write/implement its own cryptography algorithms.
If the software produced by the project is an application or library, and its primary purpose is not to implement cryptography, then it SHOULD only call on software specifically designed to implement cryptographic functions; it SHOULD NOT re-implement its own. [crypto_call]
As above.
All functionality in the software produced by the project that depends on cryptography MUST be implementable using FLOSS. [crypto_floss] See the Open Standards Requirement for Software by the Open Source Initiative.
As above.
The security mechanisms within the software produced by the project MUST use default keylengths that at least meet the NIST minimum requirements through the year 2030 (as stated in 2012). It MUST be possible to configure the software so that smaller keylengths are completely disabled. [crypto_keylength] These minimum bitlengths are: symmetric key 112, factoring modulus 2048, discrete logarithm key 224, discrete logarithmic group 2048, elliptic curve 224, and hash 224 (password hashing is not covered by this bitlength, more information on password hashing can be found in the crypto_password_storage criterion). See https://www.keylength.com/ for a comparison of keylength recommendations from various organizations. The software MAY allow smaller keylengths in some configurations (ideally it would not, since this allows downgrade attacks, but shorter keylengths are sometimes necessary for interoperability).
As above.
The default security mechanisms within the software produced by the project MUST NOT depend on broken cryptographic algorithms (e.g., MD4, MD5, single DES, RC4, Dual_EC_DRBG), or use cipher modes that are inappropriate to the context, unless they are necessary to implement an interoperable protocol (where the protocol implemented is the most recent version of that standard broadly supported by the network ecosystem, that ecosystem requires the use of such an algorithm or mode, and that ecosystem does not offer any more secure alternative). The documentation MUST describe any relevant security risks and any known mitigations if these broken algorithms or modes are necessary for an interoperable protocol. [crypto_working] ECB mode is almost never appropriate because it reveals identical blocks within the ciphertext as demonstrated by the ECB penguin, and CTR mode is often inappropriate because it does not perform authentication and causes duplicates if the input state is repeated. In many cases it's best to choose a block cipher algorithm mode designed to combine secrecy and authentication, e.g., Galois/Counter Mode (GCM) and EAX. Projects MAY allow users to enable broken mechanisms (e.g., during configuration) where necessary for compatibility, but then users know they're doing it.
As above.
The default security mechanisms within the software produced by the project SHOULD NOT depend on cryptographic algorithms or modes with known serious weaknesses (e.g., the SHA-1 cryptographic hash algorithm or the CBC mode in SSH). [crypto_weaknesses] Concerns about CBC mode in SSH are discussed in CERT: SSH CBC vulnerability.
As above.
If the software produced by the project causes the storing of passwords for authentication of external users, the passwords MUST be stored as iterated hashes with a per-user salt by using a key stretching (iterated) algorithm (e.g., Argon2id, Bcrypt, Scrypt, or PBKDF2). See also OWASP Password Storage Cheat Sheet. [crypto_password_storage] This criterion applies only when the software is enforcing authentication of users using passwords for external users (aka inbound authentication), such as server-side web applications. It does not apply in cases where the software stores passwords for authenticating into other systems (aka outbound authentication, e.g., the software implements a client for some other system), since at least parts of that software must have often access to the unhashed password.
As above. For example, as part of the Kubeflow Platform, this is realized through DEX integration.
The security mechanisms within the software produced by the project MUST generate all cryptographic keys and nonces using a cryptographically secure random number generator, and MUST NOT do so using generators that are cryptographically insecure. [crypto_random] A cryptographically secure random number generator may be a hardware random number generator, or it may be a cryptographically secure pseudo-random number generator (CSPRNG) using an algorithm such as Hash_DRBG, HMAC_DRBG, CTR_DRBG, Yarrow, or Fortuna. Examples of calls to secure random number generators include Java's java.security.SecureRandom and JavaScript's window.crypto.getRandomValues. Examples of calls to insecure random number generators include Java's java.util.Random and JavaScript's Math.random
As above.
For the record, here's a list of uses (in go) of the crypto(TLS) standard library: https://github.com/search?q=repo%3Akubeflow%2Fmodel-registry%20crypto%2Ftls&type=code
Secured delivery against man-in-the-middle (MITM) attacks
The project MUST use a delivery mechanism that counters MITM attacks. Using https or ssh+scp is acceptable. [delivery_mitm]
we distribute sources (including manifests) via github which is https or git via ssh keys by default.
we distribute docker/container images via the secure ghcr.io container registry.
A cryptographic hash (e.g., a sha1sum) MUST NOT be retrieved over http and used without checking for a cryptographic signature
requirement is met through the delivery mechanism and distribution channels highlighted in the point above.
Publicly known vulnerabilities fixed
There MUST be no unpatched vulnerabilities of medium or higher severity that have been publicly known for more than 60 days. [vulnerabilities_fixed_60_days]
no public vulnerability reported, this requirement is met since there is no outstanding patches required.
Projects SHOULD fix all critical vulnerabilities rapidly after they are reported. [vulnerabilities_critical_fixed]
no critical vulnerabilities reported, this requirement is met since there is no outstanding patches required.
Other security issues
The public repositories MUST NOT leak a valid private credential (e.g., a working password or private key) that is intended to limit public access. [no_leaked_credentials] A project MAY leak "sample" credentials for testing and unimportant databases, as long as they are not intended to limit public access.
no private credentials is leaked through the public repository, this requirement is met.
we clearly mark "sample" credentials for testing accordingly.
Note: adding to question 1 in "Use basic" block the "The project does not write/implement its own cryptography algorithms."
Note: adding to "Use basic" block a number of "As above", since subsequent questions pertains to what is the described to question 1 in that block
section is complete; if you are reading this message and you'd like to submit changes to this badge section, don't hesitate to reopen this ticket or a new one