d3fend / d3fend-ontology

This repository holds the necessary content to produce the D3FEND ontology distribution.
https://d3fend.mitre.org
MIT License
60 stars 28 forks source link

Automate mappings to data sources in attack_update script #238

Open netfl0 opened 7 months ago

netfl0 commented 7 months ago

feature/238-automate-mappings-to-data-sources-in-attack_update-script @ikiril01

netfl0 commented 7 months ago

9c67018c3b941bf685c49f1ea3f97053a3233be2

not sure what why commit didn't show up from the linked branch...

aamedina commented 7 months ago

How can I help on this?

netfl0 commented 7 months ago

@ikiril01 is going to have something here shortly, I stubbed out the onto design pattern.

ikiril01 commented 7 months ago

I added the remaining ATT&CK data source mappings here: https://github.com/d3fend/d3fend-ontology/compare/feature/238-automate-mappings-to-data-sources-in-attack_update-script...ikiril01:d3fend-ontology:feature/238-automate-mappings-to-data-sources-in-attack_update-script

Here are some comments on the data sources that didn't have exact mappings. EDIT - strikethrough for those that have been added as new digital artifacts or are deemed no longer necessary:

ikiril01 commented 6 months ago

Added Malware/Malware Repository and related classes for having a more accurate mapping to DS0004:

Added Malware/MalwareRepository classes Updated seeAlso to isDefinedBy for MaliciousSoftware Updated DS0004 mapping to MalwareRepository

ikiril01 commented 6 months ago

Added Disk Image for having a more accurate mapping to DS0007

Added DiskImage for use with VM images etc.; update DS0007 mapping ac…

ikiril01 commented 6 months ago

In the DBPedia entry for Event Logging (https://dbpedia.org/page/Logging_(software)) they mention as errors etc. being events, so this actually lines up with the ATT&CK data source description for Sensor Health. Accordingly, I updated DS0013 as being an exact mapping to Event Log.

https://github.com/ikiril01/d3fend-ontology/commit/680e991d97b9508273ad98f225a80372d052f1b2

ikiril01 commented 6 months ago

Struggling a bit on how to accurately model Kubernetes Pods (based on https://attack.mitre.org/datasources/DS0014/) in D3FEND. The problem is that pods are an abstraction (i.e., grouping containers that share namespaces and volumes and are typically designed for a single use-case) on Containers, and therefore they don't inherently encapsulate Container Images or Container Runtimes. Kubernetes has their definition here: https://kubernetes.io/docs/concepts/workloads/pods/

aamedina commented 6 months ago

Struggling a bit on how to accurately model Kubernetes Pods (based on https://attack.mitre.org/datasources/DS0014/) in D3FEND. The problem is that pods are an abstraction (i.e., grouping containers that share namespaces and volumes and are typically designed for a single use-case) on Containers, and therefore they don't inherently encapsulate Container Images or Container Runtimes. Kubernetes has their definition here: https://kubernetes.io/docs/concepts/workloads/pods/

Can you share a draft class for the Pod? My initial impression are its basic semantics are d3f:Pod d3f:contains d3f:ContainerImage and d3f:Pod d3f:runs d3f:ContainerProcess. I use d3f:contains for its transitivity during inference across artifacts in a knowledge graph, so if container images "contain" other artifacts of interest connected by the ontology, I could find them in a SPARQL query starting with the d3f:Pod individual transitively.

ikiril01 commented 6 months ago

Struggling a bit on how to accurately model Kubernetes Pods (based on https://attack.mitre.org/datasources/DS0014/) in D3FEND. The problem is that pods are an abstraction (i.e., grouping containers that share namespaces and volumes and are typically designed for a single use-case) on Containers, and therefore they don't inherently encapsulate Container Images or Container Runtimes. Kubernetes has their definition here: https://kubernetes.io/docs/concepts/workloads/pods/

Can you share a draft class for the Pod? My initial impression are its basic semantics are d3f:Pod d3f:contains d3f:ContainerImage and d3f:Pod d3f:runs d3f:ContainerProcess. I use d3f:contains for its transitivity during inference across artifacts in a knowledge graph, so if container images "contain" other artifacts of interest connected by the ontology, I could find them in a SPARQL query starting with the d3f:Pod individual transitively.

What you suggested is along the lines of what was I thinking of: d3f:Pod contains multiple d3f:ContainerImage and d3f:Pod runs multiple d3f:ContainerProcess. However - this describes a running Pod, but Pods can also be deployed and not running. This is my struggle, as I feel like even Pods that are not running can be considered as Digital Artifacts since they provide information on their respective Containers etc. Maybe I'm just being overly pedantic here.

aamedina commented 6 months ago

Struggling a bit on how to accurately model Kubernetes Pods (based on https://attack.mitre.org/datasources/DS0014/) in D3FEND. The problem is that pods are an abstraction (i.e., grouping containers that share namespaces and volumes and are typically designed for a single use-case) on Containers, and therefore they don't inherently encapsulate Container Images or Container Runtimes. Kubernetes has their definition here: https://kubernetes.io/docs/concepts/workloads/pods/

Can you share a draft class for the Pod? My initial impression are its basic semantics are d3f:Pod d3f:contains d3f:ContainerImage and d3f:Pod d3f:runs d3f:ContainerProcess. I use d3f:contains for its transitivity during inference across artifacts in a knowledge graph, so if container images "contain" other artifacts of interest connected by the ontology, I could find them in a SPARQL query starting with the d3f:Pod individual transitively.

What you suggested is along the lines of what was I thinking of: d3f:Pod contains multiple d3f:ContainerImage and d3f:Pod runs multiple d3f:ContainerProcess. However - this describes a running Pod, but Pods can also be deployed and not running. This is my struggle, as I feel like even Pods that are not running can be considered as Digital Artifacts since they provide information on their respective Containers etc. Maybe I'm just being overly pedantic here.

The way I interpret this is not that every individual pod is necessarily "running", but that semantically Pods "run" ContainerProcesses. Also I think this is where the some/all logical distinction comes into play w/OWL but I am not 100% on that...

ikiril01 commented 6 months ago

Struggling a bit on how to accurately model Kubernetes Pods (based on https://attack.mitre.org/datasources/DS0014/) in D3FEND. The problem is that pods are an abstraction (i.e., grouping containers that share namespaces and volumes and are typically designed for a single use-case) on Containers, and therefore they don't inherently encapsulate Container Images or Container Runtimes. Kubernetes has their definition here: https://kubernetes.io/docs/concepts/workloads/pods/

Can you share a draft class for the Pod? My initial impression are its basic semantics are d3f:Pod d3f:contains d3f:ContainerImage and d3f:Pod d3f:runs d3f:ContainerProcess. I use d3f:contains for its transitivity during inference across artifacts in a knowledge graph, so if container images "contain" other artifacts of interest connected by the ontology, I could find them in a SPARQL query starting with the d3f:Pod individual transitively.

What you suggested is along the lines of what was I thinking of: d3f:Pod contains multiple d3f:ContainerImage and d3f:Pod runs multiple d3f:ContainerProcess. However - this describes a running Pod, but Pods can also be deployed and not running. This is my struggle, as I feel like even Pods that are not running can be considered as Digital Artifacts since they provide information on their respective Containers etc. Maybe I'm just being overly pedantic here.

The way I interpret this is not that every individual pod is necessarily "running", but that semantically Pods "run" ContainerProcesses. Also I think this is where the some/all logical distinction comes into play w/OWL but I am not 100% on that...

Thanks - that is helpful. I agree, if we say may-run and may-contain, that should cover both running and not running cases. I'll go in that direction.

ikiril01 commented 6 months ago

Added Pod and subsequently updated DS0014 mappings to "exactly".

https://github.com/ikiril01/d3fend-ontology/blob/feature/238-automate-mappings-to-data-sources-in-attack_update-script/src/ontology/d3fend-protege.ttl#L3800-L3810

ikiril01 commented 6 months ago

Added NamePipe and subsequently updated DS0023 mapping to "exactly".

https://github.com/ikiril01/d3fend-ontology/commit/a20ef4967b4041768ef49a83f2763b13b292adfe

ikiril01 commented 5 months ago

After reading the Wikipedia page on Secondary Storage more closely, I think it maps nearly exactly to ATT&CK's definition of "Drive", so I updated the mapping accordingly.

ikiril01 commented 5 months ago

Added SoftwareTelemetryLog/EndpointSensorTelemetryLog for mapping to DS0013: Sensory Health.

https://github.com/ikiril01/d3fend-ontology/commit/f39ee1137e3ae788421e97bec578334900c1b22d

ikiril01 commented 5 months ago

Added Snapshot/VM Snapshot/Volume Snapshot.

https://github.com/ikiril01/d3fend-ontology/commit/1f0edb21143542dda2e34b7e5a1c43eebca53188

ikiril01 commented 5 months ago

Added User Profile for mapping to DS0021 (Persona).

https://github.com/ikiril01/d3fend-ontology/commit/7daef98ff3611a08ee56f7a0c24f1758a7563d25

ikiril01 commented 4 months ago

Added Discovery Network Traffic for mapping to DS0035 (Internet Scan).

https://github.com/ikiril01/d3fend-ontology/commit/b667e34dcde5e3dbd939292482689221c3236d3d

ikiril01 commented 4 months ago

Added Asset Metadata for mapping to DS0039 (Asset).

https://github.com/ikiril01/d3fend-ontology/commit/119c840ebf48ec45c567af0ae87ca31bf50b0d5f

ikiril01 commented 4 months ago

Added Historian/Process Databases for mapping to DS0040 (Operational Database).

https://github.com/ikiril01/d3fend-ontology/commit/50a289360b298669b077c15be032e34a892326e5

ikiril01 commented 4 months ago

Current mappings. New digital artifacts in bold, low confidence mappings in italics with question marks.

ATT&CK DS ID ATT&CK DS Name Mapping Type D3FEND DA Mapping
DS0001 Firmware (ATTACK) exactly Firmware
DS0002 User Account (ATTACK) exactly UserAccount
DS0003 Scheduled Job (ATTACK) exactly ScheduledJob
DS0004 Malware Repository (ATTACK) exactly MalwareRepository
DS0005 WMI (ATTACK) narrower SystemServiceSoftware ??
DS0006 Web Credential (ATTACK) exactly Credential
DS0007 Image (ATTACK) exactly DiskImage
DS0008 Kernel (ATTACK) exactly Kernel
DS0009 Process (ATTACK) exactly Process
DS0010 Cloud Storage (ATTACK) exactly CloudStorage
DS0011 Module (ATTACK) exactly ObjectFile
DS0012 Script (ATTACK) exactly ExecutableScript
DS0013 Sensor Health (ATTACK) exactly EndpointSensorTelemetryLog
DS0014 Pod (ATTACK) exactly Pod
DS0015 Application Log (ATTACK) exactly Log
DS0016 Drive (ATTACK) exactly SecondaryStorage
DS0017 Command (ATTACK) exactly Command
DS0018 Firewall (ATTACK) exactly Firewall
DS0019 Service (ATTACK) exactly ServiceApplicationProcess ??
DS0020 Snapshot (ATTACK) exactly VolumeSnapshot
DS0021 Persona (ATTACK) broader UserProfile
DS0022 File (ATTACK) exactly File
DS0023 Named Pipe (ATTACK) exactly NamedPipe
DS0024 Windows Registry (ATTACK) exactly WindowsRegistry
DS0025 Cloud Service (ATTACK) narrower Software ??
DS0026 Active Directory (ATTACK) exactly SystemConfigurationDatabase ??
DS0027 Driver (ATTACK) exactly HardwareDriver
DS0028 Logon Session (ATTACK)" exactly LoginSession
DS0029 Network Traffic (ATTACK) exactly NetworkTraffic
DS0030 Instance (ATTACK) broader Server ??
DS0032 Container (ATTACK) exactly ContainerImage
DS0033 Network Share (ATTACK) narrower FileShareService
DS0034 Volume (ATTACK) exactly Volume
DS0035 Internet Scan (ATTACK) exactly DiscoveryNetworkTraffic
DS0036 Group (ATTACK) exactly UserGroup
DS0037 Certificate exactly Certificate
DS0038 Domain Name exactly DomainName
DS0039 Asset (ATTACK) broader AssetMetadata
DS0040 Operational Database (ATTACK) narrower HistorianDatabase, ProcessDatabase
DS0041 Application Vetting (ATTACK) exactly CodeAnalyzer
DS0042 User Interface (ATTACK) exactly GraphicalUserInterface