summaryrefslogtreecommitdiff
path: root/countries_motives_sectors_tables.py
diff options
context:
space:
mode:
authorW. Kosior <koszko@koszko.org>2025-01-29 21:38:25 +0100
committerW. Kosior <koszko@koszko.org>2025-01-29 21:38:25 +0100
commit87c5edbd25f3d95684029d36ae9bdd1ccba53262 (patch)
tree628324550651d255f18d73605c6ba47746abb49d /countries_motives_sectors_tables.py
parent25a949412c58713cf8226866328d879791bdf057 (diff)
downloadAGH-threat-intel-course-magister.tar.gz
AGH-threat-intel-course-magister.zip
Adjust tables for inclusion in target documentHEADmagister
Diffstat (limited to 'countries_motives_sectors_tables.py')
-rwxr-xr-xcountries_motives_sectors_tables.py42
1 files changed, 26 insertions, 16 deletions
diff --git a/countries_motives_sectors_tables.py b/countries_motives_sectors_tables.py
index 2ba2fc6..196379e 100755
--- a/countries_motives_sectors_tables.py
+++ b/countries_motives_sectors_tables.py
@@ -181,11 +181,6 @@ ignored_groups = [
"PachaGroup", "PinchySpider", "Rocke", "SaltySpider", "Yingmob",
"ZombieSpider", "Avalanche", "Boss Spider", "CobaltGroup",
"Cron", "GCMAN", "RetefeGang", "SharkSpider", "VenomSpider",
- # We also omit APT5 because neither the NSA'a Threat Hunting Guidance nor
- # the description from
- # https://web.archive.org/web/20180806122230/https://www.fireeye.com/current-threats/apt-groups.html
- # actually state its origin.
- "APT5"
]
for group in groups_data["groups"]:
@@ -218,18 +213,33 @@ all_traits = [trait for score, trait in all_traits
all_origins = sorted(groups_by_origin)
all_origin_labels = [origin_labels[origin] for origin in all_origins]
-print("{")
-print("\\footnotesize")
-print("\\rowcolors{3}{gray!20}{white!100}")
-print("\\renewcommand*{\\arraystretch}{1.3}")
+origin_heads = ' & '.join(
+ f"\\nohyphens{{\\bfseries {text}}}" for text in all_origin_labels
+)
+type_cap = table_type[0].upper() + table_type[1:]
+head = f"""\
+\\rowcolor{{gray!40}}
+\\bfseries {type_cap} & {origin_heads} & \\bfseries total APT count \\\\"""
+
print("""\
-\\begin{longtable}{\
-p{0.3\\textwidth} \
-p{0.65in} p{0.65in} p{0.65in} p{0.65in} \
->{\\centering\\arraybackslash} p{0.85in} \
-}""")
-print(f"{table_type} & {' & '.join(all_origin_labels)} & total APT count \\\\")
-print("\\hline\\hline \\endhead")
+{
+\\footnotesize
+
+\\begin{longtable}{>{\\raggedright\\arraybackslash}p{1.2in} p{0.76in} p{0.76in} p{0.76in} p{0.76in} >{\centering\\arraybackslash} p{0.65in} }
+
+\\rowcolor{white}
+\\caption{\\nexttabcaption} \\label{\\nexttablabel} \\\\""")
+print(head)
+print("\\endfirsthead")
+print(head)
+print("""
+\\endhead
+
+\\rowcolor{white}
+\\multicolumn{6}{r}{\\textit{Continued on next page}} \\\\
+\\endfoot
+
+\\endlastfoot""")
all_percentages = []