{% extends "base.html" %} {% from "_ui.html" import icon, sev, lic, engs, when, token, crumbs %} {% block title %}{{ g.msg or g.sid }}{% endblock %} {% block content %} {{ crumbs([('Search', '/search'), (g.app_layer, '/search?q=app:' ~ g.app_layer)] + ([(g.classtype, '/search?q=classtype:' ~ g.classtype|urlencode)] if g.classtype else []) + [('sid ' ~ g.sid, none)]) }}

{{ g.msg or "(no msg)" }}

{{ sev(g.severity) }}{{ g.gid }}:{{ g.sid }}{% if g.rev %} rev {{ g.rev }}{% endif %}{{ lic(rlic[0], rlic[1]) }}{{ engs(engines, g.loads_in, g.fails_in) }} {% for c in cves[:4] %}{{ c }}{% endfor %} {{ icon('merge') }}{{ g.copies }} cop{{ 'ies' if g.copies != 1 else 'y' }} · {{ g.sources|length }} source{{ 's' if g.sources|length != 1 }} {% if g.is_ioc %}IOC · {{ IOC_WORDS.get(g.ioc_type, g.ioc_type) }}{% endif %} {% if key and key.ambiguous %}ambiguous sid{% endif %} {% if not g.enabled_anywhere %}disabled upstream{% endif %} {% if 'deprecated' in g.flags %}deprecated{% endif %}{% if 'retired' in g.flags %}retired by the publisher{% endif %} {% if g.junk %}not Suricata syntax{% endif %}
{{ icon('file') }}Download .rules{{ icon('export') }}Export…

{{ summary.plain }}

{% if summary.traffic %}{% set tr = summary.traffic %}
{{ tr.left.label }}{{ tr.left.addr }}{{ tr.left.role }}
{{ tr.wire }}{{ tr.note }}
{{ tr.right.label }}{{ tr.right.addr }}{{ tr.right.role }}
{% endif %} {% if summary.steps %}
    {% for st_ in summary.steps %}{{ st_.html }}{% endfor %}
{% endif %}
Detects
{% if cves %}{% for c in cves[:3] %}{{ c }}{% if not loop.last %}, {% endif %}{% endfor %}{% elif g.ioc_value %}{{ g.ioc_value[:48] }}{% else %}{{ g.category or g.app_layer }}{% endif %} {% if meta.get('affected_product') %}{{ meta.affected_product|join(', ')|replace('_', ' ') }}{% endif %} {% if meta.get('malware_family') %}malware family {{ meta.malware_family[0]|replace('_', ' ') }}{% endif %} {% if g.mitre %}{% for m in g.mitre[:4] %}{{ m }}{% endfor %}{% endif %}
Class
{% if g.classtype %}{{ g.classtype }}{% set ct = CLASSTYPES.get(g.classtype) %}{% if ct %}{{ ct[0] }} (priority {{ ct[1] }}){% endif %}{% else %}no classtype{% endif %} {% if g.confidence or meta.get('deployment') %}{% if g.confidence %}confidence {{ g.confidence }}{% endif %}{% if g.confidence and meta.get('deployment') %} · {% endif %}{% if meta.get('deployment') %}deployment {{ meta.deployment|join(', ') }}{% endif %}{% endif %}
Sid owner
{% if alloc %}{{ alloc.owner }}range {{ alloc.first|num }}–{{ alloc.last|num }} (sidallocation.org) · key {{ g.rule_key }}{% else %}{{ g.canonical_source }}no allocated range: namespace of the source · key {{ g.rule_key }}{% endif %} {% if remap %}{{ icon('alert') }}clashes with another rule: exported as {{ g.gid }}:{{ remap[1] }} (stable){% endif %}
{% set src = srcs.get(g.canonical_source) %}
Licence
{{ rlic[0] }} ({{ g.canonical_source }}){% if rlic[1] == 'permissive' %}share it, keep the notice{% elif rlic[1] == 'copyleft' %}share it under the same licence{% elif rlic[1] == 'restricted' %}your own sensors only, never shared{% else %}no licence stated: do not redistribute{% endif %}
{% if summary.needs %}
{{ icon('about') }}

You need: {% for n in summary.needs %}{{ n }}{% if not loop.last %}; {% endif %}{% endfor %}.{% if setters %} suriharvest exports flowbit setters together with the rules that need them; if you exclude a setter, this rule can never fire and the build warns you.{% endif %}

{% endif %}

Rule canonical copy from {{ g.canonical_source }}{% if canonical %} · {{ canonical.path.split('/')[-1] }}:{{ canonical.line_no }}{% endif %}

{{ '' }}{{ icon('file') }}.rules
{{ v.raw|rule_html }}

Dependencies flowbits, datasets, files

    {% for bit, cands in setters %}{% set nm = bit.split(':', 1)[1] %} {% if cands %}{% set c0 = cands[0] %}
  • {{ icon('check', 'ico ok') }}Needs {{ bit.split(':')[0][:-1] }} {{ nm }}: set by sid {{ c0.sid }} {{ c0.msg }}{% if cands|length > 1 %} (and {{ cands|length - 1 }} more){% endif %}{{ 'same source' if c0.canonical_source == g.canonical_source else 'from' }} ({{ c0.canonical_source }}){% if c0.loads_in %}, loads in {{ c0.loads_in|map('eng_short')|join(' and ') }}{% endif %}
  • {% else %}
  • {{ icon('x', 'ico miss') }}Needs {{ bit.split(':')[0][:-1] }} {{ nm }}, and no rule in the index sets itthis rule can never fire in your builds
  • {% endif %}{% endfor %} {% for bit, users in needed_by %}
  • {{ icon('flow', 'ico ok') }}Sets {{ bit.split(':')[0][:-1] }} {{ bit.split(':', 1)[1] }}{% if users %}, needed by {% for u in users %}sid {{ u.sid }}{% if not loop.last %}, {% endif %}{% endfor %}{% else %}; no rule in the index checks it{% endif %}{% if users %}excluding this rule silences {{ users|length }}{{ '+' if users|length == 5 }} other rule{{ 's' if users|length != 1 }}{% endif %}
  • {% endfor %} {% for f in v.files %}
  • {{ icon('file', 'ico miss') }}Needs the file {{ f }} next to the rulesdataset, lua script or file list: not shipped by suriharvest
  • {% endfor %} {% if not setters and not needed_by and not v.files %}
  • {{ icon('check', 'ico ok') }}Uses no flowbit, dataset, lua script or fileit works on its own
  • {% endif %}
{% if revs|length > 1 %}

Revision history {{ g.rule_key }}

    {% for r in revs %}{% if r.lh != g.logic_hash %}rev {{ r.rev }}{% else %}rev {{ r.rev }}{% endif %}{{ r.what }}{% if not r.live %} (no longer published){% endif %}{{ r.first.strftime('%Y-%m-%d') }}{% endfor %}
{% endif %} {% if family or similar or setters|selectattr(1)|list %}

Related rules

    {% for bit, cands in setters %}{% for c in cands[:1] %}
  • {{ c.msg }}sets the flowbit this rule needs · sid {{ c.sid }}companion
  • {% endfor %}{% endfor %} {% for f in family[:5] %}
  • {{ f.msg }}same family: another variant of this rule · sid {{ f.sid }} · {{ f.canonical_source }}family
  • {% endfor %} {% for f, j in similar %}
  • {{ f.msg }}most of the same contents on {{ f.app_layer }}, different detection · sid {{ f.sid }}{{ (j * 100)|round|int }}% overlap
  • {% endfor %}
{% endif %}
{% endblock %}