Documentation
¶
Overview ¶
Package rules implements policy ruleset models and matching algorithms for API requests.
Package rules implements policy ruleset models and matching algorithms for API requests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IdentifyCommandType ¶
IdentifyCommandType classifies incoming Docker API requests into standard operation categories.
Types ¶
type Action ¶
type Action string
Action defines the decision outcome for a policy evaluation.
type ContainerCreateRequest ¶
type ContainerCreateRequest = container.CreateRequest
ContainerCreateRequest aliases canonical container.CreateRequest from official Moby API types.
type ContainerCreateRule ¶
type ContainerCreateRule struct {
Privileged *bool `yaml:"privileged"`
AllowedMounts []string `yaml:"allowed_mounts"`
AllowedPorts []string `yaml:"allowed_ports"`
AllowedImages []string `yaml:"allowed_images"`
AllowedNames []string `yaml:"allowed_names"`
}
ContainerCreateRule defines semantic constraints evaluated against container creation requests.
type ContainerSummary ¶
ContainerSummary aliases canonical container.Summary from official Moby API types.
type ExecCreateRequest ¶
type ExecCreateRequest = container.ExecCreateRequest
ExecCreateRequest aliases canonical container.ExecCreateRequest from official Moby API types.
type ExecCreateRule ¶
type ExecCreateRule struct {
AllowedCommands []string `yaml:"allowed_commands"`
AllowedContainers []string `yaml:"allowed_containers"`
}
ExecCreateRule defines semantic constraints evaluated against exec creation requests.
type HostConfig ¶
type HostConfig = container.HostConfig
HostConfig aliases canonical container.HostConfig from official Moby API types.
type ImageSummary ¶
ImageSummary aliases canonical image.Summary from official Moby API types.
type PolicyRule ¶
type PolicyRule = SemanticRule
PolicyRule alias for backwards compatibility during migration.
type ResponseFilterRule ¶
type ResponseFilterRule struct {
AllowedNames []string `yaml:"allowed_names"`
AllowedLabels map[string]string `yaml:"allowed_labels"`
}
ResponseFilterRule defines allowlist criteria applied to filter container or image list responses.
type Ruleset ¶
type Ruleset struct {
Version string `yaml:"version"`
DefaultAction Action `yaml:"default_action"`
Rules []SemanticRule `yaml:"rules"`
}
Ruleset defines the top-level security policy evaluated against incoming requests.
type SemanticRule ¶
type SemanticRule struct {
ID string `yaml:"id"`
Action Action `yaml:"action"`
Message string `yaml:"message"`
Methods []string `yaml:"methods"`
PathPattern string `yaml:"path_pattern"`
BodyPattern string `yaml:"body_pattern"`
CommandTypes []string `yaml:"command_types"`
ContainerCreate *ContainerCreateRule `yaml:"container_create"`
ExecCreate *ExecCreateRule `yaml:"exec_create"`
ResponseFilter *ResponseFilterRule `yaml:"response_filter"`
}
SemanticRule defines an individual access control or filtering directive within a ruleset.