events

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Copyright 2015 Gravitational, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2015 Gravitational, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	DefaultLimit = 20
	Asc          = 1
	Desc         = -1
)

Variables

This section is empty.

Functions

func FilterToURL

func FilterToURL(f Filter) (url.Values, error)

Types

type AuthAttempt

type AuthAttempt struct {
	// Session is SSH session ID
	SessionID string `json:"sid"`
	// User is SSH user
	User string `json:"user"`
	// Success - true if auth was successfull, false otherwise
	Success bool `json:"success"`
	// Error contains rejection reason if present
	Error string `json:"error"`
	// LocalAddr local connecting address
	LocalAddr string `json:"laddr"`
	// RemoteAddr remote connecting address
	RemoteAddr string `json:"raddr"`
	// Key is a public key used for auth
	Key string `json:"key"`
}

AuthSuccess indicates a successfull connection and authentication attempt

func NewAuthAttempt

func NewAuthAttempt(conn ssh.ConnMetadata, key ssh.PublicKey, success bool, err error) *AuthAttempt

func (*AuthAttempt) Schema

func (*AuthAttempt) Schema() string

type Exec

type Exec struct {
	// User is SSH user
	User string `json:"user"`

	SessionID string `json:"sid"`

	// Command is a command name with arguments
	Command string `json:"command"`

	// Code is a return code
	Code int `json:"code"`

	// Error is a error if command failed to execute
	Error string `json:"error"`

	// Log is a captured command output
	Log string `json:"out"`
}

Exec is a result of execution of a remote command on the target server

func NewExec

func NewExec(command string, out io.Reader, code int, err error) *Exec

func (*Exec) Schema

func (*Exec) Schema() string

type Filter

type Filter struct {
	Start     time.Time
	End       time.Time
	Limit     int
	Order     int
	SessionID string
}

func FilterFromURL

func FilterFromURL(vals url.Values) (*Filter, error)

func (Filter) String

func (f Filter) String() string

type Log

type Log interface {
	Log(id lunk.EventID, e lunk.Event)
	LogEntry(lunk.Entry) error
	GetEvents(filter Filter) ([]lunk.Entry, error)
}

type Message

type Message struct {
	// User is SSH user
	User string `json:"user"`

	SessionID string `json:"sid"`

	// Message
	Message string `json:"message"`
}

Message is a user message sent in a session

func (*Message) Schema

func (*Message) Schema() string

type SCP

type SCP struct {
	// User is SSH user
	User string `json:"user"`

	SessionID string `json:"sid"`
}

func (*SCP) Schema

func (*SCP) Schema() string

type ShellSession

type ShellSession struct {
	SessionID string `json:"sid"`

	// Shell is a shell name
	Shell string `json:"command"`

	// RecordID holds the id with the session recording
	RecordID string `json:"rid"`

	// User is SSH user
	User string `json:"user"`

	// LocalAddr local connecting address
	LocalAddr string `json:"laddr"`

	// RemoteAddr remote connecting address
	RemoteAddr string `json:"raddr"`
}

Shell is a result of execution of a in interactive shell

func NewShellSession

func NewShellSession(sid string, conn ssh.ConnMetadata, shell string, recordID string) *ShellSession

func (*ShellSession) Schema

func (*ShellSession) Schema() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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