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

Fix issue with ambiguity of control product #12454

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
2 changes: 1 addition & 1 deletion docs/manual/developer/03_creating_content.md
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ original_title: used as a reference for policies not yet available in English
source: a link to the original policy, eg. a URL of a PDF document
controls_dir: a directory containing files representing controls that will be imported into this policy
reference_type: Reference type represented by control IDs in this policy.
product: product ID, set if the policy is specific to a single product.
product: list of product IDs, set if the policy is specific to a single or number of products.
levels: a list of levels, the first one is default
- id: level ID (required key)
inherits_from: a list of IDs of levels inheriting from
Expand Down
6 changes: 5 additions & 1 deletion ssg/controls.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,11 @@ def load(self):
self.title = ssg.utils.required_key(yaml_contents, "title")
self.source = yaml_contents.get("source", "")
self.reference_type = yaml_contents.get("reference_type", None)
self.product = yaml_contents.get("product", None)
yaml_product = yaml_contents.get("product", None)
if isinstance(yaml_product, list):
self.product = yaml_product
elif yaml_product is not None:
self.product = [yaml_product]

default_level_dict = {"id": "default"}
level_list = yaml_contents.get("levels", [default_level_dict])
Expand Down
Loading