Documentation ¶
Index ¶
- Constants
- func SortAssetNodesByKey(assetNodes []Node)
- func SortSystemUserByPriority(users []SystemUser)
- type Asset
- type AssetList
- type AssetNodeSorter
- type AssetsPaginationResponse
- type Command
- type Database
- type Domain
- type FTPLog
- type Gateway
- type Node
- type NodeList
- type NodeTreeAsset
- type NodeTreeList
- type RoomMessage
- type RuleAction
- type SystemUser
- type SystemUserAuthInfo
- type SystemUserFilterRule
- type Terminal
- type TerminalTask
- type TokenUser
- type User
Constants ¶
View Source
const ( AllAction = "all" ConnectAction = "connect" UploadAction = "upload_file" DownloadAction = "download_file" )
View Source
const ( OperateRemoveDir = "Rmdir" OperateDownaload = "Download" OperateUpload = "Upload" OperateRename = "Rename" OperateMkdir = "Mkdir" OperateDelete = "Delete" OperateSymlink = "Symlink" )
View Source
const ( ContextKeyUser contextKey = iota + 1 ContextKeyRemoteAddr ContextKeyClient ContextKeyConfirmRequired ContextKeyConfirmFailed )
View Source
const ( HighRiskFlag = "1" LessRiskFlag = "0" )
View Source
const ( PingEvent = "Ping" DataEvent = "Data" WindowsEvent = "Windows" MaxIdleEvent = "MaxIdle" // 退出 ExitEvent = "Exit" // 退出 LogoutEvent = "Logout" // 退出 AdminTerminateEvent = "Terminate" //退出 )
View Source
const LoginModeManual = "manual"
Variables ¶
This section is empty.
Functions ¶
func SortAssetNodesByKey ¶
func SortAssetNodesByKey(assetNodes []Node)
func SortSystemUserByPriority ¶
func SortSystemUserByPriority(users []SystemUser)
Types ¶
type Asset ¶
type Asset struct { ID string `json:"id"` Hostname string `json:"hostname"` IP string `json:"ip"` Os string `json:"os"` Domain string `json:"domain"` Comment string `json:"comment"` Protocols []string `json:"protocols,omitempty"` OrgID string `json:"org_id"` OrgName string `json:"org_name"` Platform string `json:"platform,omitempty"` }
func ConvertMetaToAsset ¶
func (*Asset) IsSupportProtocol ¶
func (*Asset) ProtocolPort ¶
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 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"` SystemUser string `json:"system_user"` Timestamp int64 `json:"timestamp"` RiskLevel int64 `json:"risk_level"` }
type Database ¶
type FTPLog ¶
type FTPLog struct { User string `json:"user"` Hostname string `json:"asset"` OrgID string `json:"org_id"` SystemUser string `json:"system_user"` RemoteAddr string `json:"remote_addr"` Operate string `json:"operate"` Path string `json:"filename"` DataStart string `json:"data_start"` IsSuccess bool `json:"is_success"` }
type Node ¶
type Node struct { ID string `json:"id"` Key string `json:"key"` Name string `json:"name"` Value string `json:"value"` Parent string `json:"parent"` AssetsAmount int `json:"assets_amount"` OrgID string `json:"org_id"` }
func ConvertMetaToNode ¶
type NodeTreeAsset ¶
type NodeTreeList ¶
type NodeTreeList []NodeTreeAsset
type RoomMessage ¶
func (RoomMessage) Marshal ¶
func (m RoomMessage) Marshal() []byte
func (RoomMessage) UnMarshal ¶
func (m RoomMessage) UnMarshal(p interface{})
type RuleAction ¶
type RuleAction int
const ( ActionDeny RuleAction = 0 ActionAllow RuleAction = 1 ActionUnknown RuleAction = 2 TypeRegex = "regex" TypeCmd = "command" )
type SystemUser ¶
type SystemUser struct { ID string `json:"id"` Name string `json:"name"` Username string `json:"username"` Priority int `json:"priority"` Protocol string `json:"protocol"` Comment string `json:"comment"` LoginMode string `json:"login_mode"` Password string `json:"password"` PrivateKey string `json:"private_key"` Actions []string `json:"actions"` SftpRoot string `json:"sftp_root"` OrgId string `json:"org_id"` OrgName string `json:"org_name"` UsernameSameWithUser bool `json:"username_same_with_user"` }
type SystemUserAuthInfo ¶
type SystemUserFilterRule ¶
type SystemUserFilterRule struct { Priority int `json:"priority"` Type string `json:"type"` Content string `json:"content"` Action RuleAction `json:"action"` // contains filtered or unexported fields }
func (*SystemUserFilterRule) Match ¶
func (sf *SystemUserFilterRule) Match(cmd string) (RuleAction, string)
func (*SystemUserFilterRule) Pattern ¶
func (sf *SystemUserFilterRule) Pattern() *regexp.Regexp
type TerminalTask ¶
Click to show internal directories.
Click to hide internal directories.