{% extends "base.html" %} {% from "_ui.html" import icon, lic_class, when, token, copy_btn %} {% block title %}Export{% endblock %} {% block content %} {% set keepq = {'q': q} if scope == 'search' else {} %}

Export

Get a ruleset in the shape your sensors need. Rules that do not load in the chosen Suricata are left out, sid clashes are fixed, licences travel with the file.

{% if error %}
{{ icon('alert') }}

The search could not be read: {{ error }}

{% endif %} {% if not profiles and scope == 'profile' %}

Nothing to export yet

Export works on a profile (a named ruleset) or on a search. Create a profile, or search and export the result.

suriharvest profile create default{{ copy_btn('#c-pc') }}
{% else %}
{% if scope == 'profile' and t %}{% elif scope == 'search' %}{% else %}{% for x in h %}{% endfor %}{% endif %}
What to export

{% if scope == 'profile' and t %}Profile {{ t.name }}: {% if t.query %}{{ t.query }}{% else %}every rule{% endif %} minus its exclusions{% if b %}, build #{{ b.id }} from {{ when(b.created_at) }}{% else %}; no build yet{% endif %} {% elif scope == 'search' %}The search {{ q }}: {{ total|num }} rules {% else %}{{ n_selected|num }} rule{{ 's' if n_selected != 1 }} you picked{% endif %}

{% for c in cards %}{{ 'Profile ' if loop.first }}{{ c.t.name }}{% if c.b %} ({{ c.b.rules|num }}){% endif %}{% endfor %}{% if scope == 'search' %}Search ({{ total|num }}){% endif %}{% if scope == 'selected' %}Selected ({{ n_selected|num }}){% endif %}
{% if per_engine %}
For which Suricata

Only rules that passed suricata -T on that version

{% for e, n in per_engine %}{{ e|eng_label }} ({{ n|num }}){% endfor %}
{% endif %}
Format {% for key, ico, title, desc in [ ('rules', 'file', 'One suricata.rules file', 'Merged and de-duplicated. Put it in rule-files: or /var/lib/suricata/rules/.'), ('by-source', 'sources', 'One file per source (.zip)', 'Keeps licence boundaries. Flowbit setters stay with their own source.'), ('update', 'link', 'suricata-update source', "A URL that always serves this profile's latest build. Your sensors pull it on their schedule."), ('datasets', 'dataset', 'IOC rules as datasets', (ioc.values()|sum|num ~ ' IOC rules become dataset files plus one rule per buffer. Faster, smaller.') if ioc else 'IOC rules become dataset files plus one rule per buffer.')] %} {% if key != 'update' or scope == 'profile' %} {% endif %}{% endfor %}

Options

defaults are safe; change only if you need to
{% if scope == 'profile' and t %}

Use it with suricata-update

{{ copy_btn('#su') }}

Add this once on each sensor. suricata-update then fetches the newest build of {{ t.name }}{% if engine %} for {{ engine|eng_label }}{% endif %} every time it runs.

suricata-update add-source suriharvest-{{ t.name }} {{ feed }} suricata-update && suricatasc -c reload-rules

Sensors on another host: run suriharvest serve --host 0.0.0.0 with a token, or publish a release (suriharvest release build) and use its index.yaml.

{% endif %}

Same thing from the terminal

{{ copy_btn('#cli') }}
{{ cli }}
{% endif %} {% endblock %}