|
|
@ -17,18 +17,27 @@ import (
|
|
|
|
"inet.af/netaddr"
|
|
|
|
"inet.af/netaddr"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// ACLRow defines a rule that grants access by a set of users or groups to a set of servers and ports.
|
|
|
|
// ACLRow defines a rule that grants access by a set of users or groups to a set
|
|
|
|
|
|
|
|
// of servers and ports.
|
|
|
|
|
|
|
|
// Only one of Src/Dst or Users/Ports may be specified.
|
|
|
|
type ACLRow struct {
|
|
|
|
type ACLRow struct {
|
|
|
|
Action string `json:"action,omitempty"` // valid values: "accept"
|
|
|
|
Action string `json:"action,omitempty"` // valid values: "accept"
|
|
|
|
Users []string `json:"users,omitempty"`
|
|
|
|
Users []string `json:"users,omitempty"` // old name for src
|
|
|
|
Ports []string `json:"ports,omitempty"`
|
|
|
|
Ports []string `json:"ports,omitempty"` // old name for dst
|
|
|
|
|
|
|
|
Src []string `json:"src,omitempty"`
|
|
|
|
|
|
|
|
Dst []string `json:"dst,omitempty"`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ACLTest defines a test for your ACLs to prevent accidental exposure or revoking of access to key servers and ports.
|
|
|
|
// ACLTest defines a test for your ACLs to prevent accidental exposure or
|
|
|
|
|
|
|
|
// revoking of access to key servers and ports. Only one of Src or User may be
|
|
|
|
|
|
|
|
// specified, and only one of Allow/Accept may be specified.
|
|
|
|
type ACLTest struct {
|
|
|
|
type ACLTest struct {
|
|
|
|
User string `json:"user,omitempty"` // source
|
|
|
|
Src string `json:"src,omitempty"` // source
|
|
|
|
Allow []string `json:"allow,omitempty"` // expected destination ip:port that user can access
|
|
|
|
User string `json:"user,omitempty"` // old name for source
|
|
|
|
|
|
|
|
Accept []string `json:"accept,omitempty"` // expected destination ip:port that user can access
|
|
|
|
Deny []string `json:"deny,omitempty"` // expected destination ip:port that user cannot access
|
|
|
|
Deny []string `json:"deny,omitempty"` // expected destination ip:port that user cannot access
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Allow []string `json:"allow,omitempty"` // old name for accept
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ACLDetails contains all the details for an ACL.
|
|
|
|
// ACLDetails contains all the details for an ACL.
|
|
|
|