Skip to content

Commit

Permalink
make sure that platform is added to global list of platforms
Browse files Browse the repository at this point in the history
this step was not done in all situations and it caused datastream contain references to not defined platforms
  • Loading branch information
vojtapolasek committed Oct 19, 2021
1 parent af3f57d commit e20bd56
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ssg/build_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,10 @@ def add_group(self, group, env_yaml=None):
cpe_platform = env_yaml["product_cpes"].parse_platform_definition(
platform)
group.cpe_platform_names.add(cpe_platform.id)
if cpe_platform not in env_yaml[
"product_cpes"].cpe_platform_specification.platforms:
env_yaml["product_cpes"].cpe_platform_specification.add_platform(
cpe_platform)

def _pass_our_properties_on_to(self, obj):
for attr in self.ATTRIBUTES_TO_PASS_ON:
Expand All @@ -1143,6 +1147,10 @@ def add_rule(self, rule, env_yaml=None):
cpe_platform = env_yaml["product_cpes"].parse_platform_definition(
platform)
rule.cpe_platform_names.add(cpe_platform.id)
if cpe_platform not in env_yaml[
"product_cpes"].cpe_platform_specification.platforms:
env_yaml["product_cpes"].cpe_platform_specification.add_platform(
cpe_platform)

def __str__(self):
return self.id_
Expand Down

0 comments on commit e20bd56

Please sign in to comment.