@@ -6,104 +6,6 @@ import (
66 "io"
77)
88
9- // -------- Rules --------
10-
11- type Rule struct {
12- ID int `json:"id,omitempty"`
13- Name string `json:"name"`
14- Description string `json:"description,omitempty"`
15- Tags []string `json:"tags"`
16- Details Details `json:"details"`
17- Version int `json:"version,omitempty"`
18- }
19-
20- type Details struct {
21- // Containers
22- Containers * Containers `json:"containers,omitempty"`
23-
24- // Filesystems
25- ReadWritePaths * ReadWritePaths `json:"readWritePaths,omitempty"`
26- ReadPaths * ReadPaths `json:"readPaths,omitempty"`
27-
28- // Network
29- AllOutbound bool `json:"allOutbound,omitempty"`
30- AllInbound bool `json:"allInbound,omitempty"`
31- TCPListenPorts * TCPListenPorts `json:"tcpListenPorts,omitempty"`
32- UDPListenPorts * UDPListenPorts `json:"udpListenPorts,omitempty"`
33-
34- // Processes
35- Processes * Processes `json:"processes,omitempty"`
36-
37- // Syscalls
38- Syscalls * Syscalls `json:"syscalls,omitempty"`
39-
40- // Falco
41- Append * bool `json:"append,omitempty"`
42- Source string `json:"source,omitempty"`
43- Output string `json:"output,omitempty"`
44- Condition * Condition `json:"condition,omitempty"`
45- Priority string `json:"priority,omitempty"`
46- Exceptions []* Exception `json:"exceptions,omitempty"`
47-
48- RuleType string `json:"ruleType"`
49- }
50-
51- type Containers struct {
52- Items []string `json:"items"`
53- MatchItems bool `json:"matchItems"`
54- }
55-
56- type ReadWritePaths struct {
57- Items []string `json:"items"`
58- MatchItems bool `json:"matchItems"`
59- }
60- type ReadPaths struct {
61- Items []string `json:"items"`
62- MatchItems bool `json:"matchItems"`
63- }
64-
65- type TCPListenPorts struct {
66- Items []string `json:"items"`
67- MatchItems bool `json:"matchItems"`
68- }
69-
70- type UDPListenPorts struct {
71- Items []string `json:"items"`
72- MatchItems bool `json:"matchItems"`
73- }
74-
75- type Processes struct {
76- Items []string `json:"items"`
77- MatchItems bool `json:"matchItems"`
78- }
79-
80- type Syscalls struct {
81- Items []string `json:"items"`
82- MatchItems bool `json:"matchItems"`
83- }
84-
85- type Condition struct {
86- Condition string `json:"condition"`
87- Components []interface {} `json:"components"`
88- }
89-
90- type Exception struct {
91- Name string `json:"name"`
92- Fields interface {} `json:"fields,omitempty"`
93- Comps interface {} `json:"comps,omitempty"`
94- Values interface {} `json:"values,omitempty"`
95- }
96-
97- func (r * Rule ) ToJSON () io.Reader {
98- payload , _ := json .Marshal (r )
99- return bytes .NewBuffer (payload )
100- }
101-
102- func RuleFromJSON (body []byte ) (rule Rule , err error ) {
103- err = json .Unmarshal (body , & rule )
104- return
105- }
106-
1079// -------- VulnerabilityExceptionList --------
10810
10911type VulnerabilityExceptionList struct {
0 commit comments