feat: 1.5.0 incident management (tickets from egress findings, triage, comments, suppression with expiry)
Release / Publish tags (push) Successful in 14s
Release / Plan (reuse the published image?) (push) Successful in 5s
Release / ci (push) Successful in 1m14s
Release / Build image (amd64) (push) Successful in 24s
Release / Build image (arm64) (push) Successful in 1m13s
CI / Format and vet (push) Successful in 41s
CI / Tests (Linux, race detector) (push) Successful in 1m1s
CI / Dependency audit (push) Successful in 33s
CI / Docker image (build and smoke test) (push) Skipped
Release / Gitea release (push) Successful in 4s
Release / Publish tags (push) Successful in 14s
Release / Plan (reuse the published image?) (push) Successful in 5s
Release / ci (push) Successful in 1m14s
Release / Build image (amd64) (push) Successful in 24s
Release / Build image (arm64) (push) Successful in 1m13s
CI / Format and vet (push) Successful in 41s
CI / Tests (Linux, race detector) (push) Successful in 1m1s
CI / Dependency audit (push) Successful in 33s
CI / Docker image (build and smoke test) (push) Skipped
Release / Gitea release (push) Successful in 4s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3ae72e27d6
commit
e5058968e2
22 files changed
+2651
-20
No files matched your search
@@ -22,6 +22,10 @@ type Finding struct {
|
||||
Last int64 `json:"last"`
|
||||
Detail string `json:"detail"`
|
||||
Host string `json:"host,omitempty"`
|
||||
// Ticket fields are filled by the server from the incident store.
|
||||
TicketID string `json:"ticket_id"`
|
||||
TicketStatus string `json:"ticket_status"`
|
||||
Suppressed bool `json:"suppressed"`
|
||||
// Samples are the unix times of the last connections (beacons only, at most MaxSamples).
|
||||
Samples []int64 `json:"samples,omitempty"`
|
||||
}
|
||||
@@ -286,6 +290,15 @@ func clip(s string) string {
|
||||
}
|
||||
|
||||
// Sanitize bounds an untrusted peer report and stamps it with the peer name.
|
||||
// KnownKind reports whether k is a finding kind produced by the engine.
|
||||
func KnownKind(k string) bool {
|
||||
switch k {
|
||||
case "scan", "bad_dst", "tor", "port", "dns_bypass", "new_geo", "beacon", "infra":
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (r *Report) Sanitize(host string) {
|
||||
if len(r.Workloads) > maxPeerWorkloads {
|
||||
r.Workloads = r.Workloads[:maxPeerWorkloads]
|
||||
@@ -303,6 +316,14 @@ func (r *Report) Sanitize(host string) {
|
||||
w := &r.Workloads[i]
|
||||
w.Name, w.Role, w.Host = clip(w.Name), clip(w.Role), host
|
||||
}
|
||||
// a peer may send only the kinds this package produces; the rest is dropped
|
||||
kept := r.Findings[:0]
|
||||
for _, f := range r.Findings {
|
||||
if KnownKind(f.Kind) {
|
||||
kept = append(kept, f)
|
||||
}
|
||||
}
|
||||
r.Findings = kept
|
||||
for i := range r.Findings {
|
||||
f := &r.Findings[i]
|
||||
f.ID, f.Kind, f.Severity = host+":"+clip(f.ID), clip(f.Kind), clip(f.Severity)
|
||||
|
||||
Reference in new issue
Block a user