rbacutils

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: Apache-2.0 Imports: 8 Imported by: 3

Documentation

Index

Constants

View Source
const (
	ArmoRBACGroup = "armo.rbac.com"
)

Variables

View Source
var (
	ResourceGroupMapping = []string{
		"pods",
		"daemonsets",
		"deployments",
		"replicasets",
		"statefulsets",
		"jobs",
		"cronjobs",
	}
)

Functions

func ExistsSubject

func ExistsSubject(list []Subject, subjectName string) (int, bool)

ExistsSubject -

func InitRbacTable

func InitRbacTable(clustername string, clusterRoles *rbac.ClusterRoleList, roles *rbac.RoleList, clusterRoleBindings *rbac.ClusterRoleBindingList, roleBindings *rbac.RoleBindingList) *[]RbacTable

DEPRECATED InitRbacTable -

func InitSA2WLIDmap

func InitSA2WLIDmap(k8sAPI *k8sinterface.KubernetesApi, clusterName string) (map[string][]string, error)

TODO - DEPRECATE sa2WLIDmap create service account to WLID map

func InitSAID2WLIDmap

func InitSAID2WLIDmap(k8sAPI *k8sinterface.KubernetesApi, clusterName string) (map[string][]string, error)

func ListAllWorkloads

func ListAllWorkloads(k8sAPI *k8sinterface.KubernetesApi) ([]k8sinterface.IWorkload, error)

func RbacObjectIMetadataWrapper

func RbacObjectIMetadataWrapper(rbacObj *RBAC) (map[string]interface{}, error)

DEPRECATED

func RbacTableObjectIMetadataWrapper

func RbacTableObjectIMetadataWrapper(rbacTObj *[]RbacTable) (map[string]interface{}, error)

DEPRECATED

func SA2WLIDmapIMetadataWrapper

func SA2WLIDmapIMetadataWrapper(RbacObj map[string][]string) (map[string]interface{}, error)

TODO- DEPRECATE sa2WLIDmap

func SAID2WLIDmapIMetadataWrapper

func SAID2WLIDmapIMetadataWrapper(RbacObj map[string][]string) (map[string]interface{}, error)

Types

type RBAC

type RBAC struct {
	Kind          string
	Cluster       string
	GeneratedDate string
	GeneratedTime string
	Subjects      []Subject
}

DEPRECATED RBAC -

func InitRbac

func InitRbac(clusterName string, clusterRoles *rbac.ClusterRoleList, roles *rbac.RoleList, clusterRoleBindings *rbac.ClusterRoleBindingList, roleBindings *rbac.RoleBindingList) *RBAC

DEPRECATED InitRbac -

type RbacObjects

type RbacObjects struct {
	ClusterRoles        *rbac.ClusterRoleList
	Roles               *rbac.RoleList
	ClusterRoleBindings *rbac.ClusterRoleBindingList
	RoleBindings        *rbac.RoleBindingList
	Rbac                *RBAC               // DEPRECATED
	RbacT               *[]RbacTable        // DEPRECATED
	SA2WLIDmap          map[string][]string //TODO- DEPRECATE sa2WLIDmap
	SAID2WLIDmap        map[string][]string
}

func (RbacObjects) MarshalJSON

func (rbacObj RbacObjects) MarshalJSON() ([]byte, error)

type RbacTable

type RbacTable struct {
	Cluster   string
	Namespace string
	UserType  string
	Username  string
	Role      string
	Verb      []string
	Resource  []string
}

DEPRECATED RbacTable -

type Role

type Role struct {
	Name  string
	Rules []Rule
}

Role -

type Rule

type Rule struct {
	Rule     rbac.PolicyRule
	LastUsed string
}

Rule -

type Subject

type Subject struct {
	rbac.Subject
	Roles []Role
}

Subject - user/group/

Jump to

Keyboard shortcuts

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