Versions in this module Expand all Collapse all v0 v0.8.0 Jun 30, 2023 Changes in this version + const AppealActionNameApprove + const AppealActionNameReject + const AppealStatusApproved + const AppealStatusCanceled + const AppealStatusPending + const AppealStatusRejected + const ApprovalStatusApproved + const ApprovalStatusBlocked + const ApprovalStatusPending + const ApprovalStatusRejected + const ApprovalStatusSkipped + const ApproversKeyResource + const DefaultAppealAccountType + const ExpirationDateReasonFromAppeal + const NotificationTypeAccessRevoked + const NotificationTypeAppealApproved + const NotificationTypeAppealRejected + const NotificationTypeApproverNotification + const NotificationTypeExpirationReminder + const NotificationTypeGrantOwnerChanged + const NotificationTypeOnBehalfAppealApproved + const PermanentDurationLabel + const ProviderTypeBigQuery + const ProviderTypeGCS + const ProviderTypeGCloudIAM + const ProviderTypeGrafana + const ProviderTypeMetabase + const ProviderTypeNoOp + const ProviderTypePolicyTag + const ProviderTypeShield + const ProviderTypeTableau + const SystemActorName + var ErrApproverInvalidType = errors.New("invalid approver type, expected an email string or array of email string") + var ErrInvalidConditionField = errors.New("unable to parse condition's field") + type AccessEntry struct + AccountID string + AccountType string + Permission string + func (ae AccessEntry) ToGrant(resource Resource) Grant + type Activity struct + AccountID string + AccountType string + Authorizations []string + CreatedAt time.Time + ID string + Metadata map[string]interface{} + Provider *Provider + ProviderActivityID string + ProviderID string + RelatedPermissions []string + Resource *Resource + ResourceID string + Timestamp time.Time + Type string + type AdditionalAppeal struct + Options *AppealOptions + Policy *PolicyConfig + Resource *ResourceIdentifier + Role string + type Appeal struct + AccountID string + AccountType string + Approvals []*Approval + CreatedAt time.Time + CreatedBy string + Creator interface{} + Description string + Details map[string]interface{} + Grant *Grant + ID string + Labels map[string]string + Options *AppealOptions + Permissions []string + Policy *Policy + PolicyID string + PolicyVersion uint + Resource *Resource + ResourceID string + Role string + Status string + UpdatedAt time.Time + func (a *Appeal) AdvanceApproval(policy *Policy) error + func (a *Appeal) ApplyPolicy(p *Policy) error + func (a *Appeal) Approve() error + func (a *Appeal) Cancel() + func (a *Appeal) GetApproval(id string) *Approval + func (a *Appeal) GetDuration() (time.Duration, error) + func (a *Appeal) GetNextPendingApproval() *Approval + func (a *Appeal) Init(policy *Policy) + func (a *Appeal) IsDurationEmpty() bool + func (a *Appeal) Reject() + func (a *Appeal) SetDefaults() + func (a Appeal) ToGrant() (*Grant, error) + type AppealConfig struct + AllowActiveAccessExtensionIn string + AllowPermanentAccess bool + type AppealDurationOption struct + Name string + Value string + type AppealOptions struct + Duration string + ExpirationDate *time.Time + type Approval struct + Actor *string + Appeal *Appeal + AppealID string + Approvers []string + CreatedAt time.Time + ID string + Index int + Name string + PolicyID string + PolicyVersion uint + Reason string + Status string + UpdatedAt time.Time + func (a *Approval) Approve() + func (a *Approval) IsManualApproval() bool + func (a *Approval) Reject() + func (a *Approval) Skip() + type ApprovalAction struct + Action string + Actor string + AppealID string + ApprovalName string + Reason string + type ApprovalActionType string + const ApprovalActionApprove + const ApprovalActionReject + type ApprovalStepStrategy string + const ApprovalStepStrategyAuto + const ApprovalStepStrategyManual + type Approver struct + AppealID string + ApprovalID string + CreatedAt time.Time + Email string + ID string + UpdatedAt time.Time + type Condition struct + Field string + Match *MatchCondition + func (c *Condition) IsMatch(a *Appeal) (bool, error) + type Crypto interface + type Decryptor interface + Decrypt func(string) (string, error) + type Encryptor interface + Encrypt func(string) (string, error) + type Grant struct + AccountID string + AccountType string + Appeal *Appeal + AppealID string + CreatedAt time.Time + CreatedBy string + ExpirationDate *time.Time + ExpirationDateReason string + ID string + IsPermanent bool + Owner string + Permissions []string + RequestedExpirationDate *time.Time + Resource *Resource + ResourceID string + RevokeReason string + RevokedAt *time.Time + RevokedBy string + Role string + Source GrantSource + Status GrantStatus + StatusInProvider GrantStatus + UpdatedAt time.Time + func (g *Grant) GetPermissions() []string + func (g *Grant) Revoke(actor, reason string) error + func (g Grant) IsEligibleForExtension(extensionDurationRule time.Duration) bool + func (g Grant) PermissionsKey() string + type GrantSource string + const GrantSourceAppeal + const GrantSourceImport + type GrantStatus string + const GrantStatusActive + const GrantStatusInactive + type IAMClient interface + GetUser func(id string) (interface{}, error) + type IAMConfig struct + Config interface{} + Provider IAMProviderType + Schema map[string]string + type IAMManager interface + GetClient func(SensitiveConfig) (IAMClient, error) + ParseConfig func(*IAMConfig) (SensitiveConfig, error) + type IAMProviderType string + const IAMProviderTypeHTTP + const IAMProviderTypeShield + type ImportActivitiesFilter struct + AccountIDs []string + ProviderID string + ResourceIDs []string + TimestampGte *time.Time + TimestampLte *time.Time + func (f *ImportActivitiesFilter) GetResources() []*Resource + func (f *ImportActivitiesFilter) PopulateResources(resources map[string]*Resource) error + type ListAppealsFilter struct + AccountID string + AccountIDs []string + CreatedBy string + ExpirationDateGreaterThan time.Time + ExpirationDateLessThan time.Time + OrderBy []string + ProviderTypes []string + ProviderURNs []string + ResourceID string + ResourceTypes []string + ResourceURNs []string + Role string + Statuses []string + type ListApprovalsFilter struct + AccountID string + AppealStatuses []string + CreatedBy string + Offset int + OrderBy []string + Size int + Statuses []string + type ListGrantsFilter struct + AccountIDs []string + AccountTypes []string + CreatedBy string + ExpirationDateGreaterThan time.Time + ExpirationDateLessThan time.Time + IsPermanent *bool + OrderBy []string + Owner string + Permissions []string + ProviderTypes []string + ProviderURNs []string + ResourceIDs []string + ResourceTypes []string + ResourceURNs []string + Roles []string + Statuses []string + type ListProviderActivitiesFilter struct + AccountIDs []string + ProviderIDs []string + ResourceIDs []string + TimestampGte *time.Time + TimestampLte *time.Time + Types []string + type ListResourcesFilter struct + Details map[string]string + IDs []string + IsDeleted bool + Name string + ProviderType string + ProviderURN string + ResourceType string + ResourceTypes []string + ResourceURN string + ResourceURNs []string + type MapResourceAccess map[string][]AccessEntry + type MatchCondition struct + Eq interface{} + type Notification struct + Labels map[string]string + Message NotificationMessage + User string + type NotificationMessage struct + Type string + Variables map[string]interface{} + type NotificationMessages struct + AccessRevoked string + AppealApproved string + AppealRejected string + ApproverNotification string + ExpirationReminder string + GrantOwnerChanged string + OthersAppealApproved string + type Policy struct + AppealConfig *PolicyAppealConfig + CreatedAt time.Time + Description string + IAM *IAMConfig + ID string + Labels map[string]string + Requirements []*Requirement + Steps []*Step + UpdatedAt time.Time + Version uint + func (p *Policy) HasIAMConfig() bool + type PolicyAppealConfig struct + AllowActiveAccessExtensionIn string + AllowCreatorDetailsFailure bool + AllowOnBehalf bool + AllowPermanentAccess bool + DurationOptions []AppealDurationOption + Questions []Question + type PolicyConfig struct + ID string + Version int + type Provider struct + Config *ProviderConfig + CreatedAt time.Time + ID string + Type string + URN string + UpdatedAt time.Time + type ProviderConfig struct + AllowedAccountTypes []string + Appeal *AppealConfig + Credentials interface{} + Labels map[string]string + Parameters []*ProviderParameter + Resources []*ResourceConfig + Type string + URN string + func (pc ProviderConfig) GetResourceTypes() (resourceTypes []string) + type ProviderParameter struct + Description string + Key string + Label string + Required bool + type ProviderType struct + Name string + ResourceTypes []string + type Question struct + Description string + Key string + Question string + Required bool + type Requirement struct + Appeals []*AdditionalAppeal + On *RequirementTrigger + type RequirementTrigger struct + Conditions []*Condition + Expression string + ProviderType string + ProviderURN string + ResourceType string + ResourceURN string + Role string + func (r *RequirementTrigger) IsMatch(a *Appeal) (bool, error) + type Resource struct + Children []*Resource + CreatedAt time.Time + Details map[string]interface{} + ID string + IsDeleted bool + Labels map[string]string + Name string + ParentID *string + ProviderType string + ProviderURN string + Type string + URN string + UpdatedAt time.Time + func (r *Resource) GetFlattened() []*Resource + type ResourceConfig struct + Filter string + Policy *PolicyConfig + Roles []*Role + Type string + type ResourceIdentifier struct + ID string + ProviderType string + ProviderURN string + Type string + URN string + type Resources []*Resource + func (r Resources) ToMap() map[string]*Resource + type RevokeGrantsFilter struct + AccountIDs []string + ProviderTypes []string + ProviderURNs []string + ResourceTypes []string + ResourceURNs []string + type Role struct + Description string + ID string + Name string + Permissions []interface{} + func (r Role) GetOrderedPermissions() []string + type SensitiveConfig interface + Validate func() error + type SensitiveInformation interface + Decrypt func() error + Encrypt func() error + type Step struct + AllowFailed bool + ApproveIf string + Approvers []string + Description string + Name string + RejectionReason string + Strategy ApprovalStepStrategy + When string + func (s Step) ResolveApprovers(a *Appeal) ([]string, error) + func (s Step) ToApproval(a *Appeal, p *Policy, index int) (*Approval, error)