Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Implement Suricata App for ingesting rules from Threat Bus #131

Merged
merged 8 commits into from
Jun 23, 2021

Conversation

0snap
Copy link
Contributor

@0snap 0snap commented Jun 21, 2021

📔 Description

This PR adds a new Python app that connects to Threat Bus via ZeroMQ and listens for STIX-2 indicators with pattern_type == "suricata". Those indicators are then parsed and rule updates are pushed to a suricata rules file, which the user first must configure in their suricata.yaml config file.

The app support CUD in a very simplistic, file-based form. We use suricatasc to instruct Suricata via its UNIX control socket to re-read the rules from the app-maintained rules file in a configurable interval.

📝 Checklist

  • All user-facing changes have changelog entries.
  • The changes are reflected on docs.tenzir.com/threatbus, if necessary.
  • The PR description contains instructions for the reviewer, if necessary.

🎯 Review Instructions

For interactive testing:

  • Read the README to prepare your local Suricata
  • Start Suricata
  • Start OpenCTI
  • Start the Threat Bus OpenCTI connector
  • Start Threat Bus
  • Start the new app (this PR)
  • Create new Suricata-typed indicators in OpenCTI (e.g., pattern = alert http any any -> any any (msg: "Test444"; content:"example.com"; http_host; sid:772;)
  • Verify they are flushed to Suricata (e.g., curl example.com -> should generate an alert in your eve.json)

@0snap 0snap marked this pull request as ready for review June 21, 2021 14:21
@0snap 0snap requested a review from lava June 21, 2021 14:21
@0snap 0snap added the feature New functionality label Jun 21, 2021
Copy link
Member

@lava lava left a comment

Choose a reason for hiding this comment

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

The code looks good to me; the only addition I'd like to see is to mention in the README that received updates are not applied instantaneously but buffered up to reload_interval seconds, since that will be probably be a bit unexpected for a new user.

@0snap 0snap merged commit c79e974 into master Jun 23, 2021
@0snap 0snap deleted the story/ch26207 branch June 23, 2021 11:28
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
feature New functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants