-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: adapt mandatory test 6.1.11 for csaf 2.1 #211
base: 196-csaf-2.1
Are you sure you want to change the base?
Conversation
Should pass the test (valid example 4) as the weakness was called "Sensitive Information Accessible by Physical Probing of JTAG Interface" in 4.9
Should pass the test (valid example 5) as the weakness was called "System-on-Chip (SoC) Using Components without Unique, Immutable Identifiers" in 4.13.
Should fail the test (failing example 2) as the weakness was not present in 4.12 (but added in 4.13; see https://cwe.mitre.org/data/reports/diff_reports/v4.12_v4.13.html)
Should fail the test (failing example 4) as the weakness was called "System-on-Chip (SoC) Using Components without Unique, Immutable Identifiers" in 4.13. Did you just check against the latest version? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@domachine I guess you are missing the version
?
additionalProperties: true, | ||
properties: { | ||
id: { type: 'string' }, | ||
}, | ||
optionalProperties: { | ||
name: { type: 'string' }, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't that missing the version
here?
for (let i = 0; i < doc.vulnerabilities.length; ++i) { | ||
const vulnerability = doc.vulnerabilities[i] | ||
for (let j = 0; j < vulnerability.cwes.length; ++j) { | ||
const cwe = vulnerability.cwes.at(i) | ||
if (validateCWE(cwe)) { | ||
const entry = cwec.weaknesses.find((w) => w.id === cwe.id) | ||
if (!entry) { | ||
isValid = false | ||
errors.push({ | ||
instancePath: `/vulnerabilities/${i}/cwes/${j}/id`, | ||
message: 'no weakness with this id is recognized', | ||
}) | ||
continue | ||
} | ||
if (entry.name !== cwe.name) { | ||
isValid = false | ||
errors.push({ | ||
instancePath: `/vulnerabilities/${i}/cwes/${j}/name`, | ||
message: 'the name does not match the weakness with the given id', | ||
}) | ||
continue | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is the version
considered?
43c7fee
to
47510f2
Compare
Okay, now I included all catalogues that are necessary for the tests. We should probably discuss in the meeting next week, how many catalogue versions should be embedded in the lib. |
47510f2
to
64bf3f2
Compare
Coverage after merging 197-mandatory-test-6.1.11 into 196-csaf-2.1-exclude-unimplemented-tests-from-test-suite
Coverage Report
|
64bf3f2
to
9238623
Compare
Coverage after merging 197-mandatory-test-6.1.11 into 196-csaf-2.1
Coverage Report
|
9238623
to
eb90422
Compare
Coverage after merging 197-mandatory-test-6.1.11 into 196-csaf-2.1
Coverage Report
|
@domachine To be conforming: all available. |
eb90422
to
5399bd4
Compare
Coverage after merging 197-mandatory-test-6.1.11 into 196-csaf-2.1
Coverage Report
|
@tschmidtb51 now I included all available cwe catalogues. I also rebased the branch on the branch with the new test script (#220) so that you can use this to run the test against individual csaf files. |
5399bd4
to
b38d58c
Compare
Coverage after merging 197-mandatory-test-6.1.11 into 196-csaf-2.1
Coverage Report
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is a cwe, that contains DEPRECATED in name a valid cew? (see: oasis_csaf_tc-csaf_2_1-2024-6-1-11-13.json=
/** @type {Array<{ message: string; instancePath: string }>} */ | ||
const errors = [] | ||
let isValid = true | ||
debugger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove debugger statement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
b38d58c
to
4062f49
Compare
Coverage after merging 197-mandatory-test-6.1.11 into 196-csaf-2.1
Coverage Report
|
I'm not sure, @tschmidtb51 what do you think? |
Potentially invalid test cases:
All of the above test cases fail against the new test. I checked them manually and I think that they are invalid.