{% extends "base.html" %} {% from "_ui.html" import icon, lvl, st as status_badge, lic, lic_class, tech, card, logsource %} {% block title %}{{ q ~ ' - ' if q }}Search{% endblock %} {% block section %}search{% endblock %} {% block content %} {% macro hidden(exclude=[]) %}{% for k, v in base.items() %}{% if v and k not in exclude and k != 'page' %}{% endif %}{% endfor %}{% endmacro %} {% set MULTI = ('level', 'status', 'validation') %} {% macro chosen(name) %}{{ (params[name]|lower).split(',')|map('trim')|reject('equalto', '')|join(',') }}{% endmacro %} {% macro facet_link(name, value, label_html, count, active) -%} {%- if name in MULTI -%} {#- Multi-select: each link adds or removes its value from the comma list (level=high,critical is high OR critical). -#} {%- set current = chosen(name).split(',')|reject('equalto', '')|list -%} {%- set target = (current|reject('equalto', value|lower)|list) if active else current + [value|lower] -%} {%- set target = target|join(',') -%} {%- else -%}{%- set target = '' if active else value -%}{%- endif -%} {{ label_html }}{{ count|num }} {%- endmacro %} {% macro is_active(name, value) %}{% if name in MULTI %}{{ (value|lower) in chosen(name).split(',') }}{% else %}{{ (params[name]|lower) == (value|lower) }}{% endif %}{% endmacro %} {% macro facet(name, label, rows, kind='text', open=true, filter=false) %}
{{ label }} {% if filter and rows|length > 6 %}{% endif %} {% if not filter and rows|length > 6 %}
Show {{ rows|length - 6 }} more
    {% for value, text, n in rows[6:] %}{% set active = is_active(name, value) == 'True' %}{% if not active %}{{ facet_link(name, value, (''|safe) ~ text ~ (''|safe), n, active) }}{% endif %}{% endfor %}
{% endif %}
{% endmacro %}

Search

{% if chips %}{% endif %} {% if error %}{% endif %} {% for hint in hints %}
{{ icon('about') }}

{{ hint }}

{% endfor %} {% if rows %}

{{ total|num }} rule{{ 's' if total != 1 }}{% if families %} in {{ families|num }} famil{{ 'ies' if families != 1 else 'y' }}{% endif %} match{{ 'es' if total == 1 }}{% if documents %} · {{ documents|num }} files, {{ (documents - total)|num }} {{ 'was a copy' if documents - total == 1 else 'were copies' }}{% endif %}{% if not params.deprecated or not params.junk %} · {% if not params.deprecated %}deprecated{% endif %}{% if not params.deprecated and not params.junk %} and {% endif %}{% if not params.junk %}junk{% endif %} rules hidden: show them{% endif %}

{{ hidden(['sort']) }}
{{ icon('list') }}Cards{{ icon('table') }}Table {{ icon('export') }}Export all {{ total|num }}
{% if view == 'table' %}
{% for r in rows %} {% endfor %}
RuleLog sourceLevelATT&CKSourcesLicence
{{ r.title|mark(terms) if r.title else '(untitled)' }}{{ r.author or 'unknown author' }}{% if r.modified %} · {{ r.modified }}{% endif %} {{ logsource(r) }}{{ lvl(r.level) }} {% for tid, name in r.techniques[:2] %}{{ tech(tid, name) }}{% endfor %} {{ r.n_sources }}{{ lic(r.licence) }}
{% else %}
    {% for r in rows %}{{ card(r, terms) }}{% endfor %}
{% endif %}
0 selected
{% if pages > 1 %}{% endif %} {% elif not error %}

No rules match{% if q %} "{{ q }}"{% endif %}{% if chips|length > (1 if q else 0) %} with these filters{% endif %}

{% if text_only %}

{{ text_only|num }} rule{{ 's' if text_only != 1 }} match the text alone. Remove a filter:

{% elif chips %}

Remove a filter or try other words.

{% else %}

Try other words, or one of the examples above.

{% endif %} {% if chips and text_only %}
    {% for c in chips %}
  • {{ c.label }} {{ c.value or 'on' }} {{ icon('x') }}
  • {% endfor %}
{% endif %}
{% endif %}
{% endblock %}