analyzer

package
v0.0.0-...-4054b4b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Analyzer

type Analyzer interface {

	// ListRoleBindingsForSubject returns all role bindings for the subject in the namespace(empty for all namespaces)
	ListRoleBindingsForSubject(sbj *rbacv1.Subject, namespace string) []*rbacv1.RoleBinding

	// ListClusterRoleBindingsForSubject returns all role bindings for the subject in the namespace(empty for all namespaces)
	ListClusterRoleBindingsForSubject(sbj *rbacv1.Subject) []*rbacv1.ClusterRoleBinding

	// GetRoleForRoleBinding returns the role specified by RoleBinding, or nil if not exists
	GetRoleForRoleBinding(rb *rbacv1.RoleBinding) *rbacv1.Role

	// GetRoleForRoleRef returns the role specified by RoleRef, or nil if not exists
	GetRoleForRoleRef(namespace string, roleRef *rbacv1.RoleRef) *rbacv1.Role

	// GetClusterRoleForRoleBinding returns the role specified by RoleBinding, or nil if not exists
	GetClusterRoleForRoleBinding(rb *rbacv1.RoleBinding) *rbacv1.ClusterRole

	// GetClusterRoleForClusterRoleBinding returns the role specified by ClusterRoleBinding, or nil if not exists
	GetClusterRoleForClusterRoleBinding(rb *rbacv1.ClusterRoleBinding) *rbacv1.ClusterRole

	// GetClusterRoleForRoleRef returns the role specified by RoleRef, or nil if not exists
	GetClusterRoleForRoleRef(roleRef *rbacv1.RoleRef) *rbacv1.ClusterRole

	// ListPermissionsForRole returns associations related to all APIResources for Role
	ListPermissionsForRole(role *rbacv1.Role) []*rbactypes.APIResourcePermissionsList

	ListPermissionsForClusterRole(role *rbacv1.ClusterRole) []*rbactypes.APIResourcePermissionsList
}

Analyzer analyzes Kubernetes RBAC resources

func NewAnalyzer

func NewAnalyzer(opt *Option) Analyzer

NewAnalyzer initializes an Analyzer

type Option

type Option struct {
	// contains filtered or unexported fields
}

Option has all resources for Analyzer

func NewOption

func NewOption() *Option

NewOption initializes a new empty Option

func (*Option) AddAPIResourceList

func (o *Option) AddAPIResourceList(apiResourceList *metav1.APIResourceList) *Option

AddAPIResourceList adds a new APIResourceList

func (*Option) AddRole

func (o *Option) AddRole(role *rbacv1.Role)

AddRole adds a new Role

func (*Option) AddRoleBinding

func (o *Option) AddRoleBinding(rb *rbacv1.RoleBinding)

AddRoleBinding adds a new RoleBinding

func (*Option) AddSubject

func (o *Option) AddSubject(sbj *rbacv1.Subject)

AddSubject adds a new Subject

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL