-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add python decision points for critical software, high value assets, …
…and in KEV (#346) * move away from deepcopy to just rebuilding decision points from scratch * add iterator to decision point group * add critical software and high value asset decision points - update unit tests * avoid deepcopy * don't need to specify namespace in object * add "in KEV" decision point to address #317
- Loading branch information
1 parent
798ff57
commit e2583ec
Showing
9 changed files
with
189 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/env python | ||
""" | ||
Provides an SSVC decision point for critical software designation. | ||
""" | ||
# 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 | ||
|
||
from ssvc.decision_points.base import SsvcDecisionPoint, SsvcDecisionPointValue | ||
|
||
YES = SsvcDecisionPointValue( | ||
name="Yes", | ||
key="Y", | ||
description="System meets a critical software definition.", | ||
) | ||
|
||
NO = SsvcDecisionPointValue( | ||
name="No", | ||
key="N", | ||
description="System does not meet a critical software definition.", | ||
) | ||
|
||
CRITICAL_SOFTWARE_1 = SsvcDecisionPoint( | ||
name="Critical Software", | ||
description="Denotes whether a system meets a critical software definition.", | ||
key="CS", | ||
version="1.0.0", | ||
values=( | ||
NO, | ||
YES, | ||
), | ||
) | ||
|
||
|
||
def main(): | ||
print(CRITICAL_SOFTWARE_1.to_json(indent=2)) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/env python | ||
""" | ||
Models a high value asset as a decision point. | ||
""" | ||
# 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 | ||
|
||
from ssvc.decision_points.base import SsvcDecisionPoint, SsvcDecisionPointValue | ||
|
||
YES = SsvcDecisionPointValue( | ||
name="Yes", | ||
key="Y", | ||
description="System meets a high value asset definition.", | ||
) | ||
|
||
NO = SsvcDecisionPointValue( | ||
name="No", | ||
key="N", | ||
description="System does not meet a high value asset definition.", | ||
) | ||
|
||
HIGH_VALUE_ASSET_1 = SsvcDecisionPoint( | ||
name="High Value Asset", | ||
description="Denotes whether a system meets a high value asset definition.", | ||
key="HVA", | ||
version="1.0.0", | ||
values=( | ||
NO, | ||
YES, | ||
), | ||
) | ||
|
||
|
||
def main(): | ||
print(HIGH_VALUE_ASSET_1.to_json(indent=2)) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/env python | ||
""" | ||
Provides a decision point representing whether a vulnerability is in the CISA Known Exploited Vulnerabilities (KEV) list. | ||
""" | ||
# 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 | ||
|
||
from ssvc.decision_points.base import SsvcDecisionPoint, SsvcDecisionPointValue | ||
|
||
YES = SsvcDecisionPointValue( | ||
name="Yes", | ||
key="Y", | ||
description="Vulnerability is listed in KEV.", | ||
) | ||
|
||
NO = SsvcDecisionPointValue( | ||
name="No", | ||
key="N", | ||
description="Vulnerability is not listed in KEV.", | ||
) | ||
|
||
IN_KEV_1 = SsvcDecisionPoint( | ||
name="In KEV", | ||
description="Denotes whether a vulnerability is in the CISA Known Exploited Vulnerabilities (KEV) list.", | ||
key="KEV", | ||
version="1.0.0", | ||
values=( | ||
NO, | ||
YES, | ||
), | ||
) | ||
|
||
|
||
def main(): | ||
print(IN_KEV_1.to_json(indent=2)) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
# 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 | ||
|
||
import json | ||
import logging | ||
import unittest | ||
|
@@ -6,7 +19,9 @@ | |
|
||
import ssvc.decision_points # noqa F401 | ||
from ssvc.decision_points.base import REGISTERED_DECISION_POINTS | ||
|
||
from ssvc.decision_points.critical_software import CRITICAL_SOFTWARE_1 # noqa | ||
from ssvc.decision_points.high_value_asset import HIGH_VALUE_ASSET_1 # noqa | ||
from ssvc.decision_points.in_kev import IN_KEV_1 | ||
# importing these causes the decision points to register themselves | ||
from ssvc.dp_groups.v1 import SSVCv1 # noqa | ||
from ssvc.dp_groups.v2 import SSVCv2 # noqa | ||
|
@@ -31,6 +46,15 @@ def setUp(self) -> None: | |
logger.addHandler(hdlr) | ||
self.logger = logger | ||
|
||
def test_confirm_registered_decision_points(self): | ||
dps = list(REGISTERED_DECISION_POINTS) | ||
self.assertGreater(len(dps), 0) | ||
|
||
extras = [CRITICAL_SOFTWARE_1, HIGH_VALUE_ASSET_1, IN_KEV_1] | ||
for dpg in [SSVCv1, SSVCv2, SSVCv2_1, extras]: | ||
for dp in dpg: | ||
self.assertIn(dp, REGISTERED_DECISION_POINTS) | ||
|
||
def test_decision_point_validation(self): | ||
# path relative to top level of repo | ||
schema_file = find_schema("data/schema/Decision_Point.schema.json") | ||
|