Skip to content

Commit

Permalink
make zap alerts have the correct link type (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
northdpole authored Apr 12, 2022
1 parent 8ecd747 commit bf1ad26
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ def register_alerts(cache: db.Node_collection, repo: git.git, alerts_path: str):
if nl.document.doctype == defs.Credoctypes.CRE
]:
cache.add_link(
cre=db.dbCREfromCRE(cre.document), node=dbnode
cre=db.dbCREfromCRE(cre.document),
node=dbnode,
type=defs.LinkTypes.LinkedTo,
)
else:
logger.error(
Expand All @@ -118,7 +120,9 @@ def register_alerts(cache: db.Node_collection, repo: git.git, alerts_path: str):
if link.document.doctype == defs.Credoctypes.CRE:

cache.add_link(
cre=db.dbCREfromCRE(link.document), node=dbnode
cre=db.dbCREfromCRE(link.document),
node=dbnode,
type=defs.LinkTypes.LinkedTo,
)
else:
logger.info(f"CWE id not found in alert {externalId}, skipping linking")

0 comments on commit bf1ad26

Please sign in to comment.