Skip to content
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

Add CVSSv4 Decision Points #377

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ mkdocstrings
mkdocstrings-python
mkdocs-print-site-plugin
dataclasses-json
thefuzz==0.20.0
pandas~=2.1.2
scikit-learn~=1.3.2
jsonschema~=4.19.2
networkx~=3.1
networkx~=3.1
235 changes: 0 additions & 235 deletions src/analyze_csv.py

This file was deleted.

29 changes: 15 additions & 14 deletions src/ssvc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/usr/bin/env python
'''
file: __init__.py
author: adh
created_at: 9/20/23 10:36 AM
'''


def main():
pass


if __name__ == '__main__':
main()
# Copyright (c) 2023 Carnegie Mellon University and Contributors.
# - see Contributors.md for a full list of Contributors
# - see ContributionInstructions.md for information on how you can Contribute to this project
# Stakeholder Specific Vulnerability Categorization (SSVC) is
# licensed under a MIT (SEI)-style license, please see LICENSE.md distributed
# with this Software or contact [email protected] for full terms.
# Created, in part, with funding and support from the United States Government
# (see Acknowledgments file). This program may include and/or can make use of
# certain third party source code, object code, documentation and other files
# (“Third Party Software”). See LICENSE.md for more details.
# Carnegie Mellon®, CERT® and CERT Coordination Center® are registered in the
# U.S. Patent and Trademark Office by Carnegie Mellon University
"""
Provides SSVC modules.
"""
35 changes: 29 additions & 6 deletions src/ssvc/decision_points/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,48 @@

from dataclasses_json import dataclass_json

from ssvc._mixins import _Base, _Commented, _Keyed, _Namespaced, _Versioned
from ssvc._mixins import _Base, _Keyed, _Namespaced, _Versioned

logger = logging.getLogger(__name__)


_RDP = {}
REGISTERED_DECISION_POINTS = []


def register(dp):
"""
Register a decision point.
"""
global _RDP

key = (dp.namespace, dp.name, dp.key, dp.version)

if key in _RDP:
logger.warning(f"Duplicate decision point {key}")

_RDP[key] = dp
REGISTERED_DECISION_POINTS.append(dp)


def _reset_registered():
"""
Reset the registered decision points.
"""
global _RDP
global REGISTERED_DECISION_POINTS

_RDP = {}
REGISTERED_DECISION_POINTS = []


@dataclass_json
@dataclass(kw_only=True)
class SsvcDecisionPointValue(_Base, _Keyed):
"""
Models a single value option for a decision point.
"""

pass


@dataclass_json
@dataclass(kw_only=True)
Expand All @@ -62,9 +87,7 @@ def __iter__(self):
return iter(self.values)

def __post_init__(self):
global REGISTERED_DECISION_POINTS

REGISTERED_DECISION_POINTS.append(self)
register(self)

if isinstance(self.values[0], dict):
self.values = tuple(
Expand Down
26 changes: 14 additions & 12 deletions src/ssvc/decision_points/cvss/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#!/usr/bin/env python
# Copyright (c) 2023 Carnegie Mellon University and Contributors.
# - see Contributors.md for a full list of Contributors
# - see ContributionInstructions.md for information on how you can Contribute to this project
# Stakeholder Specific Vulnerability Categorization (SSVC) is
# licensed under a MIT (SEI)-style license, please see LICENSE.md distributed
# with this Software or contact [email protected] for full terms.
# Created, in part, with funding and support from the United States Government
# (see Acknowledgments file). This program may include and/or can make use of
# certain third party source code, object code, documentation and other files
# (“Third Party Software”). See LICENSE.md for more details.
# Carnegie Mellon®, CERT® and CERT Coordination Center® are registered in the
# U.S. Patent and Trademark Office by Carnegie Mellon University

"""
file: __init__.py
author: adh
created_at: 9/20/23 12:39 PM
Provides SSVC decision points modeling CVSS metrics.
"""


def main():
pass


if __name__ == "__main__":
main()
Loading