98b8295f4a
- Wire policy CRUD (the policies table existed from 0001 but had no endpoint; policies already render in the compiler, so this closes that loop). - Add blrules (blacklist/whitelist) and conntrack resources: migration 0005, model types, id-keyed store CRUD (generation-bumping), and REST handlers. Compiler rendering of blrules/conntrack into device configs is a tracked follow-up (policy already renders).
32 lines
1.1 KiB
Go
32 lines
1.1 KiB
Go
package model
|
|
|
|
// BlruleRule is a blacklist/whitelist rule, processed before normal rules.
|
|
type BlruleRule struct {
|
|
ID int64 `json:"id"`
|
|
Priority int `json:"priority"`
|
|
Action string `json:"action"`
|
|
Source string `json:"source,omitempty"`
|
|
Dest string `json:"dest,omitempty"`
|
|
Proto string `json:"proto,omitempty"`
|
|
DPort []string `json:"dport,omitempty"`
|
|
SPort []string `json:"sport,omitempty"`
|
|
Log string `json:"log,omitempty"`
|
|
Comment string `json:"comment,omitempty"`
|
|
}
|
|
|
|
// ConntrackRule controls connection tracking (notrack, helper assignment).
|
|
type ConntrackRule struct {
|
|
ID int64 `json:"id"`
|
|
Priority int `json:"priority"`
|
|
Action string `json:"action"`
|
|
Source string `json:"source,omitempty"`
|
|
Dest string `json:"dest,omitempty"`
|
|
Proto string `json:"proto,omitempty"`
|
|
DPort []string `json:"dport,omitempty"`
|
|
SPort []string `json:"sport,omitempty"`
|
|
Chain string `json:"chain,omitempty"`
|
|
Helper string `json:"helper,omitempty"`
|
|
User string `json:"user,omitempty"`
|
|
Comment string `json:"comment,omitempty"`
|
|
}
|