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

Removed Hardcoded Config Values #334

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Changes from all commits
Commits
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
109 changes: 0 additions & 109 deletions server/infohandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"net/http"
"os"

"github.com/security-onion-solutions/securityonion-soc/config"
"github.com/security-onion-solutions/securityonion-soc/licensing"
"github.com/security-onion-solutions/securityonion-soc/model"
"github.com/security-onion-solutions/securityonion-soc/web"
Expand Down Expand Up @@ -62,113 +61,5 @@ func (h *InfoHandler) getInfo(w http.ResponseWriter, r *http.Request) {
SrvToken: srvToken,
}

{
detections := &info.Parameters.DetectionsParams

detections.ViewEnabled = true
detections.CreateLink = "/detection/create"
detections.EventFetchLimit = 500
detections.EventItemsPerPage = 50
detections.GroupFetchLimit = 50
detections.MostRecentlyUsedLimit = 5
detections.SafeStringMaxLength = 100
detections.QueryBaseFilter = "_index:\"*:so-detection\" AND so_kind:detection"
detections.EventFields = map[string][]string{
"default": {
"so_detection.title",
"so_detection.isEnabled",
"so_detection.engine",
"@timestamp",
},
}
detections.Queries = []*config.HuntingQuery{
{
Name: "All",
Query: "_id:*",
},
{
Name: "Local Rules",
Query: "* AND so_detection.isCommunity:false",
},
{
Name: "Enabled",
Query: "so_detection.isEnabled:true",
},
{
Name: "Disabled",
Query: "so_detection.isEnabled:false",
},
{
Name: "Suricata",
Query: "so_detection.engine:suricata",
},
{
Name: "ElastAlert",
Query: "so_detection.engine:elastalert",
},
{
Name: "Suricata Enabled",
Query: "so_detection.engine:suricata AND so_detection.isEnabled:true",
},
{
Name: "Suricata Disabled",
Query: "so_detection.engine:suricata AND so_detection.isEnabled:false",
},
{
Name: "ElastAlert Enabled",
Query: "so_detection.engine:elastalert AND so_detection.isEnabled:true",
},
{
Name: "ElastAlert Disabled",
Query: "so_detection.engine:elastalert AND so_detection.isEnabled:false",
},
}
}

{
detection := &info.Parameters.DetectionParams

detection.Presets = map[string]config.PresetParameters{
"severity": {
CustomEnabled: false,
Labels: []string{"unknown", "informational", "low", "medium", "high", "critical"},
},
"engine": {
CustomEnabled: false,
Labels: []string{"suricata", "elastalert"},
},
}

detection.SeverityTranslations = map[string]string{
// informational and critical already map correctly
"minor": "low",
"major": "high",
}
}

{
playbooks := &info.Parameters.PlaybooksParams

playbooks.ViewEnabled = true
playbooks.CreateLink = "/playbook/create"
playbooks.EventFetchLimit = 500
playbooks.EventItemsPerPage = 50
playbooks.GroupFetchLimit = 50
playbooks.MostRecentlyUsedLimit = 5
playbooks.QueryBaseFilter = "_index:\"*:so-detection\" AND so_kind:playbook"
playbooks.SafeStringMaxLength = 100
playbooks.Queries = []*config.HuntingQuery{
{Query: "*"},
}
playbooks.EventFields = map[string][]string{
"default": {
"soc_timestamp",
"so_playbook.title",
"so_playbook.publicId",
"so_playbook.mechanism",
},
}
}

web.Respond(w, r, http.StatusOK, info)
}
Loading