Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Support - Detections Module #353

Merged
merged 115 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
bec7b5b
WIP: Demo + CleanUp
coreyogburn Aug 25, 2023
648e2b5
WIP: More Detections Work
coreyogburn Sep 1, 2023
4541e9b
WIP: Suricata Rule Parsing
coreyogburn Sep 8, 2023
f4d1eaf
WIP: alerts
coreyogburn Sep 20, 2023
13c03c4
WIP: Various improvements
coreyogburn Sep 21, 2023
9ab8827
WIP: Tests
coreyogburn Sep 22, 2023
7baf618
WIP: Modulaization and Elastic Index Change
coreyogburn Sep 25, 2023
a411b08
WIP: Tests
coreyogburn Sep 26, 2023
ea0e6f5
WIP: Sync Community Detections
coreyogburn Sep 29, 2023
654b438
WIP: Community Detections Sync
coreyogburn Sep 29, 2023
5cb9925
Service Account Ctx, Community Rules, permissions
coreyogburn Oct 3, 2023
c4c66fb
WIP: GetAll that gets all
coreyogburn Oct 5, 2023
77ecfb0
WIP: Tightening Suricata Bolts
coreyogburn Oct 11, 2023
341a563
Early implementation of ElastAlert's DetectionEngine.
coreyogburn Oct 19, 2023
1c849e3
WIP: ElastAlert
coreyogburn Oct 26, 2023
064f4e7
WIP ElastAlert Improvements
coreyogburn Nov 6, 2023
6328360
WIP: License Text, Linting
coreyogburn Nov 7, 2023
db72d14
WIP: Overrides in the Tuning Tab
coreyogburn Nov 16, 2023
a9cba2f
WIP: Save Overrides
coreyogburn Nov 27, 2023
4111311
WIP: Overrides
coreyogburn Nov 28, 2023
8313d92
WIP: Track Options, Override UpdatedAt
coreyogburn Nov 28, 2023
0b14887
WIP: ElastAlert enable new community detections
coreyogburn Nov 30, 2023
5adb48a
WIP: Post-Rebase go mod tidy
coreyogburn Dec 19, 2023
679479c
WIP: ElastAlertEngine Tests
coreyogburn Dec 20, 2023
c8bb0cb
WIP: Yara Parser
coreyogburn Dec 29, 2023
3c8f628
WIP: Bulk Actions, Removal of Date Range from Detections Search
coreyogburn Jan 11, 2024
5eafeb9
WIP: Fix for removed Date Range from Detections
coreyogburn Jan 11, 2024
64984cd
WIP: Async Bulk Operations
coreyogburn Jan 17, 2024
594c2b8
WIP: Strelka/Yara Community Rule Import, ElastAlert now translates wi…
coreyogburn Jan 29, 2024
7549c63
WIP: Fix Suricata Parser Bug
coreyogburn Jan 30, 2024
c4d9fe1
WIP: Cleanup
coreyogburn Jan 31, 2024
abd6ba0
WIP: First pass at including sigma-cli in the dockerfile
coreyogburn Jan 31, 2024
c6502fd
WIP: Remove Custom Config, Suricata Community Rules Start Disabled
coreyogburn Feb 1, 2024
17f3d30
WIP: Fix Sigma Shebang, Copy Site-Packages to New Location
coreyogburn Feb 1, 2024
529a15f
Merge pull request #333 from Security-Onion-Solutions/cogburn/detecti…
coreyogburn Feb 1, 2024
587b9b3
WIP: Removed Hardcoded Config Values
coreyogburn Feb 2, 2024
1fba19b
Merge pull request #334 from Security-Onion-Solutions/cogburn/detecti…
coreyogburn Feb 2, 2024
1b33e45
WIP: Detection History
coreyogburn Feb 2, 2024
93bdb05
Merge pull request #335 from Security-Onion-Solutions/cogburn/detecti…
coreyogburn Feb 2, 2024
b592063
WIP: UI Changes
coreyogburn Feb 6, 2024
b1e8346
WIP: Detection Tags, Ruleset, and Language
coreyogburn Feb 6, 2024
7aecfc2
Revise Quicklinks
defensivedepth Feb 7, 2024
d4c8f5c
Add support for sigma pipelines
defensivedepth Feb 8, 2024
449787d
Merge remote-tracking branch 'origin/cogburn/detections_playbooks' in…
defensivedepth Feb 8, 2024
3c02be7
WIP: Reworked UI
coreyogburn Feb 8, 2024
ed5e0e5
Merge pull request #338 from Security-Onion-Solutions/cogburn/detecti…
coreyogburn Feb 8, 2024
460c643
WIP: UI Updates
coreyogburn Feb 8, 2024
47ee245
WIP: Fix References
coreyogburn Feb 9, 2024
64143e7
WIP: License, Rule Extracted Data
coreyogburn Feb 9, 2024
3e68b34
Merge remote-tracking branch 'origin/cogburn/detections_playbooks' in…
defensivedepth Feb 10, 2024
1f9d470
WIP: Updated Tests to Include License Checks
coreyogburn Feb 12, 2024
c324aa7
Merge pull request #341 from Security-Onion-Solutions/cogburn/detecti…
coreyogburn Feb 12, 2024
11f6a8d
Titles for Detections columns
defensivedepth Feb 13, 2024
a05fce1
Dont enable Sigma rules upon import
defensivedepth Feb 13, 2024
d56518b
WIP: Demo + CleanUp
coreyogburn Aug 25, 2023
52d30c7
WIP: More Detections Work
coreyogburn Sep 1, 2023
8963f20
WIP: Suricata Rule Parsing
coreyogburn Sep 8, 2023
1baa496
WIP: alerts
coreyogburn Sep 20, 2023
11e1b09
WIP: Various improvements
coreyogburn Sep 21, 2023
d46987d
WIP: Tests
coreyogburn Sep 22, 2023
a239976
WIP: Modulaization and Elastic Index Change
coreyogburn Sep 25, 2023
1f61e40
WIP: Tests
coreyogburn Sep 26, 2023
04ec7c2
WIP: Sync Community Detections
coreyogburn Sep 29, 2023
3268287
WIP: Community Detections Sync
coreyogburn Sep 29, 2023
e1a9267
Service Account Ctx, Community Rules, permissions
coreyogburn Oct 3, 2023
a9e0e10
WIP: GetAll that gets all
coreyogburn Oct 5, 2023
2774955
WIP: Tightening Suricata Bolts
coreyogburn Oct 11, 2023
af01da5
Early implementation of ElastAlert's DetectionEngine.
coreyogburn Oct 19, 2023
fef8636
WIP: ElastAlert
coreyogburn Oct 26, 2023
59c891a
WIP ElastAlert Improvements
coreyogburn Nov 6, 2023
4cb0d47
WIP: License Text, Linting
coreyogburn Nov 7, 2023
c4320b1
WIP: Overrides in the Tuning Tab
coreyogburn Nov 16, 2023
b18e835
WIP: Save Overrides
coreyogburn Nov 27, 2023
3d0b2a6
WIP: Overrides
coreyogburn Nov 28, 2023
7430141
WIP: Track Options, Override UpdatedAt
coreyogburn Nov 28, 2023
24328d0
WIP: ElastAlert enable new community detections
coreyogburn Nov 30, 2023
05ddbf1
WIP: Post-Rebase go mod tidy
coreyogburn Dec 19, 2023
4029190
WIP: ElastAlertEngine Tests
coreyogburn Dec 20, 2023
38df3b0
WIP: Yara Parser
coreyogburn Dec 29, 2023
67a9bfa
WIP: Bulk Actions, Removal of Date Range from Detections Search
coreyogburn Jan 11, 2024
fea0d27
WIP: Fix for removed Date Range from Detections
coreyogburn Jan 11, 2024
36b6d28
WIP: Async Bulk Operations
coreyogburn Jan 17, 2024
d37e91e
WIP: Strelka/Yara Community Rule Import, ElastAlert now translates wi…
coreyogburn Jan 29, 2024
43f134f
WIP: Fix Suricata Parser Bug
coreyogburn Jan 30, 2024
95b3dee
WIP: Cleanup
coreyogburn Jan 31, 2024
b9efd27
WIP: First pass at including sigma-cli in the dockerfile
coreyogburn Jan 31, 2024
9c6dd15
WIP: Remove Custom Config, Suricata Community Rules Start Disabled
coreyogburn Feb 1, 2024
159ff64
WIP: Fix Sigma Shebang, Copy Site-Packages to New Location
coreyogburn Feb 1, 2024
0f20344
WIP: Removed Hardcoded Config Values
coreyogburn Feb 2, 2024
ac389ef
WIP: Detection History
coreyogburn Feb 2, 2024
21fef2b
WIP: UI Changes
coreyogburn Feb 6, 2024
914e240
WIP: Detection Tags, Ruleset, and Language
coreyogburn Feb 6, 2024
9914a52
WIP: Reworked UI
coreyogburn Feb 8, 2024
88fd8a1
WIP: UI Updates
coreyogburn Feb 8, 2024
0230529
WIP: Fix References
coreyogburn Feb 9, 2024
d375e95
WIP: License, Rule Extracted Data
coreyogburn Feb 9, 2024
4a05909
WIP: Updated Tests to Include License Checks
coreyogburn Feb 12, 2024
a6810b2
WIP: Comments, Permissions
coreyogburn Feb 13, 2024
95fd327
Merge branch 'kilo' into cogburn/detections_playbooks
coreyogburn Feb 13, 2024
124bb75
Merge pull request #348 from Security-Onion-Solutions/cogburn/detecti…
coreyogburn Feb 13, 2024
a603daf
Query parameter can select ActiveTab
coreyogburn Feb 14, 2024
77b7c15
Merge pull request #350 from Security-Onion-Solutions/cogburn/detecti…
coreyogburn Feb 14, 2024
0c262a8
Query parameter can select ActiveTab
coreyogburn Feb 14, 2024
6f3c592
Convert and Test ElastAlert Sigma
coreyogburn Feb 14, 2024
5e806f5
sigmaRulePackages is a string array in the config
coreyogburn Feb 15, 2024
4e9c34e
Tweak Wording
defensivedepth Feb 16, 2024
d8f1414
Switch to Language
defensivedepth Feb 16, 2024
d8d12e0
Merge pull request #351 from Security-Onion-Solutions/patch
defensivedepth Feb 16, 2024
d2979e1
Allow and Deny Regexes per Detection Engine
coreyogburn Feb 16, 2024
0909ad0
Strelka rules are compiled by default but can be disabled
coreyogburn Feb 20, 2024
4df7617
Hide MultiSelect Checkbox unless in Detections
coreyogburn Feb 20, 2024
0942c43
Check for the existence of a template before starting community rule …
coreyogburn Feb 20, 2024
23ef5da
Improvements
coreyogburn Feb 21, 2024
948d6cb
Merge remote-tracking branch 'origin/cogburn/detections_playbooks' in…
defensivedepth Feb 21, 2024
4f27a5b
Merge remote-tracking branch 'origin/2.4/dev' into kilo
defensivedepth Feb 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

FROM ghcr.io/security-onion-solutions/golang:1.21.5-alpine as builder
ARG VERSION=0.0.0
RUN apk update && apk add libpcap-dev bash git musl-dev gcc npm python3 py3-pip py3-virtualenv
RUN apk update && apk add libpcap-dev bash git musl-dev gcc npm python3 py3-pip py3-virtualenv python3-dev openssl-dev linux-headers
COPY . /build
WORKDIR /build
RUN if [ "$VERSION" != "0.0.0" ]; then mkdir gitdocs && cd gitdocs && \
Expand All @@ -22,6 +22,9 @@ RUN if [ "$VERSION" != "0.0.0" ]; then mkdir gitdocs && cd gitdocs && \
RUN npm install jest jest-environment-jsdom --global
RUN ./build.sh "$VERSION"

RUN pip3 install sigma-cli pysigma-backend-elasticsearch pysigma-pipeline-windows yara-python --break-system-packages
RUN sed -i 's/#!\/usr\/bin\/python3/#!\/usr\/bin\/env python/g' /usr/bin/sigma

FROM ghcr.io/security-onion-solutions/python:3-slim

ARG UID=939
Expand All @@ -30,7 +33,7 @@ ARG VERSION=0.0.0
ARG ELASTIC_VERSION=0.0.0
ARG WAZUH_VERSION=0.0.0

RUN apt update -y
RUN apt update -y
RUN apt install -y bash tzdata ca-certificates wget curl tcpdump unzip tshark
RUN update-ca-certificates
RUN addgroup --gid "$GID" socore
Expand All @@ -46,6 +49,8 @@ COPY --from=builder /build/LICENSE .
COPY --from=builder /build/README.md .
COPY --from=builder /build/sensoroni.json .
COPY --from=builder /build/gitdocs/_build/html ./html/docs
COPY --from=builder /usr/lib/python3.11/site-packages /usr/local/lib/python3.9/site-packages
COPY --from=builder /usr/bin/sigma /usr/bin/sigma
RUN find html/js -name "*test*.js" -delete
RUN chmod u+x scripts/*
RUN chown 939:939 scripts/*
Expand Down
5 changes: 5 additions & 0 deletions agent/jobmanager_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright 2020-2023 Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
// or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
// https://securityonion.net/license; you may not use this file except in compliance with the
// Elastic License 2.0.

package agent

import (
Expand Down
52 changes: 34 additions & 18 deletions config/clientparameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,27 @@ const DEFAULT_CHART_LABEL_OTHER_LIMIT = 10
const DEFAULT_CHART_LABEL_FIELD_SEPARATOR = ", "

type ClientParameters struct {
HuntingParams HuntingParameters `json:"hunt"`
AlertingParams HuntingParameters `json:"alerts"`
CasesParams HuntingParameters `json:"cases"`
CaseParams CaseParameters `json:"case"`
DashboardsParams HuntingParameters `json:"dashboards"`
JobParams HuntingParameters `json:"job"`
DocsUrl string `json:"docsUrl"`
CheatsheetUrl string `json:"cheatsheetUrl"`
ReleaseNotesUrl string `json:"releaseNotesUrl"`
GridParams GridParameters `json:"grid"`
WebSocketTimeoutMs int `json:"webSocketTimeoutMs"`
TipTimeoutMs int `json:"tipTimeoutMs"`
ApiTimeoutMs int `json:"apiTimeoutMs"`
CacheExpirationMs int `json:"cacheExpirationMs"`
InactiveTools []string `json:"inactiveTools"`
Tools []ClientTool `json:"tools"`
CasesEnabled bool `json:"casesEnabled"`
EnableReverseLookup bool `json:"enableReverseLookup"`
HuntingParams HuntingParameters `json:"hunt"`
AlertingParams HuntingParameters `json:"alerts"`
CasesParams HuntingParameters `json:"cases"`
CaseParams CaseParameters `json:"case"`
DashboardsParams HuntingParameters `json:"dashboards"`
JobParams HuntingParameters `json:"job"`
DetectionsParams HuntingParameters `json:"detections"`
DetectionParams DetectionParameters `json:"detection"`
PlaybooksParams HuntingParameters `json:"playbooks"`
DocsUrl string `json:"docsUrl"`
CheatsheetUrl string `json:"cheatsheetUrl"`
ReleaseNotesUrl string `json:"releaseNotesUrl"`
GridParams GridParameters `json:"grid"`
WebSocketTimeoutMs int `json:"webSocketTimeoutMs"`
TipTimeoutMs int `json:"tipTimeoutMs"`
ApiTimeoutMs int `json:"apiTimeoutMs"`
CacheExpirationMs int `json:"cacheExpirationMs"`
InactiveTools []string `json:"inactiveTools"`
Tools []ClientTool `json:"tools"`
CasesEnabled bool `json:"casesEnabled"`
EnableReverseLookup bool `json:"enableReverseLookup"`
}

func (config *ClientParameters) Verify() error {
Expand Down Expand Up @@ -186,3 +189,16 @@ type GridParameters struct {
MaxUploadSize uint64 `json:"maxUploadSize,omitempty"`
StaleMetricsMs uint64 `json:"staleMetricsMs,omitempty"`
}

type DetectionParameters struct {
HuntingParameters
Presets map[string]PresetParameters `json:"presets"`
SeverityTranslations map[string]string `json:"severityTranslations"`
}

func (params *DetectionParameters) Verify() error {
err := params.HuntingParameters.Verify()

return err

}
1 change: 1 addition & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@ func LoadConfig(filename string, version string, buildTime time.Time) (*Config,
err = cfg.Server.Verify()
}
}

return cfg, err
}
26 changes: 23 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/security-onion-solutions/securityonion-soc

go 1.20
go 1.21

require (
github.com/apex/log v1.9.0
Expand All @@ -20,19 +20,39 @@ require (
)

require (
github.com/go-git/go-git/v5 v5.11.0
github.com/pkg/errors v0.9.1
github.com/samber/lo v1.39.0
github.com/tj/assert v0.0.3
go.uber.org/mock v0.3.0
)

require (
dario.cat/mergo v1.0.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/cloudflare/circl v1.3.3 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/elastic/elastic-transport-go/v8 v8.3.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.5.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/influxdata/line-protocol v0.0.0-20210922203350-b1ad95c89adf // indirect
github.com/oapi-codegen/runtime v1.1.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/oapi-codegen/runtime v1.0.0 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/skeema/knownhosts v1.2.1 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/tools v0.16.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
)
Loading
Loading