Files
decort-golang-sdk/pkg/sdn/defsecpolicies/models.go

273 lines
5.6 KiB
Go
Raw Normal View History

2025-11-14 17:38:59 +03:00
package defsecpolicies
type SecurityPoliciesList struct {
Policies []SecurityPolicy `json:"policies"`
}
// Main information about security policy
type SecurityPolicy struct {
// Access group ID
AccessGroupID string `json:"access_group_id"`
2026-10-09 16:23:35 +03:00
// Access group name
AccessGroupName string `json:"access_group_name"`
2025-11-14 17:38:59 +03:00
// Created time
CreatedAt string `json:"created_at"`
// Default ACL drop behavior
DefaultACLDrop string `json:"default_acl_drop"`
// Default open session drop flag
DefaultOpenSessionDrop bool `json:"default_open_session_drop"`
// Display name
DisplayName string `json:"display_name"`
// ID
ID string `json:"id"`
// Security rules
SecurityRules []SecurityRule `json:"security_rules"`
// Version ID
VersionID uint64 `json:"version_id"`
// Updated time
UpdatedAt string `json:"updated_at"`
}
// Security rule information
type SecurityRule struct {
// Access group ID
AccessGroupID string `json:"access_group_id"`
// Action
Action string `json:"action"`
2026-10-09 16:23:35 +03:00
// Applied network object groups
AppliedNetObjectGroups []AppliedNetObjectGroup `json:"applied_net_object_groups"`
2025-11-14 17:38:59 +03:00
2026-10-09 16:23:35 +03:00
// Destination network object groups
DestinationNetObjectGroups []NetObjectGroup `json:"destination_net_object_groups"`
2025-11-14 17:38:59 +03:00
// Direction
Direction string `json:"direction"`
// Display name
DisplayName string `json:"display_name"`
// Enabled flag
Enabled bool `json:"enabled"`
2026-10-09 16:23:35 +03:00
// Filters configuration
Filter []FilterParams `json:"filters"`
2025-11-14 17:38:59 +03:00
// ID
ID string `json:"id"`
// Log enabled flag
LogEnabled bool `json:"log_enabled"`
2026-10-09 16:23:35 +03:00
// Logging profile
LoggingProfile LoggingProfile `json:"logging_profile"`
2025-11-14 17:38:59 +03:00
2026-10-09 16:23:35 +03:00
// Logging profile ID
LoggingProfileID string `json:"logging_profile_id"`
2025-11-14 17:38:59 +03:00
// Priority
Priority int `json:"priority"`
2026-10-09 16:23:35 +03:00
// Security rule condition groups
SecurityRuleConditionGroups []SecurityRuleConditionGroup `json:"security_rule_condition_groups"`
2025-11-14 17:38:59 +03:00
2026-10-09 16:23:35 +03:00
// Security rule conditions
SecurityRuleConditions []SecurityRuleCondition `json:"security_rule_conditions"`
// Source network object groups
SourceNetObjectGroups []NetObjectGroup `json:"source_net_object_groups"`
2025-11-14 17:38:59 +03:00
// Statistics enabled flag
StatisticsEnabled bool `json:"statistics_enabled"`
2026-10-09 16:23:35 +03:00
// Type
Type string `json:"type"`
2025-11-14 17:38:59 +03:00
// Version ID
VersionID uint64 `json:"version_id"`
}
2026-10-09 16:23:35 +03:00
// Applied network object group information
type AppliedNetObjectGroup struct {
// ID
ID string `json:"id"`
// Name
Name string `json:"name"`
// Version ID
VersionID uint64 `json:"version_id"`
}
// Network object group information
type NetObjectGroup struct {
// ID
ID string `json:"id"`
// Is positive flag
IsPositive bool `json:"is_positive"`
// Name
Name string `json:"name"`
// Version ID
VersionID uint64 `json:"version_id"`
}
// Logging profile information
type LoggingProfile struct {
// Access group ID
AccessGroupID string `json:"access_group_id"`
// Access group name
AccessGroupName string `json:"access_group_name"`
// Created time
CreatedAt string `json:"created_at"`
// Direction
Direction string `json:"direction"`
// ID
ID string `json:"id"`
// Name
Name string `json:"name"`
// Security rules count
SecurityRulesCount uint64 `json:"security_rules_count"`
// Session established sample rate
SessionEstablishedSampleRate float64 `json:"session_established_sample_rate"`
// Session new sample rate
SessionNewSampleRate float64 `json:"session_new_sample_rate"`
// Updated time
UpdatedAt string `json:"updated_at"`
2025-11-14 17:38:59 +03:00
2026-10-09 16:23:35 +03:00
// Version ID
VersionID uint64 `json:"version_id"`
}
// Security rule condition group information
type SecurityRuleConditionGroup struct {
// Access group ID
AccessGroupID string `json:"access_group_id"`
// Access group name
AccessGroupName string `json:"access_group_name"`
// Created time
CreatedAt string `json:"created_at"`
// ID
ID string `json:"id"`
2025-11-14 17:38:59 +03:00
2026-10-09 16:23:35 +03:00
// Name
Name string `json:"name"`
// Security rule conditions
SecurityRuleConditions []SecurityRuleCondition `json:"security_rule_conditions"`
// Security rules count
SecurityRulesCount uint64 `json:"security_rules_count"`
// Updated time
UpdatedAt string `json:"updated_at"`
2025-11-14 17:38:59 +03:00
}
2026-10-09 16:23:35 +03:00
// Security rule condition information
type SecurityRuleCondition struct {
// Access group ID
AccessGroupID string `json:"access_group_id"`
// Created time
CreatedAt string `json:"created_at"`
// Filters configuration
Filters []FilterParams `json:"filters"`
// ID
ID string `json:"id"`
2025-11-14 17:38:59 +03:00
// Name
Name string `json:"name"`
2026-10-09 16:23:35 +03:00
// Read only flag
ReadOnly bool `json:"read_only"`
// Security rule condition groups
SecurityRuleConditionGroups []interface{} `json:"security_rule_condition_groups"`
// Security rules
SecurityRules []interface{} `json:"security_rules"`
// Updated time
UpdatedAt string `json:"updated_at"`
2025-11-14 17:38:59 +03:00
}
// Filter parameters
type FilterParams struct {
// All protocols flag
All bool `json:"all"`
// ARP protocol flag
ARP bool `json:"arp"`
2026-10-09 16:23:35 +03:00
// Ethernet type
EthType string `json:"eth_type"`
2025-11-14 17:38:59 +03:00
// Filter expression
Expression string `json:"expression"`
// ICMP protocol flag
ICMP bool `json:"icmp"`
// IP protocol flag
IP bool `json:"ip"`
2026-10-09 16:23:35 +03:00
// IP protocol number
IPProto uint64 `json:"ip_proto"`
2025-11-14 17:38:59 +03:00
// IPv4 protocol flag
IPv4 bool `json:"ip_v4"`
// IPv6 protocol flag
IPv6 bool `json:"ip_v6"`
// Keep opened sessions flag
KeepOpenedSessions bool `json:"keep_opened_sessions"`
// ND protocol flag
ND bool `json:"nd"`
// TCP protocol flag
TCP bool `json:"tcp"`
// TCP destination ports
TCPDstPorts []string `json:"tcp_dst_ports"`
2026-10-09 16:23:35 +03:00
// TCP source ports
TCPSrcPorts []string `json:"tcp_src_ports"`
2025-11-14 17:38:59 +03:00
// UDP protocol flag
UDP bool `json:"udp"`
// UDP destination ports
UDPDstPorts []string `json:"udp_dst_ports"`
2026-10-09 16:23:35 +03:00
// UDP source ports
UDPSrcPorts []string `json:"udp_src_ports"`
2025-11-14 17:38:59 +03:00
}