-
Notifications
You must be signed in to change notification settings - Fork 11
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
CRAVEX: Vulnerabilities policy #97
Comments
See https://www.fedramp.gov/documents-templates/ for related approach. |
Generally the application UI to maintain and view Vulnerability Policy should resemble Usage Policy wherever appropriate. Add/Change form help text You can define the Vulnerability Policy choices that may apply to various application object types such as Packages and Components. For each application object type, you can specify the Vulnerability Policy label text, icon, icon color, guidelines, and security alert for each relevant policy position that you need to communicate to your users. Examples might include: No Action Required, Consider Software Upgrade, Urgent Action Required. |
Label: Label is the text that you want to present to application users to describe a specific Vulnerability Policy as it applies to an application object. Object type: Object type identifies the application object (Component, Package) to which the Vulnerability Policy will apply. Guidelines: Guidelines explain the organization definition of a vulnerability policy and can also provide detailed procedural requirements. Icon: You can choose an icon to associate with the vulnerability policy from the available icons at https://fontawesome.com/icons?d=gallery&m=free Color code: You can specify a valid HTML color code (e.g. #FFFFFF) to apply to your icon. Security alert: Indicates the criticality of a vulnerability based on organizational policy. Value choices include "Pass" (or empty, the default value), "Warning" (should be reviewed and fixed), and "Urgent" (highest priority). |
@pombredanne I think that a vulnerability policy only applies to packages and components. In a product context, purpose, destination, type of usage and other factors belong to the setting of a (new) Vulnerability Status on the Product Inventory Item relationship. |
The actual setting of a policy on a package or component should be automated as much as possible, although manual assignment and editing should also be supported. The best determining factor here would be the Severity Score associated with the vulnerability (currently something of a moving target). Perhaps another user-modifiable field to define on this Vulnerability Policy object would be a Severity Score Range, so that a Vulnerability within that range would trigger the assignment of that Policy to a package or component. |
Regarding potential triggering numbers, we need to consider the elements currently described at https://nvd.nist.gov/vuln-metrics/cvss/v4-calculator that is, VulnerableCode needs to provide at least two numbers (scores) for (1) Impact/Severity and (2) Exploitability. |
another useful resource for background material: |
Calculating Risk in VulnerableCode. See discussion document https://docs.google.com/document/d/1FxeJLATdlrsDZspwByXgh5Wc_Vp83qNp/edit?usp=sharing&ouid=117241222429542576816&rtpof=true&sd=true Here are two more fields that should be supported in the definition of a Vulnerability policy: From risk: The low risk numeric value in the definition of the range of risk values that trigger the setting of this policy on a Product Inventory Item or Package. |
FYI, Fedramp in the US demands that Fedramp compliant vendors have a specific policy.
The full doc further explain that CVEs with a CVSS above a "high" value must be fixed. |
@tdruez @pombredanne In the near term, I suppose we can base automatic vulnerability policy assignment on severity range score rather than waiting for a calculated vulnerability risk that also folds in weighting and exploitability factors. It seems like a compromise to me, but it would get things moving in DejaCode. |
Please ignore my "in the near term" remarks in the previous comment. This issue depends on the completion of VulnerableCode issue aboutcode-org/vulnerablecode#1543 and that issue points to a design document with more details. The VulnerableCode API v2 will need to support the new fields and that might require another issue to complete. The new fields identified in that design: "When a user gets software package metadata from VulnerableCode, any “Affected By” Vulnerability metadata for the specific PURL should include these 3 values: Weighted Severity, Exploitability, Vulnerability Risk." In particular, Vulnerability Risk is the critical value for automated assignment of a Vulnerability Policy to a Package and a Product Package, and all 3 values should be displayed on a Package. The next Comments will attempt to summarize how the Vulnerability Policies should be defined in DejaCode, how it will get assigned, where it will show up in the DejaCode UI, and what the possible workflows will be for a user to take advantage of the Policy. |
We need to step back and reconsider this Vulnerability Policy. Are we making this too complicated? Is it possible that DejaCode workflows can be more simply supported by the Vulnerability Risk value, where the Risk value (a number from 0 to 10) determines the urgency of addressing a vulnerability? (It also occurred to me that the actual Risk value might be a dynamic thing that could change during the lifecycle of a Vulnerability.) A simpler, and possibly better, approach would be to introduce a basic "Vulnerability Status" table that could be applied to Package and Product Package. (We need one anyway to support VEX.) Values could be (DejaCode should support the standard VEX Status list. To avoid adding too much complexity to the data model, this new VEX Status could simply be coded into DejaCode, rather than creating a new VEX Status code table.) The Vulnerabilities tab on Product could possibly highlight specific items based on their Risk value: |
I am still concerned that we keep focus on the idea that: "VulnerableCode needs to provide at least two numbers (scores) for (1) Impact/Severity and (2) Exploitability." We want to keep things as simple as possible, but one number seems to be too simple. |
Concerns noted. We will have 3 values: Weighted Severity, Exploitability, Vulnerability Risk. |
@tdruez @pombredanne @mjherzog The results of our analysis and discussions are now in the document at https://docs.google.com/document/d/1SRAkvoIj18quuRSap1r8-R6TMHAVPRPi/edit Please review that document when you have the opportunity and let us use it to record final design decisions (which have been modified significantly since this issue was first created). All comments, suggestions and questions are welcome. |
How about these 3 labels: |
or maybe better |
perhaps color-coded as well |
For risk numbers we generally need to avoid false precision so one decimal point only. |
Design document updated:
|
@tdruez @DennisClark The Exploitability value currently has three options (0.5, 1.0, 2.0) in the implementation for VulnerableCode. However, I believe we should store it in a decimal field rather than limiting it to these three choices. From my understanding, some exploit scripts may be unverified or come from less reliable data sources, so restricting the value to only three options might not be the best approach. Instead, I think we should allow for a continuous range (0 to 2.0), while initially starting with three predefined ranges as a baseline. |
@ziadhany Yes, the labels are for display purposes in DejaCode. This has no impact on your decimal implementation on the VCIO side. dejacode/vulnerabilities/models.py Lines 104 to 121 in 666ef3d
|
The key "risk" score has been implemented in: And merged with PR: |
@pombredanne @DennisClark Now that we have all the score related fields available in DejaCode, where do we want to go from there regarding policies features? |
Here is how we should implement a Vulnerability Policy: Define a new field called Risk Threshold, with a format consistent with our Risk field. On the Product Vulnerabilities tab, initial presentation should include only the Vulnerabilities at the Risk Threshold or higher. A toggle should be available to show all Vulnerabilities. |
An empty Risk Threshold value on a Product can be treated as a Zero value. |
…del #97 Signed-off-by: tdruez <[email protected]>
Signed-off-by: tdruez <[email protected]>
Including a link to see all vulnerabilities Signed-off-by: tdruez <[email protected]>
…s tab #97 Signed-off-by: tdruez <[email protected]>
Signed-off-by: tdruez <[email protected]>
Signed-off-by: tdruez <[email protected]>
Signed-off-by: tdruez <[email protected]>
Signed-off-by: tdruez <[email protected]>
Risk Threshold implemented in #210 |
For reference, the Calculating-Risk-in-VulnerableCode temp design doc at https://docs.google.com/document/d/1FxeJLATdlrsDZspwByXgh5Wc_Vp83qNp/edit#heading=h.ll22skp48ksm has this content: CRAVEX: Calculating Risk in VulnerableCodeThe design is ready for implementation. Significant revisions were made to this document on 2024-09-05. CRAVEX project: See https://github.com/orgs/aboutcode-org/projects/8/views/1 Background {#background}Objective: Evaluate severity, exploitability, and context factors to calculate a software package vulnerability risk score in VulnerableCode. Use that risk score to trigger the setting of vulnerability policy values on Product Inventory Items in DejaCode. Master GitHub issue: aboutcode-org/vulnerablecode#1543 Related GitHub issues have been assigned the “risk” tag (a changing list).
Vulnerability Risk Factors {#vulnerability-risk-factors}Origin {#origin}One of the primary benefits of identifying a software object using a PURL, is that in addition to the identification of the package Name and Version, it identifies its origin via Type and Namespace. As an example, note that the severity and exploitability of a package as built, deployed and used in a Linux distro may be different from the same package in another platform or environment. Severity {#severity}Severity may be expressed as a number ranging from 0 to 10. Severity indicates the potential impact of a vulnerability as it applies to a software package, and specific severity scores may be assigned a descriptive label as in the following example:
Ideally, a Severity score should be determined in the context of its origin, and how it is built or deployed. Note that CVSS scores from the NVD are not context sensitive. Weight {#weight}Weight may be expressed as a number ranging from 0 to 10. Weight refers to the reliability and authority of the data source assigning a severity. Since this is an inherently subjective score, it may be advisable to implement this using some kind of config file in VulnerableCode, which would be a list of all the data sources imported by VulnerableCode, with a Weight assigned to each one. Specific weighting scores may be assigned a descriptive label as in the following example:
Note that weight is more specific for a specific PURL and not just a package/version in general, because the PURL gives you more context information that is critical to assessing the severity. Weighted Severity {#weighted-severity}Weighted Severity may be expressed as a number ranging from 0 to 10. For a specific software package vulnerability, the assignments of severity and weighting values will vary depending on the data source reporting the vulnerability. The availability of the complete range of these severity values may be useful to support analytical research, but a range is not practical to support automated assignment of risk to a software package vulnerability.
Exploitability {#exploitability}
Exploitability refers to the potential or probability of a software package vulnerability being exploited by malicious actors to compromise systems, applications, or networks. It is determined automatically by discovery of exploits. Risk Calculation {#risk-calculation}Risk may be expressed as a number ranging from 0 to 10. Risk is calculated from weighted severity and exploitability values. It is the maximum value of (the weighted severity multiplied by its exploitability) or 10.
Suggested assignment of descriptive Risk labels should take that into account, as in the following example:
VulnerableCode Model {#vulnerablecode-model}When a user gets software package metadata from VulnerableCode, any “Affected By” Vulnerability metadata for the specific PURL should include these 3 values: Weighted Severity, Exploitability, Vulnerability Risk. Note again that these values may vary for the same package Name/Version where the Type/Namespace values are different. Software applications (such as DejaCode) depending on vulnerability scores for prioritization purposes, based on organization-defined policies, should make use of the Vulnerability Risk value, to automatically set priorities for analysis and the setting of vulnerability status. All 3 values should be available to support the analysis, in addition to the ability to get and explore all pertinent metadata available from VulnerableCode. That analysis will support the information needed to generate a meaningful VEX (Vulnerability Exploitability Exchange) document. |
For reference, the Managing-Vulnerabilities-in-DejaCode temp design doc at CRAVEX: Managing-Vulnerabilities-in-DejaCodeThis design is ready for review. CRAVEX project: See https://github.com/orgs/aboutcode-org/projects/8/views/1 Background {#background}Objective: Use Vulnerability Risk, Weighted Severity and Exploitability values from VulnerableCode to manage vulnerabilities in DejaCode. Related GitHub issues:
Update DejaCode Packages with Vulnerability Scores {#update-dejacode-packages-with-vulnerability-scores}DejaCode has a process that updates Packages with VulnerableCode data on a routine scheduled basis (such as daily). This makes vulnerability data fields available to the DejaCode user in Package and Product Package Queries. ![][image1] ![][image2] Rather than max_score and min_score, DejaCode should be improved to get three new score values supported by aboutcode-org/vulnerablecode#1543 and #97 :
These scores support the DejaCode user’s ability to prioritize review and determine action when reviewing Packages and Product Packages. DejaCode should also set the Vulnerability Status (see next section) to “Under Investigation” when a Vulnerability is initially discovered for a Package. Vulnerability Status {#vulnerability-status}introduce a "Vulnerability Status" table to define status codes that can be applied to Package and Product Package. (We need one anyway to support VEX.) Reference Data Values (fixture values) should be
and the standard VEX Status values as defined for the “state” field in the CDX VEX spec: https://cyclonedx.org/docs/1.6/json/#vulnerabilities_items_analysis
Add the Vulnerability Status field to the Package and Product Package models. DejaCode Product Package Relationship {#dejacode-product-package-relationship}Introduce Vulnerability Status to the Product Package Relationship. Note that it refers to the Vulnerability Status within the context of the Relationship. When a new Product Package is created in DejaCode, set the Vulnerability Status to be the same as the one identified in the corresponding Package. DejaCode Packages UI {#dejacode-packages-ui}The Vulnerabilities tab of the Packages detail user view in DejaCode currently is a grid with the following columns: Affected by, Aliases, Score, Summary, Fixed Packages. This should be improved to replace the Score column (which currently shows a Severity range) with three new columns that provide the Weighted Severity, Exploitability, and Vulnerability Risk score values. Enable sorting and filtering on those columns. DejaCode Product UI {#dejacode-product-ui}Product Inventory Tab {#product-inventory-tab}The Product Inventory tab in DejaCode currently is a grid with the following columns: Item, Purpose, Concluded license, Review status, Deployed, Modified. This should be improved to:
Apply the label name change, and introduce the new “Vulnerability status” field, in the “Update relationship” form. Product Vulnerabilities Tab {#product-vulnerabilities-tab}The Product Vulnerabilities tab in DejaCode currently is a grid with the following columns: Vulnerability, Aliases, Score, Summary, Affected packages. This should be improved to replace the Score column (which currently shows a Severity range) with three new columns that provide the Weighted Severity, Exploitability, and Vulnerability Risk score values. Enable sorting and filtering on those columns. The Vulnerabilities tab on Product could possibly highlight specific items based on their Risk value: 8.0 - 10.0 Critical, immediate response required (red?) 6.0 - 7.9 High, response required as soon as possible (orange?) 3.0 - 5.9 Medium, investigation required (yellow?) 0.1 - 2.9 Low, response deferred (no highlight) Also we can use the ranges defined above for filtering by Risk. |
The overall policy feature consists of these elements:
In VulnerableCode, this score is computed in VulnerableCode and exposed in the API v2In DejaCode, we consume and use this scoreWe have a new vulnerabilities risk threshold field in a DejaCode Product and in a Dataspace configuration, where Product threshold takes precedence over the Dataspace configuration value. This threshold is the main policy to help prioritize and control the level of attention to vulnerabilities.
This Vulnerability Analysis is always assigned to a Vulnerability object and a ProductPackage relation. The values for a Vulnerability Analysis are displayed in the Product "Vulnerabilities" tab. A "Edit" button can be used to open a form in a model to provided analysis data. A secondary element of a policy is at the ScanCode.io level, where we can exclude specific vulnerabilities entirely using a project config file. See the related PRs and issues at:
|
Create UI and DB models to create and store vulnerability policy: org-wide, and product-specific policy based on purpose, destination, type of usage and other factors.
The text was updated successfully, but these errors were encountered: