Skip to content

Commit

Permalink
Removed labels from stats script (#477)
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Mar 11, 2022
1 parent 0ce9e8e commit 3402187
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 49 deletions.
2 changes: 1 addition & 1 deletion artifacts/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
"""ForensicArtifacts.com Artifact Repository."""

__version__ = '20220219'
__version__ = '20220311'
4 changes: 2 additions & 2 deletions config/dpkg/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
artifacts (20220219-1) unstable; urgency=low
artifacts (20220311-1) unstable; urgency=low

* Auto-generated

-- Forensic artifacts <forensicartifacts@googlegroups.com> Sat, 19 Feb 2022 12:56:06 +0100
-- Forensic artifacts <forensicartifacts@googlegroups.com> Fri, 11 Mar 2022 12:26:53 +0100
43 changes: 8 additions & 35 deletions docs/sources/background/Stats.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
The artifact definitions can be found in the [data directory](https://github.com/ForensicArtifacts/artifacts/tree/main/data)
and the format is described in detail in the [Style Guide](https://artifacts.readthedocs.io/en/latest/sources/Format-specification.html).

Status of the repository as of 2022-02-19
Status of the repository as of 2022-03-11

Description | Number
--- | ---
Number of artifact definitions: | 623
Number of file paths: | 1685
Number of artifact definitions: | 628
Number of file paths: | 1690
Number of Windows Registry key paths: | 680

### Artifact definition source types
Expand All @@ -17,9 +17,8 @@ Identifier | Number
--- | ---
ARTIFACT_GROUP | 24
COMMAND | 9
DIRECTORY | 14
FILE | 357
PATH | 13
FILE | 361
PATH | 28
REGISTRY_KEY | 55
REGISTRY_VALUE | 124
WMI | 27
Expand All @@ -28,33 +27,7 @@ WMI | 27

Identifier | Number
--- | ---
Darwin | 48
Linux | 40
Windows | 39

### Labels

Identifier | Number
--- | ---
Antivirus | 8
Authentication | 19
Browser | 33
Cloud | 2
Cloud Storage | 4
Configuration Files | 52
Containerd | 2
Docker | 2
Execution | 3
External Media | 2
ExternalAccount | 3
Hadoop | 1
History Files | 3
Kubernetes | 11
Logs | 55
Mail | 15
Network | 19
Software | 45
System | 117
Users | 77
iOS | 5
Darwin | 49
Linux | 41
Windows | 40

11 changes: 0 additions & 11 deletions tools/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class ArtifactStatistics(object):
def __init__(self):
"""Initializes artifact statistics."""
super(ArtifactStatistics, self).__init__()
self._label_counts = {}
self._os_counts = {}
self._path_count = 0
self._reg_key_count = 0
Expand Down Expand Up @@ -43,10 +42,6 @@ def PrintOSTable(self):
"""Prints a table of artifact definitions by operating system."""
self._PrintDictAsTable('Operating systems', self._os_counts)

def PrintLabelTable(self):
"""Prints a table of artifact definitions by label."""
self._PrintDictAsTable('Labels', self._label_counts)

def PrintSourceTypeTable(self):
"""Prints a table of artifact definitions by source type."""
self._PrintDictAsTable(
Expand All @@ -69,18 +64,13 @@ def PrintSummaryTable(self):
def BuildStats(self):
"""Builds the statistics."""
artifact_reader = reader.YamlArtifactsReader()
self._label_counts = {}
self._os_counts = {}
self._path_count = 0
self._reg_key_count = 0
self._source_type_counts = {}
self._total_count = 0

for artifact_definition in artifact_reader.ReadDirectory('data'):
if hasattr(artifact_definition, 'labels'):
for label in artifact_definition.labels:
self._label_counts[label] = self._label_counts.get(label, 0) + 1

for source in artifact_definition.sources:
self._total_count += 1
source_type = source.type_indicator
Expand Down Expand Up @@ -113,7 +103,6 @@ def PrintStats(self):
self.PrintSummaryTable()
self.PrintSourceTypeTable()
self.PrintOSTable()
self.PrintLabelTable()


def Main():
Expand Down

0 comments on commit 3402187

Please sign in to comment.