Skip to content

Commit f3d5ac1

Browse files
committed
Revert "chore: static sig metadata declaration"
This reverts commit 7bb2d59. commit: ed8304d (main), cherry-pick
1 parent 29a0e29 commit f3d5ac1

31 files changed

+462
-524
lines changed

signatures/golang/anti_debugging_ptraceme.go

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,28 @@ type AntiDebuggingPtraceme struct {
1414
ptraceTraceMe string
1515
}
1616

17-
var antiDebuggingPtracemeMetada = detect.SignatureMetadata{
18-
ID: "TRC-102",
19-
Version: "1",
20-
Name: "Anti-Debugging detected",
21-
EventName: "anti_debugging",
22-
Description: "A process used anti-debugging techniques to block a debugger. Malware use anti-debugging to stay invisible and inhibit analysis of their behavior.",
23-
Properties: map[string]interface{}{
24-
"Severity": 1,
25-
"Category": "defense-evasion",
26-
"Technique": "Debugger Evasion",
27-
"Kubernetes_Technique": "",
28-
"id": "attack-pattern--e4dc8c01-417f-458d-9ee0-bb0617c1b391",
29-
"external_id": "T1622",
30-
},
31-
}
32-
3317
func (sig *AntiDebuggingPtraceme) Init(ctx detect.SignatureContext) error {
3418
sig.cb = ctx.Callback
3519
sig.ptraceTraceMe = "PTRACE_TRACEME"
3620
return nil
3721
}
3822

3923
func (sig *AntiDebuggingPtraceme) GetMetadata() (detect.SignatureMetadata, error) {
40-
return antiDebuggingPtracemeMetada, nil
24+
return detect.SignatureMetadata{
25+
ID: "TRC-102",
26+
Version: "1",
27+
Name: "Anti-Debugging detected",
28+
EventName: "anti_debugging",
29+
Description: "A process used anti-debugging techniques to block a debugger. Malware use anti-debugging to stay invisible and inhibit analysis of their behavior.",
30+
Properties: map[string]interface{}{
31+
"Severity": 1,
32+
"Category": "defense-evasion",
33+
"Technique": "Debugger Evasion",
34+
"Kubernetes_Technique": "",
35+
"id": "attack-pattern--e4dc8c01-417f-458d-9ee0-bb0617c1b391",
36+
"external_id": "T1622",
37+
},
38+
}, nil
4139
}
4240

4341
func (sig *AntiDebuggingPtraceme) GetSelectedEvents() ([]detect.SignatureEventSelector, error) {

signatures/golang/aslr_inspection.go

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,28 @@ type AslrInspection struct {
1414
aslrPath string
1515
}
1616

17-
var aslrInspectionMetadata = detect.SignatureMetadata{
18-
ID: "TRC-109",
19-
Version: "1",
20-
Name: "ASLR inspection detected",
21-
EventName: "aslr_inspection",
22-
Description: "The ASLR (address space layout randomization) configuration was inspected. ASLR is used by Linux to prevent memory vulnerabilities. An adversary may want to inspect and change the ASLR configuration in order to avoid detection.",
23-
Properties: map[string]interface{}{
24-
"Severity": 0,
25-
"Category": "privilege-escalation",
26-
"Technique": "Exploitation for Privilege Escalation",
27-
"Kubernetes_Technique": "",
28-
"id": "attack-pattern--b21c3b2d-02e6-45b1-980b-e69051040839",
29-
"external_id": "T1068",
30-
},
31-
}
32-
3317
func (sig *AslrInspection) Init(ctx detect.SignatureContext) error {
3418
sig.cb = ctx.Callback
3519
sig.aslrPath = "/proc/sys/kernel/randomize_va_space"
3620
return nil
3721
}
3822

3923
func (sig *AslrInspection) GetMetadata() (detect.SignatureMetadata, error) {
40-
return aslrInspectionMetadata, nil
24+
return detect.SignatureMetadata{
25+
ID: "TRC-109",
26+
Version: "1",
27+
Name: "ASLR inspection detected",
28+
EventName: "aslr_inspection",
29+
Description: "The ASLR (address space layout randomization) configuration was inspected. ASLR is used by Linux to prevent memory vulnerabilities. An adversary may want to inspect and change the ASLR configuration in order to avoid detection.",
30+
Properties: map[string]interface{}{
31+
"Severity": 0,
32+
"Category": "privilege-escalation",
33+
"Technique": "Exploitation for Privilege Escalation",
34+
"Kubernetes_Technique": "",
35+
"id": "attack-pattern--b21c3b2d-02e6-45b1-980b-e69051040839",
36+
"external_id": "T1068",
37+
},
38+
}, nil
4139
}
4240

4341
func (sig *AslrInspection) GetSelectedEvents() ([]detect.SignatureEventSelector, error) {

signatures/golang/cgroup_notify_on_release_modification.go

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,28 @@ type CgroupNotifyOnReleaseModification struct {
1515
notifyFileName string
1616
}
1717

18-
var cgroupNotifyOnReleaseModificationMetadata = detect.SignatureMetadata{
19-
ID: "TRC-106",
20-
Version: "1",
21-
Name: "Cgroups notify_on_release file modification",
22-
EventName: "cgroup_notify_on_release",
23-
Description: "An attempt to modify Cgroup notify_on_release file was detected. Cgroups are a Linux kernel feature which limits the resource usage of a set of processes. Adversaries may use this feature for container escaping.",
24-
Properties: map[string]interface{}{
25-
"Severity": 3,
26-
"Category": "privilege-escalation",
27-
"Technique": "Escape to Host",
28-
"Kubernetes_Technique": "",
29-
"id": "attack-pattern--4a5b7ade-8bb5-4853-84ed-23f262002665",
30-
"external_id": "T1611",
31-
},
32-
}
33-
3418
func (sig *CgroupNotifyOnReleaseModification) Init(ctx detect.SignatureContext) error {
3519
sig.cb = ctx.Callback
3620
sig.notifyFileName = "notify_on_release"
3721
return nil
3822
}
3923

4024
func (sig *CgroupNotifyOnReleaseModification) GetMetadata() (detect.SignatureMetadata, error) {
41-
return cgroupNotifyOnReleaseModificationMetadata, nil
25+
return detect.SignatureMetadata{
26+
ID: "TRC-106",
27+
Version: "1",
28+
Name: "Cgroups notify_on_release file modification",
29+
EventName: "cgroup_notify_on_release",
30+
Description: "An attempt to modify Cgroup notify_on_release file was detected. Cgroups are a Linux kernel feature which limits the resource usage of a set of processes. Adversaries may use this feature for container escaping.",
31+
Properties: map[string]interface{}{
32+
"Severity": 3,
33+
"Category": "privilege-escalation",
34+
"Technique": "Escape to Host",
35+
"Kubernetes_Technique": "",
36+
"id": "attack-pattern--4a5b7ade-8bb5-4853-84ed-23f262002665",
37+
"external_id": "T1611",
38+
},
39+
}, nil
4240
}
4341

4442
func (sig *CgroupNotifyOnReleaseModification) GetSelectedEvents() ([]detect.SignatureEventSelector, error) {

signatures/golang/cgroup_release_agent_modification.go

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,28 @@ type CgroupReleaseAgentModification struct {
1515
releaseAgentName string
1616
}
1717

18-
var cgroupReleaseAgentModificationMetadata = detect.SignatureMetadata{
19-
ID: "TRC-1010",
20-
Version: "1",
21-
Name: "Cgroups release agent file modification",
22-
EventName: "cgroup_release_agent",
23-
Description: "An attempt to modify Cgroup release agent file was detected. Cgroups are a Linux kernel feature which limits the resource usage of a set of processes. Adversaries may use this feature for container escaping.",
24-
Properties: map[string]interface{}{
25-
"Severity": 3,
26-
"Category": "privilege-escalation",
27-
"Technique": "Escape to Host",
28-
"Kubernetes_Technique": "",
29-
"id": "attack-pattern--4a5b7ade-8bb5-4853-84ed-23f262002665",
30-
"external_id": "T1611",
31-
},
32-
}
33-
3418
func (sig *CgroupReleaseAgentModification) Init(ctx detect.SignatureContext) error {
3519
sig.cb = ctx.Callback
3620
sig.releaseAgentName = "release_agent"
3721
return nil
3822
}
3923

4024
func (sig *CgroupReleaseAgentModification) GetMetadata() (detect.SignatureMetadata, error) {
41-
return cgroupReleaseAgentModificationMetadata, nil
25+
return detect.SignatureMetadata{
26+
ID: "TRC-1010",
27+
Version: "1",
28+
Name: "Cgroups release agent file modification",
29+
EventName: "cgroup_release_agent",
30+
Description: "An attempt to modify Cgroup release agent file was detected. Cgroups are a Linux kernel feature which limits the resource usage of a set of processes. Adversaries may use this feature for container escaping.",
31+
Properties: map[string]interface{}{
32+
"Severity": 3,
33+
"Category": "privilege-escalation",
34+
"Technique": "Escape to Host",
35+
"Kubernetes_Technique": "",
36+
"id": "attack-pattern--4a5b7ade-8bb5-4853-84ed-23f262002665",
37+
"external_id": "T1611",
38+
},
39+
}, nil
4240
}
4341

4442
func (sig *CgroupReleaseAgentModification) GetSelectedEvents() ([]detect.SignatureEventSelector, error) {

signatures/golang/core_pattern_modification.go

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,28 @@ type CorePatternModification struct {
1515
corePattern string
1616
}
1717

18-
var corePatternModificationMetadata = detect.SignatureMetadata{
19-
ID: "TRC-1011",
20-
Version: "1",
21-
Name: "Core dumps configuration file modification detected",
22-
EventName: "core_pattern_modification",
23-
Description: "Modification of the core dump configuration file (core_pattern) detected. Core dumps are usually written to disk when a program crashes. Certain modifications enable container escaping through the kernel core_pattern feature.",
24-
Properties: map[string]interface{}{
25-
"Severity": 3,
26-
"Category": "privilege-escalation",
27-
"Technique": "Escape to Host",
28-
"Kubernetes_Technique": "",
29-
"id": "attack-pattern--4a5b7ade-8bb5-4853-84ed-23f262002665",
30-
"external_id": "T1611",
31-
},
32-
}
33-
3418
func (sig *CorePatternModification) Init(ctx detect.SignatureContext) error {
3519
sig.cb = ctx.Callback
3620
sig.corePattern = "/proc/sys/kernel/core_pattern"
3721
return nil
3822
}
3923

4024
func (sig *CorePatternModification) GetMetadata() (detect.SignatureMetadata, error) {
41-
return corePatternModificationMetadata, nil
25+
return detect.SignatureMetadata{
26+
ID: "TRC-1011",
27+
Version: "1",
28+
Name: "Core dumps configuration file modification detected",
29+
EventName: "core_pattern_modification",
30+
Description: "Modification of the core dump configuration file (core_pattern) detected. Core dumps are usually written to disk when a program crashes. Certain modifications enable container escaping through the kernel core_pattern feature.",
31+
Properties: map[string]interface{}{
32+
"Severity": 3,
33+
"Category": "privilege-escalation",
34+
"Technique": "Escape to Host",
35+
"Kubernetes_Technique": "",
36+
"id": "attack-pattern--4a5b7ade-8bb5-4853-84ed-23f262002665",
37+
"external_id": "T1611",
38+
},
39+
}, nil
4240
}
4341

4442
func (sig *CorePatternModification) GetSelectedEvents() ([]detect.SignatureEventSelector, error) {

signatures/golang/default_loader_modification.go

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,6 @@ type DefaultLoaderModification struct {
1616
compiledRegex *regexp.Regexp
1717
}
1818

19-
var defaultLoaderModificationMetadata = detect.SignatureMetadata{
20-
ID: "TRC-1012",
21-
Version: "1",
22-
Name: "Default dynamic loader modification detected",
23-
EventName: "default_loader_mod",
24-
Description: "The default dynamic loader has been modified. The dynamic loader is an executable file loaded to process memory and run before the executable to load dynamic libraries to the process. An attacker might use this technique to hijack the execution context of each new process and bypass defenses.",
25-
Properties: map[string]interface{}{
26-
"Severity": 3,
27-
"Category": "defense-evasion",
28-
"Technique": "Hijack Execution Flow",
29-
"Kubernetes_Technique": "",
30-
"id": "attack-pattern--aedfca76-3b30-4866-b2aa-0f1d7fd1e4b6",
31-
"external_id": "T1574",
32-
},
33-
}
34-
3519
func (sig *DefaultLoaderModification) Init(ctx detect.SignatureContext) error {
3620
var err error
3721
sig.cb = ctx.Callback
@@ -41,7 +25,21 @@ func (sig *DefaultLoaderModification) Init(ctx detect.SignatureContext) error {
4125
}
4226

4327
func (sig *DefaultLoaderModification) GetMetadata() (detect.SignatureMetadata, error) {
44-
return defaultLoaderModificationMetadata, nil
28+
return detect.SignatureMetadata{
29+
ID: "TRC-1012",
30+
Version: "1",
31+
Name: "Default dynamic loader modification detected",
32+
EventName: "default_loader_mod",
33+
Description: "The default dynamic loader has been modified. The dynamic loader is an executable file loaded to process memory and run before the executable to load dynamic libraries to the process. An attacker might use this technique to hijack the execution context of each new process and bypass defenses.",
34+
Properties: map[string]interface{}{
35+
"Severity": 3,
36+
"Category": "defense-evasion",
37+
"Technique": "Hijack Execution Flow",
38+
"Kubernetes_Technique": "",
39+
"id": "attack-pattern--aedfca76-3b30-4866-b2aa-0f1d7fd1e4b6",
40+
"external_id": "T1574",
41+
},
42+
}, nil
4543
}
4644

4745
func (sig *DefaultLoaderModification) GetSelectedEvents() ([]detect.SignatureEventSelector, error) {

signatures/golang/disk_mount.go

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,28 @@ type DiskMount struct {
1515
devDir string
1616
}
1717

18-
var diskMountMetadata = detect.SignatureMetadata{
19-
ID: "TRC-1014",
20-
Version: "1",
21-
Name: "Container device mount detected",
22-
EventName: "disk_mount",
23-
Description: "Container device filesystem mount detected. A mount of a host device filesystem can be exploited by adversaries to perform container escape.",
24-
Properties: map[string]interface{}{
25-
"Severity": 3,
26-
"Category": "privilege-escalation",
27-
"Technique": "Escape to Host",
28-
"Kubernetes_Technique": "",
29-
"id": "attack-pattern--4a5b7ade-8bb5-4853-84ed-23f262002665",
30-
"external_id": "T1611",
31-
},
32-
}
33-
3418
func (sig *DiskMount) Init(ctx detect.SignatureContext) error {
3519
sig.cb = ctx.Callback
3620
sig.devDir = "/dev/"
3721
return nil
3822
}
3923

4024
func (sig *DiskMount) GetMetadata() (detect.SignatureMetadata, error) {
41-
return diskMountMetadata, nil
25+
return detect.SignatureMetadata{
26+
ID: "TRC-1014",
27+
Version: "1",
28+
Name: "Container device mount detected",
29+
EventName: "disk_mount",
30+
Description: "Container device filesystem mount detected. A mount of a host device filesystem can be exploited by adversaries to perform container escape.",
31+
Properties: map[string]interface{}{
32+
"Severity": 3,
33+
"Category": "privilege-escalation",
34+
"Technique": "Escape to Host",
35+
"Kubernetes_Technique": "",
36+
"id": "attack-pattern--4a5b7ade-8bb5-4853-84ed-23f262002665",
37+
"external_id": "T1611",
38+
},
39+
}, nil
4240
}
4341

4442
func (sig *DiskMount) GetSelectedEvents() ([]detect.SignatureEventSelector, error) {

signatures/golang/docker_abuse.go

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,28 @@ type DockerAbuse struct {
1515
dockerSock string
1616
}
1717

18-
var dockerAbuseMetadata = detect.SignatureMetadata{
19-
ID: "TRC-1019",
20-
Version: "1",
21-
Name: "Docker socket abuse detected",
22-
EventName: "docker_abuse",
23-
Description: "An attempt to abuse the Docker UNIX socket inside a container was detected. docker.sock is the UNIX socket that Docker uses as the entry point to the Docker API. Adversaries may attempt to abuse this socket to compromise the system.",
24-
Properties: map[string]interface{}{
25-
"Severity": 2,
26-
"Category": "privilege-escalation",
27-
"Technique": "Exploitation for Privilege Escalation",
28-
"Kubernetes_Technique": "",
29-
"id": "attack-pattern--b21c3b2d-02e6-45b1-980b-e69051040839",
30-
"external_id": "T1068",
31-
},
32-
}
33-
3418
func (sig *DockerAbuse) Init(ctx detect.SignatureContext) error {
3519
sig.cb = ctx.Callback
3620
sig.dockerSock = "docker.sock"
3721
return nil
3822
}
3923

4024
func (sig *DockerAbuse) GetMetadata() (detect.SignatureMetadata, error) {
41-
return dockerAbuseMetadata, nil
25+
return detect.SignatureMetadata{
26+
ID: "TRC-1019",
27+
Version: "1",
28+
Name: "Docker socket abuse detected",
29+
EventName: "docker_abuse",
30+
Description: "An attempt to abuse the Docker UNIX socket inside a container was detected. docker.sock is the UNIX socket that Docker uses as the entry point to the Docker API. Adversaries may attempt to abuse this socket to compromise the system.",
31+
Properties: map[string]interface{}{
32+
"Severity": 2,
33+
"Category": "privilege-escalation",
34+
"Technique": "Exploitation for Privilege Escalation",
35+
"Kubernetes_Technique": "",
36+
"id": "attack-pattern--b21c3b2d-02e6-45b1-980b-e69051040839",
37+
"external_id": "T1068",
38+
},
39+
}, nil
4240
}
4341

4442
func (sig *DockerAbuse) GetSelectedEvents() ([]detect.SignatureEventSelector, error) {

0 commit comments

Comments
 (0)