diff --git a/book/index.md b/book/index.md new file mode 100644 index 0000000..dcbc828 --- /dev/null +++ b/book/index.md @@ -0,0 +1,3 @@ +# STORM + +An intro page. diff --git a/book/macros.tera b/book/macros.tera index cd9a1a9..9aecf59 100644 --- a/book/macros.tera +++ b/book/macros.tera @@ -40,10 +40,27 @@ {{ value["doc"]["name"] }} ([{{ value["id"] }}]({{ value["id"] | domain_id_link }})) {%- endmacro name_and_id_link %} -{% macro summary_list(instances) -%} +{% macro summary_table(instances) -%} | ID | Name | |:---------------------------:|:------------------------| {% for item in instances -%} | [{{ item.id }}]({{ item.id | domain_id_link }}) | {{ item.name }} | {% endfor %} -{%- endmacro summary_list %} +{%- endmacro summary_table %} + +{% macro summary_list(instances) %} +{%- set last_domain = "" -%} +{%- set last_model = "" -%} +{%- for item in summary -%} +{%- set id_parts = item.id | domain_id -%} +{%- if last_domain != id_parts.domain -%} +{%- set_global last_domain = id_parts.domain %} +# {{ id_parts.domain | capitalize }} +{%- endif -%} +{%- if last_model != id_parts.model -%} +{%- set_global last_model = id_parts.model %} +- [{{ id_parts.model | capitalize }}](.{{ item.id | domain_id_link(for="model") }}) +{%- endif %} + - [{{ item.name }}](.{{ item.id | domain_id_link }}) +{%- endfor -%} +{% endmacro summary_list %} \ No newline at end of file diff --git a/book/observe/event.tera b/book/observe/event.tera index 655336c..cd3e493 100644 --- a/book/observe/event.tera +++ b/book/observe/event.tera @@ -4,4 +4,4 @@ Observable items use to detect and respond to threat actor behaviour. -{{ macros::summary_list(instances=instances) }} +{{ macros::summary_table(instances=instances) }} diff --git a/book/react/action.tera b/book/react/action.tera index 0dd53fe..0077f47 100644 --- a/book/react/action.tera +++ b/book/react/action.tera @@ -2,4 +2,4 @@ # Action -{{ macros::summary_list(instances=instances) }} +{{ macros::summary_table(instances=instances) }} diff --git a/book/react/stage.tera b/book/react/stage.tera index f998054..17571fc 100644 --- a/book/react/stage.tera +++ b/book/react/stage.tera @@ -4,4 +4,4 @@ Phase of a response to observed threat behaviour. -{{ macros::summary_list(instances=instances) }} +{{ macros::summary_table(instances=instances) }} diff --git a/book/source/intelligence.tera b/book/source/intelligence.tera index d30f595..8798965 100644 --- a/book/source/intelligence.tera +++ b/book/source/intelligence.tera @@ -4,4 +4,4 @@ Feed or result of a query used to satisfy intelligence requirements. -{{ macros::summary_list(instances=instances) }} +{{ macros::summary_table(instances=instances) }} diff --git a/book/source/provider.tera b/book/source/provider.tera index 9e16b46..12d6a29 100644 --- a/book/source/provider.tera +++ b/book/source/provider.tera @@ -4,4 +4,4 @@ An internal or external supplier of intelligence. -{{ macros::summary_list(instances=instances) }} +{{ macros::summary_table(instances=instances) }} diff --git a/book/source/requirement.tera b/book/source/requirement.tera index 2f246e5..a803c1b 100644 --- a/book/source/requirement.tera +++ b/book/source/requirement.tera @@ -4,4 +4,4 @@ Collection of intelligence used by actions, detections and mitigations. -{{ macros::summary_list(instances=instances) }} +{{ macros::summary_table(instances=instances) }} diff --git a/book/summary.tera b/book/summary.tera index 021832f..9bd5108 100644 --- a/book/summary.tera +++ b/book/summary.tera @@ -1,16 +1,7 @@ +{% import "macros.tera" as macros %} + # Summary -{%- set last_domain = "" -%} -{%- set last_model = "" -%} -{%- for item in summary -%} -{%- set id_parts = item.id | domain_id -%} -{%- if last_domain != id_parts.domain -%} -{%- set_global last_domain = id_parts.domain %} -# {{ id_parts.domain | capitalize }} -{%- endif -%} -{%- if last_model != id_parts.model -%} -{%- set_global last_model = id_parts.model %} -- [{{ id_parts.model | capitalize }}](.{{ item.id | domain_id_link(for="model") }}) -{%- endif %} - - [{{ item.name }}](.{{ item.id | domain_id_link }}) -{%- endfor -%} +[STORM](./index.md) + +{{ macros::summary_list(instances) }}