Repository navigation
ECCG external policy - #330
FotiosBistas wants to merge 1 commit into
Conversation
Signed-off-by: Fotios Bistas <[email protected]>
|
Hi @FotiosBistas,
Yes, that's the point of the CBOM. If constructed correctly it contains all algorithm parameters including hash size.
I'm working on a branch (not uploaded yet) that allows the configuration of an ext. compliance service (opa) in
Not sure. I think service profiles were meant for this. I should be easy to start the CBOMkit containers with or without an external compliance service. |
|
Hi @san-zrl, It looks like most of the integration work is already being handled on your side, so my contribution would mainly focus on the ECCG REGO policy itself. Would it make sense for me to rename this pull request to something like “OPA support for ECCG”? As far I understand there will be no need for me to write the REGO rules for the Quantum Safe policy aswell. Also, is there anything specific you’d like me to implement or focus on at this stage? |
|
Hi @FotiosBistas - Yes, you can rename the PR. With the code, I will also provide a quantum-safe policy that behaves as our internal hard-coded version. When published you can use it as starting point for the ECCG policy. Thanks again for your contributions and your commitment! |
|
Hey @san-zrl , I don't if this the appropriate place to ask this. If not, sorry in advance. I have the following code: # -------------------------
# pyca/cryptography
# -------------------------
def cryptography_aes_examples():
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
key64 = b"01234567"
key128 = b"0123456789abcdef"
key192 = b"0123456789abcdef01234567"
key256 = b"0123456789abcdef0123456789abcdef"
iv = b"1234567890abcdef"
nonce = b"123456789012"
data = b"hello world!!!!!"
# AES-CBC (invalid 64-bit key — should fail at runtime, but useful for static detection testing)
algo_small = algorithms.AES(key64)
c_small = Cipher(algo_small, modes.CBC(iv))
encryptor_small = c_small.encryptor()
ct_small = encryptor_small.update(data) + encryptor_small.finalize()
# AES-CBC (128-bit)
algo_128 = algorithms.AES(key128)
c_128 = Cipher(algo_128, modes.CBC(iv))
encryptor_128 = c_128.encryptor()
ct_128 = encryptor_128.update(data) + encryptor_128.finalize()
# AES-CBC (192-bit)
algo_192 = algorithms.AES(key192)
c_192 = Cipher(algo_192, modes.CBC(iv))
encryptor_192 = c_192.encryptor()
ct_192 = encryptor_192.update(data) + encryptor_192.finalize()
# AES-CBC (256-bit)
algo_256 = algorithms.AES(key256)
c_256 = Cipher(algo_256, modes.CBC(iv))
encryptor_256 = c_256.encryptor()
ct_256 = encryptor_256.update(data) + encryptor_256.finalize()After scanning the CBOM seems to produce the following output: "type": "cryptographic-asset",
"bom-ref": "132e7ce1-279f-497f-8118-c75e3f594949",
"name": "AES-CBC",
"evidence": {
"occurrences": [
{
"location": "configs/symmetric-atomic-primitives/tests/aes.py",
"line": 65,
"offset": 14,
"additionalContext": "Cipher"
},
{
"location": "configs/symmetric-atomic-primitives/tests/aes.py",
"line": 71,
"offset": 12,
"additionalContext": "Cipher"
},
{
"location": "configs/symmetric-atomic-primitives/tests/aes.py",
"line": 77,
"offset": 12,
"additionalContext": "Cipher"
},
{
"location": "configs/symmetric-atomic-primitives/tests/aes.py",
"line": 83,
"offset": 12,
"additionalContext": "Cipher"
},
{
"location": "configs/symmetric-atomic-primitives/tests/aes.py",
"line": 90,
"offset": 8,
"additionalContext": "Cipher"
},
{
"location": "configs/symmetric-atomic-primitives/tests/aes.py",
"line": 107,
"offset": 9,
"additionalContext": "Cipher"
},
{
"location": "configs/symmetric-atomic-primitives/tests/aes_key_length.py",
"line": 107,
"offset": 8,
"additionalContext": "Cipher"
},
{
"location": "configs/symmetric-atomic-primitives/tests/aes_key_length.py",
"line": 133,
"offset": 8,
"additionalContext": "Cipher"
},
{
"location": "configs/symmetric-atomic-primitives/tests/aes_key_length.py",
"line": 164,
"offset": 8,
"additionalContext": "Cipher"
}
]
},
"cryptoProperties": {
"assetType": "algorithm",
"algorithmProperties": {
"primitive": "block-cipher",
"parameterSetIdentifier": "128",
"mode": "cbc",
"cryptoFunctions": [
"encrypt"
]
},
"oid": "2.16.840.1.101.3.4.1"
}
},From what I understand, I should use the parameter set identifier to determine what key size I'm using. Here it seems to only detect the 128 key size. Maybe this a python thing, where everything is set to 128 key size? |
|
Hi @FotiosBistas - looks like a problem with the python scanner. This issue is not the right place. Can you file a separate issue? If we mix different concerns in one issue we may forget to fix them. Thank you!. |
This refers to issue #328.
Tasks
Questions
Source ECCG ENISA Policy
Where in the code should the CBOMs be sent to the OPA container?
Is the docker-compose override idea correct here?