Documentation
¶
Index ¶
- Constants
- Variables
- func SortNodesByKey(nodes []Node)
- type AccessKey
- type Account
- type AccountAsset
- type AccountChat
- type AccountDetail
- type Action
- type Actions
- func (a Actions) EnableConnect() bool
- func (a Actions) EnableCopy() bool
- func (a Actions) EnableDelete() bool
- func (a Actions) EnableDownload() bool
- func (a Actions) EnableDrive() bool
- func (a Actions) EnablePaste() bool
- func (a Actions) EnableShare() bool
- func (a Actions) EnableUpload() bool
- func (a Actions) Permission() Permission
- type Applet
- type AppletOption
- type Asset
- type AssetList
- type AssetLoginTicketInfo
- type AssetMeta
- type AssetNodeSorter
- type BaseAccount
- func (a *BaseAccount) ClearSSHCertificateCredential()
- func (a *BaseAccount) ClearSSHCertificatePrivateKey()
- func (a *BaseAccount) HashId() string
- func (a *BaseAccount) IsAnonymous() bool
- func (a *BaseAccount) IsNull() bool
- func (a *BaseAccount) IsSSHCertificate() bool
- func (a *BaseAccount) IsSSHKey() bool
- func (a *BaseAccount) String() string
- type BaseDomain
- type BasePlatform
- type ClipboardPolicy
- type ClipboardPolicyItem
- type Command
- type CommandACL
- type CommandACLs
- type CommandAction
- type CommandConfig
- type CommandFilterItem
- type CommandTicketInfo
- type Component
- type ConnectMethod
- type ConnectOptions
- type ConnectToken
- type ConnectTokenInfo
- type DataMaskingRule
- type DataMaskingRules
- type Domain
- type ExpireInfo
- type FTPLog
- type FindStringer
- type Gateway
- type Group
- type HeartbeatData
- type KokoBasic
- type LabelField
- type LabelValue
- type LifecycleEvent
- type MiniUser
- type Node
- type NodeList
- type NodeMeta
- type NodeTree
- type NodeTreeList
- type NodeTreeMeta
- type ObjectId
- type OrgRole
- type OtherMeta
- type PaginationParam
- type PaginationResponse
- type PermAccount
- type PermAccountList
- type PermAsset
- type PermAssetDetail
- type PermAssetList
- type Permission
- func (p *Permission) EnableConnect() bool
- func (p *Permission) EnableCopy() bool
- func (p *Permission) EnableDelete() bool
- func (p *Permission) EnableDownload() bool
- func (p *Permission) EnableDrive() bool
- func (p *Permission) EnablePaste() bool
- func (p *Permission) EnableShare() bool
- func (p *Permission) EnableUpload() bool
- type Phone
- type Platform
- type PlatformProtocol
- type PlatformProtocols
- type Protocol
- type ProtocolSetting
- type Protocols
- type PublicSetting
- type Regexp2
- type RemainReplay
- type RemoteAppCommandOption
- type ReplayConfig
- type ReplayError
- type ReplayVersion
- type ReqInfo
- type SSHCertificateInfo
- type SecretInfo
- type SecretType
- type Session
- type SessionLifecycleLog
- type SessionLifecycleReasonErr
- type SharePostData
- type ShareRecord
- type SharingSession
- type SharingSessionRequest
- type SpecInfo
- type StdRegexp
- type SystemRole
- type TaskKwargs
- type Terminal
- type TerminalConfig
- type TerminalTask
- type TicketInfo
- type TicketState
- type TokenCheckStatus
- type TreeMeta
- type User
- type UserKokoPreference
- type ValidateResult
- type VirtualApp
- type VirtualAppContainer
- type VirtualAppOption
- type VirtualAppProvider
- type WebLoginStep
Constants ¶
View Source
const ( InputUser = "@INPUT" DynamicUser = "@USER" ANONUser = "@ANON" )
View Source
const ( ProtocolSSH = "ssh" ProtocolTelnet = "telnet" ProtocolK8S = "k8s" ProtocolSFTP = "sftp" ProtocolRedis = "redis" ProtocolRDP = "rdp" )
View Source
const ( PGSSLPrefer = "prefer" PGSSLRequire = "require" PGSSLVerifyCa = "verify-ca" PGSSLVerifyFull = "verify-full" )
View Source
const ( OperateDownload = "download" OperateUpload = "upload" )
View Source
const ( OperateRemoveDir = "rmdir" OperateRename = "rename" OperateRenameDir = "rename_dir" OperateMkdir = "mkdir" OperateDelete = "delete" OperateSymlink = "symlink" )
View Source
const ( NormalLevel = 0 WarningLevel = 4 RejectLevel = 5 ReviewReject = 6 ReviewAccept = 7 ReviewCancel = 8 )
View Source
const ( ActionReject = "reject" ActionAccept = "accept" ActionReview = "review" ActionWarning = "warning" ActionNotifyAndWarn = "notify_and_warn" ActionUnknown = "Unknown" )
View Source
const ( TreeTypeNode = "node" TreeTypeAsset = "asset" )
View Source
const ( ActionALL = "all" ActionConnect = "connect" ActionUpload = "upload" ActionDownload = "download" ActionCopy = "copy" ActionPaste = "paste" ActionDelete = "delete" )
View Source
const ( SuffixGz = ".gz" SuffixReplayGz = ".replay.gz" SuffixCastGz = ".cast.gz" SuffixCast = ".cast" SuffixGuac = ".guac" SuffixPartReplay = ".part.gz" SuffixReplayJson = ".replay.json" SuffixReplayMP4 = ".replay.mp4" SuffixReplayPartMp4 = ".part.mp4" )
View Source
const ( TaskKillSession = "kill_session" TaskLockSession = "lock_session" TaskUnlockSession = "unlock_session" TaskPermExpired = "perm_expired" TaskPermValid = "perm_valid" )
View Source
const ( TicketOpen = "pending" TicketApproved = "approved" TicketRejected = "rejected" TicketClosed = "closed" )
View Source
const ( ACLReview = "acl_review" ACLReject = "acl_reject" ACLFaceVerify = "acl_face_verify" ACLFaceOnline = "acl_face_online" ACLFaceOnlineNotSupported = "acl_face_online_not_supported" )
View Source
const ( CodePermOk = "perm_ok" CodePermAccountInvalid = "perm_account_invalid" CodePermExpired = "perm_expired" )
View Source
const ConnectApplet = "applet"
View Source
const (
FtpTargetPrefix = "FTP_FILES"
)
Variables ¶
View Source
var ( AccessKeyNotFound = errors.New("access key not found") AccessKeyFileNotFound = errors.New("access key file not found") AccessKeyInvalid = errors.New("access key not valid") )
View Source
var EmptyLifecycleLog = SessionLifecycleLog{}
View Source
var SuffixVersionMap = map[string]ReplayVersion{ SuffixReplayPartMp4: Version5, SuffixPartReplay: Version5, SuffixReplayJson: Version5, SuffixReplayGz: Version2, SuffixCastGz: Version3, SuffixReplayMP4: Version4, }
Functions ¶
func SortNodesByKey ¶
func SortNodesByKey(nodes []Node)
Types ¶
type AccessKey ¶
func LoadAccessKeyFromFile ¶
func (*AccessKey) LoadFromFile ¶
func (*AccessKey) LoadFromStr ¶
func (*AccessKey) SaveToFile ¶
type Account ¶
type Account struct {
BaseAccount
SuFrom *BaseAccount `json:"su_from"`
Privileged bool `json:"privileged,omitempty"`
}
func (*Account) GetBaseAccount ¶
func (a *Account) GetBaseAccount() *BaseAccount
type AccountAsset ¶
type AccountAsset struct {
Id string `json:"id"`
Name string `json:"name"`
Address string `json:"address"`
Type LabelValue `json:"type"`
Category LabelValue `json:"category"`
Platform BasePlatform `json:"platform"`
}
type AccountChat ¶
type AccountChat struct {
Id string `json:"id"`
Name string `json:"name"`
Username string `json:"username"`
SecretType LabelValue `json:"secret_type"`
SuFrom BaseAccount `json:"su_from"`
Asset AccountAsset `json:"asset"`
Version int `json:"version"`
Source LabelValue `json:"source"`
OrgId string `json:"org_id"`
OrgName string `json:"org_name"`
Privileged bool `json:"privileged"`
IsActive bool `json:"is_active"`
Comment string `json:"comment"`
}
type AccountDetail ¶
type Action ¶
type Action LabelValue
type Actions ¶
type Actions []Action
func (Actions) EnableConnect ¶
func (Actions) EnableCopy ¶
func (Actions) EnableDelete ¶
func (Actions) EnableDownload ¶
func (Actions) EnableDrive ¶
func (Actions) EnablePaste ¶
func (Actions) EnableShare ¶
func (Actions) EnableUpload ¶
func (Actions) Permission ¶
func (a Actions) Permission() Permission
type AppletOption ¶
type AppletOption struct {
ID string `json:"id"`
Applet Applet `json:"applet"`
Host Asset `json:"host"`
Account Account `json:"account"`
Gateway *Gateway `json:"gateway"`
Platform *Platform `json:"platform"`
RemoteAppOption RemoteAppCommandOption `json:"remote_app_option"`
Error string `json:"error"`
}
type Asset ¶
type Asset struct {
ID string `json:"id"`
Address string `json:"address"`
Name string `json:"name"`
OrgID string `json:"org_id"`
Protocols []Protocol `json:"protocols"`
SpecInfo SpecInfo `json:"spec_info"`
SecretInfo SecretInfo `json:"secret_info"`
Platform BasePlatform `json:"platform"`
Category LabelField `json:"category,omitempty"`
Type LabelField `json:"type,omitempty"`
Info map[string]any `json:"info,omitempty"`
Domain *BaseDomain `json:"domain"` // token 方式获取的资产,domain 为 nil
Comment string `json:"comment"`
OrgName string `json:"org_name"`
IsActive bool `json:"is_active"` // 判断资产是否禁用
Accounts Actions `json:"accounts,omitempty"` // 只有 detail api才会有这个字段
Gateway *Gateway `json:"gateway,omitempty"`
}
func (*Asset) IsSupportProtocol ¶
func (*Asset) ProtocolPort ¶
func (*Asset) SupportProtocols ¶
type AssetLoginTicketInfo ¶
type AssetLoginTicketInfo struct {
TicketId string `json:"ticket_id"`
NeedConfirm bool `json:"need_confirm"`
TicketInfo
}
type AssetNodeSorter ¶
type AssetNodeSorter struct {
// contains filtered or unexported fields
}
func (*AssetNodeSorter) Len ¶
func (a *AssetNodeSorter) Len() int
func (*AssetNodeSorter) Less ¶
func (a *AssetNodeSorter) Less(i, j int) bool
func (*AssetNodeSorter) Swap ¶
func (a *AssetNodeSorter) Swap(i, j int)
type BaseAccount ¶
type BaseAccount struct {
ID string `json:"id"`
Name string `json:"name"`
Username string `json:"username"`
Secret string `json:"secret"`
SecretType LabelValue `json:"secret_type"`
// SSHCertificatePrivateKey is generated and populated by a component such
// as Koko. It is process-local and must never be serialized or logged.
SSHCertificatePrivateKey []byte `json:"-"`
}
func (*BaseAccount) ClearSSHCertificateCredential ¶
func (a *BaseAccount) ClearSSHCertificateCredential()
func (*BaseAccount) ClearSSHCertificatePrivateKey ¶
func (a *BaseAccount) ClearSSHCertificatePrivateKey()
func (*BaseAccount) HashId ¶
func (a *BaseAccount) HashId() string
func (*BaseAccount) IsAnonymous ¶
func (a *BaseAccount) IsAnonymous() bool
func (*BaseAccount) IsNull ¶
func (a *BaseAccount) IsNull() bool
func (*BaseAccount) IsSSHCertificate ¶
func (a *BaseAccount) IsSSHCertificate() bool
func (*BaseAccount) IsSSHKey ¶
func (a *BaseAccount) IsSSHKey() bool
func (*BaseAccount) String ¶
func (a *BaseAccount) String() string
type BaseDomain ¶
type BasePlatform ¶
type ClipboardPolicy ¶
type ClipboardPolicy struct {
Copy *ClipboardPolicyItem `json:"copy"`
Paste *ClipboardPolicyItem `json:"paste"`
}
type ClipboardPolicyItem ¶
type Command ¶
type Command struct {
SessionID string `json:"session"`
OrgID string `json:"org_id"`
Input string `json:"input"`
Output string `json:"output"`
User string `json:"user"`
Server string `json:"asset"`
Account string `json:"account"`
Timestamp int64 `json:"timestamp"`
RiskLevel int64 `json:"risk_level"`
CmdFilterAclId string `json:"cmd_filter_acl"`
CmdGroupId string `json:"cmd_group"`
DateCreated time.Time `json:"@timestamp"`
}
type CommandACL ¶
type CommandACL struct {
ID string `json:"id"`
Action CommandAction `json:"action"`
CommandGroups []CommandFilterItem `json:"command_groups"`
IsActive bool `json:"is_active"`
Name string `json:"name"`
Priority int `json:"priority"`
Reviewers []interface{} `json:"reviewers"`
}
func (*CommandACL) Match ¶
func (sf *CommandACL) Match(cmd string) (CommandFilterItem, CommandAction, string)
type CommandACLs ¶
type CommandACLs []CommandACL
func (CommandACLs) Len ¶
func (f CommandACLs) Len() int
func (CommandACLs) Less ¶
func (f CommandACLs) Less(i, j int) bool
func (CommandACLs) Swap ¶
func (f CommandACLs) Swap(i, j int)
type CommandAction ¶
type CommandAction string
type CommandConfig ¶
type CommandConfig struct {
TypeName string `json:"TYPE"`
Other *OtherMeta `json:"OTHER,omitempty"`
Index string `json:"INDEX,omitempty"`
Hosts []string `json:"HOSTS,omitempty"`
DocType string `json:"DOC_TYPE,omitempty"`
ServerURL string `json:"SERVER_URL,omitempty"`
AuthToken string `json:"AUTH_TOKEN,omitempty"`
Bucket string `json:"BUCKET,omitempty"`
Measurement string `json:"MEASUREMENT,omitempty"`
}
type CommandFilterItem ¶
type CommandFilterItem struct {
ID string `json:"id"`
Content string `json:"content"`
IgnoreCase bool `json:"ignore_case"`
Name string `json:"name"`
Type string `json:"type"`
RePattern string `json:"pattern"`
// contains filtered or unexported fields
}
func (*CommandFilterItem) Pattern ¶
func (cf *CommandFilterItem) Pattern() FindStringer
type CommandTicketInfo ¶
type CommandTicketInfo struct {
TicketInfo
}
type ConnectMethod ¶
type ConnectOptions ¶
type ConnectOptions struct {
Charset *string `json:"charset,omitempty"`
DisableAutoHash *bool `json:"disableautohash,omitempty"`
BackspaceAsCtrlH *bool `json:"backspaceAsCtrlH,omitempty"`
UseSysDBA bool `json:"use_sysdba,omitempty"`
Resolution string `json:"resolution"`
RemoteMicrophone *bool `json:"remote_microphone,omitempty"`
RDPConnectionSpeed string `json:"rdp_connection_speed,omitempty"`
FilenameConflictResolution string `json:"file_name_conflict_resolution,omitempty"`
TerminalThemeName string `json:"terminal_theme_name,omitempty"`
Language string `json:"lang,omitempty"`
}
type ConnectToken ¶
type ConnectToken struct {
Id string `json:"id"`
User User `json:"user"`
Value string `json:"value"`
Account Account `json:"account"`
Actions Actions `json:"actions"`
Asset Asset `json:"asset"`
Protocol string `json:"protocol"`
Domain *Domain `json:"domain"`
Zone *Domain `json:"zone"`
Gateway *Gateway `json:"gateway"`
ExpireAt ExpireInfo `json:"expire_at"`
OrgId string `json:"org_id"`
OrgName string `json:"org_name"`
Platform Platform `json:"platform"`
ConnectMethod ConnectMethod `json:"connect_method"`
ConnectOptions ConnectOptions `json:"connect_options"`
CommandFilterACLs []CommandACL `json:"command_filter_acls"`
ClipboardPolicy *ClipboardPolicy `json:"clipboard_policy"`
DataMaskingRules []DataMaskingRule `json:"data_masking_rules"`
Ticket *ObjectId `json:"from_ticket,omitempty"`
TicketInfo interface{} `json:"from_ticket_info,omitempty"`
FaceMonitorToken string `json:"face_monitor_token,omitempty"`
SSHCertificate *SSHCertificateInfo `json:"ssh_certificate,omitempty"`
Code string `json:"code"`
Detail string `json:"detail"`
Error string `json:"error"`
}
func (*ConnectToken) ClearSSHCertificateCredential ¶
func (c *ConnectToken) ClearSSHCertificateCredential()
func (*ConnectToken) ClearSSHCertificatePrivateKey ¶
func (c *ConnectToken) ClearSSHCertificatePrivateKey()
func (*ConnectToken) CreateSession ¶
func (c *ConnectToken) CreateSession(addr string, loginFrom, SessionType LabelField) Session
type ConnectTokenInfo ¶
type ConnectTokenInfo struct {
ID string `json:"id"`
Value string `json:"value"`
ExpireTime int `json:"expire_time"`
Protocol string `json:"protocol"`
Account string `json:"account,omitempty"`
User *ObjectId `json:"user,omitempty"`
Asset *ObjectId `json:"asset,omitempty"`
InputUsername string `json:"input_username,omitempty"`
InputSecretType string `json:"input_secret_type,omitempty"`
PersonalCredentialID *string `json:"personal_credential_id,omitempty"`
ConnectMethod string `json:"connect_method,omitempty"`
ConnectOptions ConnectOptions `json:"connect_options,omitempty"`
Actions Actions `json:"actions,omitempty"`
IsActive *bool `json:"is_active,omitempty"`
IsReusable *bool `json:"is_reusable,omitempty"`
IsExpired *bool `json:"is_expired,omitempty"`
DateExpired *common.UTCTime `json:"date_expired,omitempty"`
OrgID string `json:"org_id,omitempty"`
OrgName string `json:"org_name,omitempty"`
RemoteAddr string `json:"remote_addr,omitempty"`
FaceToken string `json:"face_token,omitempty"`
FaceMonitorToken string `json:"face_monitor_token,omitempty"`
Ticket *ObjectId `json:"from_ticket,omitempty"`
TicketInfo TicketInfo `json:"from_ticket_info,omitempty"`
Code string `json:"code,omitempty"`
Detail string `json:"detail,omitempty"`
}
type DataMaskingRule ¶
type DataMaskingRules ¶
type DataMaskingRules []DataMaskingRule
func (DataMaskingRules) Len ¶
func (f DataMaskingRules) Len() int
func (DataMaskingRules) Less ¶
func (f DataMaskingRules) Less(i, j int) bool
func (DataMaskingRules) Swap ¶
func (f DataMaskingRules) Swap(i, j int)
type ExpireInfo ¶
type ExpireInfo int64
type FTPLog ¶
type FTPLog struct {
ID string `json:"id"`
User string `json:"user"`
Asset string `json:"asset"`
OrgID string `json:"org_id"`
Account string `json:"account"`
RemoteAddr string `json:"remote_addr"`
Operate string `json:"operate"`
Path string `json:"filename"`
DateStart common.UTCTime `json:"date_start"`
IsSuccess bool `json:"is_success"`
Session string `json:"session"`
}
func (*FTPLog) TargetPath ¶
type FindStringer ¶
type HeartbeatData ¶
type LabelField ¶
type LabelField string
const ( NORMALType LabelField = "normal" TUNNELType LabelField = "tunnel" COMMANDType LabelField = "command" SFTPType LabelField = "sftp" )
const ( LoginFromSSH LabelField = "ST" LoginFromWeb LabelField = "WT" LoginFromRT LabelField = "RT" LoginFromDT LabelField = "DT" LoginFromVT LabelField = "VT" )
func (LabelField) MarshalJSON ¶
func (s LabelField) MarshalJSON() ([]byte, error)
func (*LabelField) UnmarshalJSON ¶
func (s *LabelField) UnmarshalJSON(bytes []byte) error
type LabelValue ¶
type LifecycleEvent ¶
type LifecycleEvent string
const ( AssetConnectSuccess LifecycleEvent = "asset_connect_success" AssetConnectFinished LifecycleEvent = "asset_connect_finished" UserJoinSession LifecycleEvent = "user_join_session" UserLeaveSession LifecycleEvent = "user_leave_session" AdminJoinMonitor LifecycleEvent = "admin_join_monitor" AdminExitMonitor LifecycleEvent = "admin_exit_monitor" ReplayConvertStart LifecycleEvent = "replay_convert_start" ReplayConvertSuccess LifecycleEvent = "replay_convert_success" ReplayConvertFailure LifecycleEvent = "replay_convert_failure" ReplayUploadStart LifecycleEvent = "replay_upload_start" ReplayUploadSuccess LifecycleEvent = "replay_upload_success" ReplayUploadFailure LifecycleEvent = "replay_upload_failure" )
type NodeTreeList ¶
type NodeTreeList []NodeTree
type NodeTreeMeta ¶
type PaginationParam ¶
type PaginationResponse ¶
type PermAccount ¶
type PermAccount struct {
Name string `json:"name"`
Username string `json:"username"`
SecretType string `json:"secret_type"`
HasSecret bool `json:"has_secret"`
Actions Actions `json:"actions"`
Alias string `json:"alias"`
Secret string
}
func (*PermAccount) IsAnonymous ¶
func (a *PermAccount) IsAnonymous() bool
func (*PermAccount) IsInputUser ¶
func (a *PermAccount) IsInputUser() bool
func (*PermAccount) IsSSHCertificate ¶
func (a *PermAccount) IsSSHCertificate() bool
func (*PermAccount) IsSSHKey ¶
func (a *PermAccount) IsSSHKey() bool
func (*PermAccount) String ¶
func (a *PermAccount) String() string
type PermAccountList ¶
type PermAccountList []PermAccount
func (PermAccountList) Len ¶
func (a PermAccountList) Len() int
func (PermAccountList) Less ¶
func (a PermAccountList) Less(i, j int) bool
func (PermAccountList) Swap ¶
func (a PermAccountList) Swap(i, j int)
type PermAsset ¶
type PermAsset struct {
ID string `json:"id"`
Name string `json:"name"`
Address string `json:"address"`
Comment string `json:"comment"`
Platform BasePlatform `json:"platform"`
OrgID string `json:"org_id"`
OrgName string `json:"org_name"`
IsActive bool `json:"is_active"`
Type LabelField `json:"type"`
Category LabelField `json:"category"`
}
type PermAssetDetail ¶
type PermAssetDetail struct {
ID string `json:"id"`
Name string `json:"name"`
Address string `json:"address"`
Comment string `json:"comment"`
Platform BasePlatform `json:"platform"`
OrgID string `json:"org_id"`
OrgName string `json:"org_name"`
IsActive bool `json:"is_active"`
Type LabelField `json:"type"`
Category LabelField `json:"category"`
PermedAccounts []PermAccount `json:"permed_accounts"`
PermedProtocols []Protocol `json:"permed_protocols"`
}
func (*PermAssetDetail) String ¶
func (a *PermAssetDetail) String() string
func (*PermAssetDetail) SupportProtocol ¶
func (a *PermAssetDetail) SupportProtocol(protocol string) bool
type PermAssetList ¶
type PermAssetList []PermAsset
func (PermAssetList) SortBy ¶
func (a PermAssetList) SortBy(tp string) PermAssetList
type Permission ¶
type Permission struct {
Actions []string `json:"actions"`
}
func (*Permission) EnableConnect ¶
func (p *Permission) EnableConnect() bool
func (*Permission) EnableCopy ¶
func (p *Permission) EnableCopy() bool
func (*Permission) EnableDelete ¶
func (p *Permission) EnableDelete() bool
func (*Permission) EnableDownload ¶
func (p *Permission) EnableDownload() bool
func (*Permission) EnableDrive ¶
func (p *Permission) EnableDrive() bool
func (*Permission) EnablePaste ¶
func (p *Permission) EnablePaste() bool
func (*Permission) EnableShare ¶
func (p *Permission) EnableShare() bool
func (*Permission) EnableUpload ¶
func (p *Permission) EnableUpload() bool
type Platform ¶
type Platform struct {
BaseOs string `json:"base"`
MetaData map[string]interface{} `json:"meta"`
ID int `json:"id"`
Name string `json:"name"`
Protocols PlatformProtocols `json:"protocols"`
Category LabelValue `json:"category"`
Charset LabelValue `json:"charset"`
Type LabelValue `json:"type"`
SuEnabled bool `json:"su_enabled"`
SuMethod *LabelValue `json:"su_method,omitempty"`
//DomainEnabled bool `json:"domain_enabled"`
Comment string `json:"comment"`
}
func (Platform) GetProtocol ¶
func (p Platform) GetProtocol(protocol string) PlatformProtocol
func (Platform) GetProtocolSetting ¶
func (p Platform) GetProtocolSetting(protocol string) (PlatformProtocol, bool)
type PlatformProtocol ¶
type PlatformProtocol struct {
Protocol
Setting map[string]any `json:"setting"` // 参考 ProtocolSetting 里的字段
SecretTypes []string `json:"secret_types,omitempty"`
}
func (PlatformProtocol) GetSetting ¶
func (p PlatformProtocol) GetSetting() ProtocolSetting
type PlatformProtocols ¶
type PlatformProtocols []PlatformProtocol
func (PlatformProtocols) GetSftpPath ¶
func (p PlatformProtocols) GetSftpPath(protocol string) string
type ProtocolSetting ¶
type ProtocolSetting struct {
Security string `json:"security"`
SftpEnabled bool `json:"sftp_enabled"`
SftpHome string `json:"sftp_home"`
AutoFill bool `json:"auto_fill"`
UsernameSelector string `json:"username_selector"`
PasswordSelector string `json:"password_selector"`
SubmitSelector string `json:"submit_selector"`
SuccessSelector string `json:"success_selector,omitempty"`
InteractiveSelector string `json:"interactive_selector,omitempty"`
Console bool `json:"console"`
AdDomain string `json:"ad_domain"`
// for redis 特殊处理的字段
AuthUsername bool `json:"auth_username"`
TelnetUsernamePrompt string `json:"username_prompt"`
TelnetPasswordPrompt string `json:"password_prompt"`
TelnetSuccessPrompt string `json:"success_prompt"`
// for mongodb
AuthSource string `json:"auth_source"`
ConnectionOpts string `json:"connection_options"`
// for sqlserver
Version string `json:"version"` // choice ('>=2014', '< 2014')
Encrypt bool `json:"encrypt"` // for sqlserver 2008
EnableClusterMode bool `json:"enable_cluster_mode"` // for redis-cli
}
type Protocols ¶
type Protocols []Protocol
func (Protocols) GetProtocolPort ¶
func (Protocols) IsSupportProtocol ¶
type PublicSetting ¶
type PublicSetting struct {
Interface struct {
LoginTitle string `json:"login_title"`
LogOut string `json:"logo_logout"`
Index string `json:"logo_index"`
Image string `json:"login_image"`
Favicon string `json:"favicon"`
} `json:"INTERFACE"`
EnableWatermark bool `json:"SECURITY_WATERMARK_ENABLED"`
EnableAnnouncement bool `json:"ANNOUNCEMENT_ENABLED"`
Announcement struct {
Id string `json:"ID"`
Subject string `json:"SUBJECT"`
Content string `json:"CONTENT"`
Link string `json:"LINK"`
DateStart common.UTCTime `json:"DATE_START"`
DateEnd common.UTCTime `json:"DATE_END"`
} `json:"ANNOUNCEMENT"`
XpackEnabled bool `json:"XPACK_ENABLED"`
ValidLicense bool `json:"XPACK_LICENSE_IS_VALID"`
}
type Regexp2 ¶
type Regexp2 struct {
// contains filtered or unexported fields
}
func (*Regexp2) FindString ¶
type RemainReplay ¶
type RemainReplay struct {
Id string // session id
TargetDate string
AbsFilePath string
Version ReplayVersion
IsGzip bool
}
func (*RemainReplay) GetGzFilename ¶
func (r *RemainReplay) GetGzFilename() string
func (*RemainReplay) TargetPath ¶
func (r *RemainReplay) TargetPath() string
type RemoteAppCommandOption ¶
type ReplayConfig ¶
type ReplayConfig struct {
TypeName string `json:"TYPE"`
/*
obs oss
*/
Endpoint string `json:"ENDPOINT,omitempty"`
Bucket string `json:"BUCKET,omitempty"`
AccessKey string `json:"ACCESS_KEY,omitempty"`
SecretKey string `json:"SECRET_KEY,omitempty"`
Region string `json:"REGION,omitempty"`
/*
azure 专属
*/
AccountName string `json:"ACCOUNT_NAME,omitempty"`
AccountKey string `json:"ACCOUNT_KEY,omitempty"`
EndpointSuffix string `json:"ENDPOINT_SUFFIX,omitempty"`
ContainerName string `json:"CONTAINER_NAME,omitempty"`
}
type ReplayError ¶
type ReplayError LabelField
const ( SessionReplayErrConnectFailed ReplayError = "connect_failed" SessionReplayErrCreatedFailed ReplayError = "replay_create_failed" SessionReplayErrUploadFailed ReplayError = "replay_upload_failed" SessionReplayErrUnsupported ReplayError = "replay_unsupported" SessionReplayErrConvertFailed ReplayError = "replay_convert_failed" )
func (ReplayError) Error ¶
func (r ReplayError) Error() string
type ReplayVersion ¶
type ReplayVersion string
const ( UnKnown ReplayVersion = "" Version2 ReplayVersion = "2" Version3 ReplayVersion = "3" Version4 ReplayVersion = "4" Version5 ReplayVersion = "5" )
func ParseReplayVersion ¶
func ParseReplayVersion(gzFile string, defaultValue ReplayVersion) ReplayVersion
type SSHCertificateInfo ¶
type SecretInfo ¶
type SecretType ¶
type SecretType LabelValue
type Session ¶
type Session struct {
ID string `json:"id,omitempty"`
User string `json:"user"`
Asset string `json:"asset"`
Account string `json:"account"`
LoginFrom LabelField `json:"login_from,omitempty"`
RemoteAddr string `json:"remote_addr"`
Protocol string `json:"protocol"`
DateStart common.UTCTime `json:"date_start"`
OrgID string `json:"org_id"`
UserID string `json:"user_id"`
AssetID string `json:"asset_id"`
AccountID string `json:"account_id"`
Type LabelField `json:"type"`
ErrReason LabelField `json:"error_reason,omitempty"`
TokenId string `json:"token_id,omitempty"`
Comment string `json:"comment,omitempty"`
LangCode string `json:"lang_code,omitempty"`
}
type SessionLifecycleLog ¶
type SessionLifecycleReasonErr ¶
type SessionLifecycleReasonErr string
const ( ReasonErrConnectFailed SessionLifecycleReasonErr = "connect_failed" ReasonErrConnectDisconnect SessionLifecycleReasonErr = "connect_disconnect" ReasonErrUserClose SessionLifecycleReasonErr = "user_close" ReasonErrIdleDisconnect SessionLifecycleReasonErr = "idle_disconnect" ReasonErrAdminTerminate SessionLifecycleReasonErr = "admin_terminate" ReasonErrMaxSessionTimeout SessionLifecycleReasonErr = "max_session_timeout" ReasonErrPermissionExpired SessionLifecycleReasonErr = "permission_expired" ReasonErrNullStorage SessionLifecycleReasonErr = "null_storage" )
func (SessionLifecycleReasonErr) String ¶
func (s SessionLifecycleReasonErr) String() string
type SharePostData ¶
type SharePostData struct {
}
type ShareRecord ¶
type ShareRecord struct {
}
func (ShareRecord) Writeable ¶
func (s ShareRecord) Writeable() bool
type SharingSession ¶
type SharingSessionRequest ¶
type SpecInfo ¶
type SpecInfo struct {
// database
DBName string `json:"db_name"`
PgSSLMode string `json:"pg_ssl_mode"`
UseSSL bool `json:"use_ssl"`
AllowInvalidCert bool `json:"allow_invalid_cert"`
// web
Autofill string `json:"autofill"`
UsernameSelector string `json:"username_selector"`
PasswordSelector string `json:"password_selector"`
SubmitSelector string `json:"submit_selector"`
HttpProxy string `json:"proxy"`
SuccessSelector string `json:"success_selector,omitempty"`
InteractiveSelector string `json:"interactive_selector,omitempty"`
Script []WebLoginStep `json:"script,omitempty"`
AllowedURLs []string `json:"allowed_urls,omitempty"`
}
type StdRegexp ¶
type StdRegexp struct {
// contains filtered or unexported fields
}
func (*StdRegexp) FindString ¶
type SystemRole ¶
type TaskKwargs ¶
type TerminalConfig ¶
type TerminalConfig struct {
AssetListPageSize string `json:"TERMINAL_ASSET_LIST_PAGE_SIZE"`
AssetListSortBy string `json:"TERMINAL_ASSET_LIST_SORT_BY"`
HeaderTitle string `json:"TERMINAL_HEADER_TITLE"`
PasswordAuth bool `json:"TERMINAL_PASSWORD_AUTH"`
PublicKeyAuth bool `json:"TERMINAL_PUBLIC_KEY_AUTH"`
ReplayStorage ReplayConfig `json:"TERMINAL_REPLAY_STORAGE"`
CommandStorage CommandConfig `json:"TERMINAL_COMMAND_STORAGE"`
SessionKeepDuration int `json:"TERMINAL_SESSION_KEEP_DURATION"`
TelnetRegex string `json:"TERMINAL_TELNET_REGEX"`
MaxIdleTime int `json:"SECURITY_MAX_IDLE_TIME"`
MaxSessionTime int `json:"SECURITY_MAX_SESSION_TIME"`
HeartbeatDuration int `json:"TERMINAL_HEARTBEAT_INTERVAL"`
HostKey string `json:"TERMINAL_HOST_KEY"`
MaxStoreFTPFileSize int `json:"FTP_FILE_MAX_STORE"`
ChatAIEnabled bool `json:"CHAT_AI_ENABLED"`
ChatAIMethod string `json:"CHAT_AI_METHOD"`
ChatAIProvider string `json:"CHAT_AI_PROVIDER"`
ChatAIBaseUrl string `json:"CHAT_AI_BASE_URL"`
ChatAIApiKey string `json:"CHAT_AI_API_KEY"`
ChatAIProxy string `json:"CHAT_AI_PROXY"`
ChatAIModel string `json:"CHAT_AI_MODEL"`
LicenseContent string `json:"XPACK_LICENSE_CONTENT"`
LicenseIsValid bool `json:"XPACK_LICENSE_IS_VALID"`
}
type TerminalTask ¶
type TerminalTask struct {
ID string `json:"id"`
Name string `json:"name"`
Args string `json:"args"`
Kwargs TaskKwargs `json:"kwargs"`
IsFinished bool
TokenStatus TokenCheckStatus `json:"-"`
}
type TicketInfo ¶
type TicketState ¶
type TicketState struct {
ID string `json:"id"`
Processor string `json:"processor,omitempty"`
State LabelField `json:"state"`
Status LabelField `json:"status"`
}
type TokenCheckStatus ¶
type TreeMeta ¶
type TreeMeta struct {
Type string `json:"type"`
Data NodeTreeMeta `json:"data"`
}
type User ¶
type User struct {
ID string `json:"id"`
Name string `json:"name"`
Username string `json:"username"`
Email string `json:"email"`
Role string `json:"role"`
IsValid bool `json:"is_valid"`
IsActive bool `json:"is_active"`
OTPLevel int `json:"otp_level"`
Language string `json:"lang"`
HasPublicKeys bool `json:"has_public_keys"`
IsServiceAccount bool `json:"is_service_account"`
OrgRoles []OrgRole `json:"org_roles"`
SystemRoles []SystemRole `json:"system_roles"`
IsOrgAdmin bool `json:"is_org_admin"`
IsSuperuser bool `json:"is_superuser"`
IsExpired bool `json:"is_expired"`
Groups []Group `json:"groups"`
DateExpired *common.UTCTime `json:"date_expired"`
LastLogin *common.UTCTime `json:"last_login"`
Phone Phone `json:"phone"`
}
type UserKokoPreference ¶
type UserKokoPreference struct {
Basic KokoBasic `json:"basic"`
}
type ValidateResult ¶
type VirtualApp ¶
type VirtualAppContainer ¶
type VirtualAppContainer struct {
ContainerId string `json:"container_id"`
Host string `json:"host"`
Port int `json:"port"`
Protocol string `json:"protocol"`
Username string `json:"username"`
Password string `json:"password"`
SFTPPort int `json:"sftp_port"`
}
func (VirtualAppContainer) String ¶
func (v VirtualAppContainer) String() string
type VirtualAppOption ¶
type VirtualAppProvider ¶
Source Files
¶
- access_key.go
- account.go
- account_chat.go
- action.go
- asset.go
- asset_list.go
- audit.go
- audit_command.go
- component.go
- data_masking.go
- expire.go
- filter_rule.go
- heartbeat.go
- node.go
- node_tree.go
- pagination.go
- perm_asset.go
- permission.go
- platform.go
- remain_replay.go
- remote_app.go
- session.go
- setting.go
- share.go
- terminal.go
- ticket.go
- token.go
- user.go
Click to show internal directories.
Click to hide internal directories.