-
Notifications
You must be signed in to change notification settings - Fork 42
Initial Decision Table object #795
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
Conversation
|
I think the Decision TableJSON schema |
If I'm interpreting the schema right, I don't think this will work.
class SsvcDecisionPointSelection(BaseModel):
name: str = Field(..., min_length=1, description="Name of the decision point")
namespace: str = Field(
..., min_length=1, description="Namespace of the decision point"
)
version: str = Field(..., min_length=1, description="Version of the decision point")
values: List[str] = Field(
..., min_items=1, description="Selected values for the decision point"
)This doesn't fit as a mapping because it doesn't reflect the specific mapping of
class DecisionPointValueSelection(BaseModel):
id: str = Field(
...,
min_length=1,
description="Identifier for the vulnerability (e.g., CVE, VU#, GHSA, etc.)",
)
role: str = Field(
...,
min_length=1,
description="Stakeholder role (Supplier, Deployer, Coordinator, etc.)",
)
timestamp: datetime = Field(
..., description="RFC 3339 timestamp for the evaluation"
)
schemaVersion: str = Field(
...,
min_length=1,
description="Schema version used for the decision point evaluation",
)
selections: List[SsvcDecisionPointSelection] = Field(
..., min_items=1, description="Evaluated decision points"
)However, the fields I'm also suggesting we punt the "How to represent selection" problem to
Agreed. I will look into maybe passing this through a Pandas dataframe before we emit the CSV so we can make it a little less chatty. |
To be clear I mean the Decision Table JSON format will be hard to punt it off to use #800 in my mind. I think if we can basically mimic the ../data/schema/current/Decision_Point_Value_Selection.schema.json#/$defs/SsvcdecisionpointselectionSchema section of the schema for this Class it will help other things fall in place including the CSV. So for example for Deployer decision table the very first row of CSV will look like this (basically matches . While it is noisy it will capture the each column of the row in "gory" details - so one can capture the matching row-column combo to find all the DSOI matching values in this example. This will be the first row in the older CSV deployer-options.csv or the newer CSV Hope that makes sense. |
|
When I try to this test on the coordinator_publish_mapping.json |
src/ssvc/registry/base.py
Outdated
|
|
||
| class ValuedVersion(BaseModel): | ||
| version: VersionString | ||
| obj: _GenericSsvcObject |
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.
The obj: _GenericSsvcObject lines are a problem because it's not copying the full object, just the fields that are explicitly in the _GenericSsvcObject mixin. We need to resolve this before merging.
|
Also CVSS Equivalency Set to CVSS LMHC scoring also fails the pydantic order validation test. The sorted array is enclosed here for testing. |
|
There is a problem with SSVC registry of Decision Points. It looks like the SSVC/data/json/ssvc_object_registry.json Lines 82 to 98 in 51a40e3
|
| # subject to its own license. | ||
| # DM24-0278 | ||
|
|
||
| from ssvc.decision_tables.base import decision_table_to_longform_df |
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.
Whe I try to run this in the relative path of the repository it fails as there is also another ssvc directory under here in "./" of this path. Basically the src/ssvc/decision_tables/ssvc is in the preferred order for python file execution over the src/ssvc path.
(venv) Mac-redjayapple:SSVC vssarvepalli$ python src/ssvc/decision_tables/base.py
Traceback (most recent call last):
File "/Users/vijay/Development/SSVC/src/ssvc/decision_tables/base.py", line 31, in <module>
from ssvc._mixins import _Base, _Commented, _Namespaced, _SchemaVersioned, _Versioned
ModuleNotFoundError: No module named 'ssvc._mixins'
(venv) Mac-redjayapple:SSVC vssarvepalli$
Decision_Point_Group.schema.jsonusing Pydantic #734Decision_Point.schema.jsonusing Pydantic #733pydanticbuilt-ins to generate JSON schemas from python data classes #702This PR creates a
DecisionTableobject that contains:While the
DataTableobject can generate a CSV file as output, importing of CSV tables to populate aDecisionTableobject is not supported in this implementation.This PR is just intended to provide the base data structure because other work depends on the existence of this object.
Incidental Changes
Changes to
data/json/*are incidental to changes in the base object ordering or the addition of a newbasicnamespace to capture decision points and outcomes that represent generic prioritization concepts (MoSCoW, Yes/No, Eisenhower matrix, etc.) The decision points already existed, their location may have changed.Changes to
data/schema/*reflect updates to the data objects, and the fact thatssvc.doctoolshas been updated to auto-generate schemas from the pydantic data objects.Changes to
docs/**.mdare largely due to site build-time dynamic content generation based on code that has been reorganized in thessvcpackage. These likely broke in Refactor namespaces #791.Future work not addressed in this PR:
DecisionTableobjects UI to create, explore, and editDecisionTableobjects #838DataTableobject. This might look like a Mapping object with a downselection of rows. Create dataclass to represent DecisionTable selection #800DecisionTableobject Add CSV import capability to DecisionTable object #801CoPilot Summary
This pull request introduces several updates across the codebase, focusing on upgrading dependencies, enhancing Docker-based testing workflows, and adding or updating decision point JSON schemas to align with schema version 2.0.0. The most important changes are summarized below:
Dependency and Workflow Updates:
.github/workflows/link_checker.yml) from3.10to3.12for compatibility with the latest features.Makefileby adding a step to build the latest Docker test image before running tests, improving the reliability of Docker-based testing.New Decision Point JSON Schemas:
do_schedule_delegate_delete_1_0_0.json) under thebasicnamespace.moscow_1_0_0.json) under thebasicnamespace.value_complexity_1_0_0.json) under thebasicnamespace.yesno_1_0_0.json) under thebasicnamespace.Updates to Existing JSON Schemas:
cisa,cvss, etc.) to useschemaVersion: 2.0.0, ensuring consistency and compatibility with the latest schema standards. This includes files such ascisa_levels_1_0_0.json[1]access_complexity_1_0_0.json[2] andauthentication_1_0_0.json[3] among others.