Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit e8db0fe

Browse files
authored
Merge pull request #10 from AtlasInsideCorp/dev
Dev
2 parents 4d1f20c + a7c2234 commit e8db0fe

File tree

4 files changed

+39
-25
lines changed

4 files changed

+39
-25
lines changed

beats.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ func startBeat() {
2222
case "windows":
2323
runOnce.Do(func() {
2424
result, err := execute(
25-
filepath.Join(path, "beats", "windows", "winlogbeat", "winlogbeat.exe"),
26-
filepath.Join(path, "beats", "windows", "winlogbeat"),
25+
filepath.Join(path, "beats", "winlogbeat", "winlogbeat.exe"),
26+
filepath.Join(path, "beats", "winlogbeat"),
2727
"--strict.perms=false",
2828
"-c",
2929
"winlogbeat.yml",
@@ -59,7 +59,7 @@ func configureBeat(ip string) error {
5959

6060
switch runtime.GOOS {
6161
case "windows":
62-
configFile := filepath.Join(path, "beats", "windows", "winlogbeat", "winlogbeat.yml")
62+
configFile := filepath.Join(path, "beats", "winlogbeat", "winlogbeat.yml")
6363
templateFile := filepath.Join(path, "templates", "winlogbeat.yml")
6464
err := generateFromTemplate(config, templateFile, configFile)
6565
if err != nil {

bitmap.ico

179 KB
Binary file not shown.

cmd.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
package main
22

33
import (
4+
"errors"
45
"os/exec"
56
)
67

78
func execute(c string, dir string, arg ...string) (string, bool) {
89
cmd := exec.Command(c, arg...)
10+
911
cmd.Dir = dir
12+
if errors.Is(cmd.Err, exec.ErrDot) {
13+
cmd.Err = nil
14+
}
15+
1016
out, err := cmd.Output()
1117
if err != nil {
1218
return string(out[:]) + err.Error(), true

templates/winlogbeat.yml

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
1-
winlogbeat.event_logs:
2-
- name: Application
3-
ignore_older: 72h
4-
- name: Security
5-
- name: System
6-
7-
#==================== Elasticsearch template setting ==========================
8-
setup.template.settings:
9-
index.number_of_shards: 3
10-
11-
#----------------------------- Logstash output --------------------------------
12-
output.logstash:
13-
hosts: ['{{ .IP }}:5044']
14-
ssl.certificate_authorities: ['{{.CA}}']
15-
ssl.certificate: '{{.ClientCert}}'
16-
ssl.key: '{{.ClientKey}}'
17-
ssl.verification_mode: none
18-
19-
#================================ Processors =====================================
20-
processors:
21-
- add_host_metadata: ~
22-
- add_cloud_metadata: ~
1+
winlogbeat.event_logs:
2+
- name: Application
3+
ignore_older: 72h
4+
- name: System
5+
- name: Security
6+
- name: Microsoft-Windows-Sysmon/Operational
7+
- name: Windows PowerShell
8+
event_id: 400, 403, 600, 800
9+
- name: Microsoft-Windows-PowerShell/Operational
10+
event_id: 4103, 4104, 4105, 4106
11+
- name: ForwardedEvents
12+
tags: [forwarded]
13+
14+
#==================== Elasticsearch template setting ==========================
15+
setup.template.settings:
16+
index.number_of_shards: 3
17+
18+
#----------------------------- Logstash output --------------------------------
19+
output.logstash:
20+
hosts: ['{{ .IP }}:5044']
21+
ssl.certificate_authorities: ['{{.CA}}']
22+
ssl.certificate: '{{.ClientCert}}'
23+
ssl.key: '{{.ClientKey}}'
24+
ssl.verification_mode: none
25+
26+
#================================ Processors =====================================
27+
processors:
28+
- add_host_metadata:
29+
when.not.contains.tags: forwarded
30+
- add_cloud_metadata: ~

0 commit comments

Comments
 (0)