Skip to content

Commit

Permalink
Merge pull request SigmaHQ#3002 from phantinuss/master
Browse files Browse the repository at this point in the history
Various new Rule Tests
  • Loading branch information
Neo23x0 authored May 11, 2022
2 parents 4b829c4 + 6f92a11 commit 2b0db86
Show file tree
Hide file tree
Showing 175 changed files with 533 additions and 610 deletions.
6 changes: 2 additions & 4 deletions rules/cloud/azure/azure_kubernetes_admission_controller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ logsource:
service: activitylogs
detection:
selection1:
properties.message|startswith:
- MICROSOFT.KUBERNETES/CONNECTEDCLUSTERS/ADMISSIONREGISTRATION.K8S.IO
properties.message|startswith: MICROSOFT.KUBERNETES/CONNECTEDCLUSTERS/ADMISSIONREGISTRATION.K8S.IO
properties.message|endswith:
- /MUTATINGWEBHOOKCONFIGURATIONS/WRITE
- /VALIDATINGWEBHOOKCONFIGURATIONS/WRITE
selection2:
properties.message|startswith:
- MICROSOFT.CONTAINERSERVICE/MANAGEDCLUSTERS/ADMISSIONREGISTRATION.K8S.IO
properties.message|startswith: MICROSOFT.CONTAINERSERVICE/MANAGEDCLUSTERS/ADMISSIONREGISTRATION.K8S.IO
properties.message|endswith:
- /MUTATINGWEBHOOKCONFIGURATIONS/WRITE
- /VALIDATINGWEBHOOKCONFIGURATIONS/WRITE
Expand Down
8 changes: 3 additions & 5 deletions rules/cloud/azure/azure_kubernetes_cronjob.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@ logsource:
service: activitylogs
detection:
selection1:
properties.message|startswith:
- MICROSOFT.KUBERNETES/CONNECTEDCLUSTERS/BATCH
properties.message|startswith: MICROSOFT.KUBERNETES/CONNECTEDCLUSTERS/BATCH
properties.message|endswith:
- /CRONJOBS/WRITE
- /JOBS/WRITE
selection2:
properties.message|startswith:
- MICROSOFT.CONTAINERSERVICE/MANAGEDCLUSTERS/BATCH
properties.message|startswith: MICROSOFT.CONTAINERSERVICE/MANAGEDCLUSTERS/BATCH
properties.message|endswith:
- /CRONJOBS/WRITE
- /JOBS/WRITE
Expand All @@ -32,5 +30,5 @@ tags:
- attack.privilege_escalation
- attack.execution
falsepositives:
- Azure Kubernetes CronJob/Job may be done by a system administrator.
- Azure Kubernetes CronJob/Job may be done by a system administrator.
- If known behavior is causing false positives, it can be exempted from the rule.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ logsource:
service: activitylogs
detection:
selection1:
properties.message:
- MICROSOFT.AUTHORIZATION/ELEVATEACCESS/ACTION
properties.message: MICROSOFT.AUTHORIZATION/ELEVATEACCESS/ACTION
condition: selection1
level: high
falsepositives:
Expand Down
7 changes: 3 additions & 4 deletions rules/cloud/azure/azure_suppression_rule_created.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ logsource:
service: activitylogs
detection:
selection:
properties.message:
- MICROSOFT.SECURITY/ALERTSSUPPRESSIONRULES/WRITE
properties.message: MICROSOFT.SECURITY/ALERTSSUPPRESSIONRULES/WRITE
condition: selection
level: medium
tags:
- attack.impact
falsepositives:
- Suppression Rule being created may be performed by a system administrator.
- Verify whether the user identity, user agent, and/or hostname should be making changes in your environment.
- Suppression Rule being created may be performed by a system administrator.
- Verify whether the user identity, user agent, and/or hostname should be making changes in your environment.
- Suppression Rule created from unfamiliar users should be investigated. If known behavior is causing false positives, it can be exempted from the rule.
10 changes: 4 additions & 6 deletions rules/cloud/gcp/gcp_kubernetes_admission_controller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@ logsource:
service: gcp.audit
detection:
selection1:
gcp.audit.method_name|startswith:
- admissionregistration.k8s.io.v*.mutatingwebhookconfigurations.
gcp.audit.method_name|endswith:
gcp.audit.method_name|startswith: admissionregistration.k8s.io.v*.mutatingwebhookconfigurations.
gcp.audit.method_name|endswith:
- create
- patch
- replace
selection2:
gcp.audit.method_name|startswith:
- admissionregistration.k8s.io.v*.validatingwebhookconfigurations.
gcp.audit.method_name|endswith:
gcp.audit.method_name|startswith: admissionregistration.k8s.io.v*.validatingwebhookconfigurations.
gcp.audit.method_name|endswith:
- create
- patch
- replace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ detection:
status: success
condition: selection
falsepositives:
-
- Unknown
level: medium
tags:
- attack.initial_access
Expand Down
3 changes: 1 addition & 2 deletions rules/cloud/okta/okta_unauthorized_access_to_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ logsource:
service: okta
detection:
selection:
displaymessage:
- User attempted unauthorized access to app
displaymessage: User attempted unauthorized access to app
condition: selection
level: medium
tags:
Expand Down
3 changes: 1 addition & 2 deletions rules/compliance/workstation_was_locked.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ logsource:
service: security
detection:
selection:
EventID:
- 4800
EventID: 4800
condition: selection
falsepositives:
- Unknown
Expand Down
9 changes: 3 additions & 6 deletions rules/linux/auditd/lnx_auditd_audio_capture.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@ logsource:
detection:
selection:
type: EXECVE
a0:
- arecord
a1:
- '-vv'
a2:
- '-fdat'
a0: arecord
a1: '-vv'
a2: '-fdat'
condition: selection
tags:
- attack.collection
Expand Down
3 changes: 1 addition & 2 deletions rules/linux/auditd/lnx_auditd_susp_c2_commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ logsource:
service: auditd
detection:
selection:
key:
- 'susp_activity'
key: 'susp_activity'
condition: selection
falsepositives:
- Admin or User activity
Expand Down
2 changes: 1 addition & 1 deletion rules/linux/auditd/lnx_auditd_susp_histfile_operations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fields:
- key
falsepositives:
- Legitimate administrative activity
- Ligitimate software, cleaning hist file
- Legitimate software, cleaning hist file
level: medium
tags:
- attack.credential_access
Expand Down
5 changes: 2 additions & 3 deletions rules/linux/auditd/lnx_auditd_systemd_service_creation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ detection:
type: 'PATH'
nametype: 'CREATE'
name_1:
name|startswith:
name|startswith:
- '/usr/lib/systemd/system/'
- '/etc/systemd/system/'
name_2:
name|contains:
- '/.config/systemd/user/'
name|contains: '/.config/systemd/user/'
condition: path and 1 of name_*
falsepositives:
- Admin work like legit service installs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ logsource:
detection:
commands:
type: EXECVE
a0:
- unzip
a0: unzip
a1:
a1|endswith:
- '.jpg'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: f8341cb2-ee25-43fa-a975-d8a5a9714b39
status: experimental
description: Detects the usage of the unsafe bpftrace option
author: Andreas Hunkeler (@Karneades)
tags:
tags:
- attack.execution
- attack.t1059.004
references:
Expand All @@ -15,10 +15,8 @@ logsource:
product: linux
detection:
selection1:
Image|endswith:
- 'bpftrace'
CommandLine|contains:
- '--unsafe'
Image|endswith: 'bpftrace'
CommandLine|contains: '--unsafe'
condition: selection1
falsepositives:
- Legitimate usage of the unsafe option
Expand Down
18 changes: 6 additions & 12 deletions rules/linux/process_creation/proc_creation_lnx_local_account.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,19 @@ logsource:
product: linux
detection:
selection_1:
Image|endswith:
- '/lastlog'
Image|endswith: '/lastlog'
selection_2:
CommandLine|contains:
- '''x:0:'''
CommandLine|contains: '''x:0:'''
selection_3:
Image|endswith:
- '/cat'
Image|endswith: '/cat'
CommandLine|contains:
- '/etc/passwd'
- '/etc/sudoers'
selection_4:
Image|endswith:
- '/id'
Image|endswith: '/id'
selection_5:
Image|endswith:
- '/lsof'
CommandLine|contains:
- '-u'
Image|endswith: '/lsof'
CommandLine|contains: '-u'
condition: 1 of selection*
falsepositives:
- Legitimate administration activities
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@ logsource:
product: linux
detection:
selection_1:
Image|endswith:
- '/groups'
Image|endswith: '/groups'
selection_2:
Image|endswith:
- '/cat'
CommandLine|contains:
- '/etc/group'
Image|endswith: '/cat'
CommandLine|contains: '/etc/group'
condition: 1 of selection*
falsepositives:
- Legitimate administration activities
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ logsource:
product: linux
detection:
selection:
Image|endswith:
- 'crontab'
CommandLine|contains:
- '/tmp/'
Image|endswith: 'crontab'
CommandLine|contains: '/tmp/'
condition: selection
falsepositives:
- Legitimate administration activities
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Detects suspicious sub processes of web server processes
references:
- https://www.acunetix.com/blog/articles/web-shells-101-using-php-introduction-web-shells-part-2/
date: 2021/10/15
modified: 2022/03/14
modified: 2022/05/09
author: Florian Roth
tags:
- attack.persistence
Expand All @@ -26,18 +26,18 @@ detection:
ParentCommandLine|contains|all:
- '/bin/java'
- 'tomcat'
selection_websphere: # ? just guessing
selection_websphere: # ? just guessing
ParentCommandLine|contains|all:
- '/bin/java'
- 'websphere'
selection_sub_processes:
Image|endswith:
Image|endswith:
- '/whoami'
- '/ifconfig'
- '/usr/bin/ip'
- '/bin/uname'
condition: selection_sub_processes and ( selection_general or selection_tomcat )
condition: selection_sub_processes and ( selection_general or selection_tomcat or selection_websphere)
falsepositives:
- Web applications that invoke Linux command line tools
- Web applications that invoke Linux command line tools
level: critical

Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ logsource:
product: macos
detection:
selection:
Image|endswith:
- '/osascript'
CommandLine|contains|all:
- '-e'
Image|endswith: '/osascript'
CommandLine|contains: '-e'
condition: selection
falsepositives:
- Application installers might contain scripts as part of the installation process.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,11 @@ logsource:
category: process_creation
detection:
selection1:
Image|endswith:
- '/truncate'
CommandLine|contains:
- '-s'
Image|endswith: '/truncate'
CommandLine|contains: '-s'
selection2:
Image|endswith:
- '/dd'
CommandLine|contains:
- 'if='
Image|endswith: '/dd'
CommandLine|contains: 'if='
filter:
CommandLine|contains: 'of='
condition: selection1 or (selection2 and not filter)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ logsource:
product: macos
detection:
selection:
Image|endswith:
- '/dscl'
CommandLine|contains:
- 'create'
Image|endswith: '/dscl'
CommandLine|contains: 'create'
condition: selection
falsepositives:
- Legitimate administration activities
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ logsource:
category: process_creation
detection:
selection1:
Image|endswith:
- '/grep'
CommandLine|contains:
- 'password'
Image|endswith: '/grep'
CommandLine|contains: 'password'
selection2:
CommandLine|contains: 'laZagne'
condition: selection1 or selection2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ logsource:
category: process_creation
detection:
selection1:
Image:
- '/usr/sbin/osascript'
Image: '/usr/sbin/osascript'
selection2:
CommandLine|contains|all:
- '-e'
Expand Down
Loading

0 comments on commit 2b0db86

Please sign in to comment.