Skip to content

Commit

Permalink
ENH: Adds feed.documentation to Shadowserver parser.
Browse files Browse the repository at this point in the history
  • Loading branch information
gethvi authored and aaronkaplan committed Feb 29, 2024
1 parent ac6aa4e commit 0671a8b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions intelmq/bots/parsers/shadowserver/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ def parse_line(self, row, report):
# set feed.name and code, honor the overwrite parameter
event.add('feed.name', self.feedname, overwrite=self.overwrite)

# set feed.documentation to a report url
event.add('feed.documentation', conf.get('url'))

extra = {} # The Json-Object which will be populated with the
# fields that could not be added to the standard intelmq fields
# the parser is going to write this information into an object
Expand Down

3 comments on commit 0671a8b

@sebix
Copy link
Member

@sebix sebix commented on 0671a8b Feb 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should already be done automatically by Bot.new_report(Report) and Event.__init__(Report), respectively.

@gethvi
Copy link
Contributor Author

@gethvi gethvi commented on 0671a8b Mar 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But only if the link is present in runtime.yaml.

@sebix
Copy link
Member

@sebix sebix commented on 0671a8b Mar 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And if it's there, the subsequent event.add will fail because the field already exists. Suggestion: add overwrite=False

Please sign in to comment.