Documentation
¶
Index ¶
- Constants
- Variables
- func ConvertIntToString(number int) string
- func DiscoverResources(ctx context.Context) error
- func ReconcileDiscoverResources(ctx context.Context, wg *sync.WaitGroup, loopDuration time.Duration)
- func SetDiscoverResourcesSettings(clusterType string, environment string, loginURL string, ...) error
- type AuthorizationActionInfo
- type AuthorizationEntity
- type DataAction
- type DiscoverResourcesSettings
- type Display
- type Operation
- type OperationList
- type OperationsMap
- type Resource
- type ResourceAndVerbMap
- type TokenResponse
- type VerbAndActionsMap
Constants ¶
View Source
const ( ManagedClusters = "Microsoft.ContainerService/managedClusters" Fleets = "Microsoft.ContainerService/fleets" ConnectedClusters = "Microsoft.Kubernetes/connectedClusters" OperationsEndpointFormatARC = "%s/providers/Microsoft.Kubernetes/operations?api-version=2021-10-01" OperationsEndpointFormatAKS = "%s/providers/Microsoft.ContainerService/operations?api-version=2018-10-31" )
Variables ¶
View Source
var ( DiscoverResourcesTotalDuration = prometheus.NewHistogram( prometheus.HistogramOpts{ Name: "guard_discover_resources_request_duration_seconds", Help: "A histogram of latencies for azure get operations requests.", Buckets: []float64{.25, .5, 1, 2.5, 5, 10, 15, 20}, }) )
Functions ¶
func ConvertIntToString ¶
func DiscoverResources ¶
DiscoverResources does the following: 1. Fetches list of ApiResources from the apiserver 2. Fetches list of Data Actions via Get Operations call on Azure 3. creates OperationsMap which is a map of "group": { "resource": { "verb": DataAction{} } } } This map is used to create list of AuthorizationActionInfos when we get a SAR request where Resource/Verb/Group is *
Types ¶
type AuthorizationActionInfo ¶
type AuthorizationActionInfo struct { AuthorizationEntity IsDataAction bool `json:"IsDataAction"` }
type AuthorizationEntity ¶
type AuthorizationEntity struct {
Id string `json:"Id"`
}
type DataAction ¶
type DataAction struct { ActionInfo AuthorizationActionInfo IsNamespacedResource bool }
type DiscoverResourcesSettings ¶
type DiscoverResourcesSettings struct {
// contains filtered or unexported fields
}
type OperationList ¶
type OperationsMap ¶
type OperationsMap map[string]ResourceAndVerbMap
func DeepCopyOperationsMap ¶ added in v0.12.2
func DeepCopyOperationsMap() OperationsMap
func NewOperationsMap ¶
func NewOperationsMap() OperationsMap
func (OperationsMap) String ¶
func (o OperationsMap) String() string
type ResourceAndVerbMap ¶
type ResourceAndVerbMap map[string]VerbAndActionsMap
func NewResourceAndVerbMap ¶
func NewResourceAndVerbMap() ResourceAndVerbMap
type TokenResponse ¶
type TokenResponse struct { AccessToken string `json:"access_token"` ExpiresIn string `json:"expires_in"` RefreshToken string `json:"refresh_token"` ExpiresOn string `json:"expires_on"` NotBefore string `json:"not_before"` Resource string `json:"resource"` TokenType string `json:"token_type"` ErrorMessage string `json:"error_message,omitempty"` }
type VerbAndActionsMap ¶
type VerbAndActionsMap map[string]DataAction
func NewVerbAndActionsMap ¶
func NewVerbAndActionsMap() VerbAndActionsMap
Click to show internal directories.
Click to hide internal directories.