Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterSSHShieldServiceServer(s grpc.ServiceRegistrar, srv SSHShieldServiceServer)
- type ReportFailedLoginRequest
- func (*ReportFailedLoginRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ReportFailedLoginRequest) GetClientIp() string
- func (x *ReportFailedLoginRequest) GetClientPort() int32
- func (x *ReportFailedLoginRequest) GetFailureInfo() []string
- func (x *ReportFailedLoginRequest) GetProxyId() string
- func (x *ReportFailedLoginRequest) GetTimestamp() string
- func (x *ReportFailedLoginRequest) GetUsername() string
- func (*ReportFailedLoginRequest) ProtoMessage()
- func (x *ReportFailedLoginRequest) ProtoReflect() protoreflect.Message
- func (x *ReportFailedLoginRequest) Reset()
- func (x *ReportFailedLoginRequest) String() string
- type ReportFailedLoginResponse
- func (*ReportFailedLoginResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ReportFailedLoginResponse) GetBlockSeconds() int64
- func (x *ReportFailedLoginResponse) GetBlocked() bool
- func (x *ReportFailedLoginResponse) GetWhitelisted() bool
- func (*ReportFailedLoginResponse) ProtoMessage()
- func (x *ReportFailedLoginResponse) ProtoReflect() protoreflect.Message
- func (x *ReportFailedLoginResponse) Reset()
- func (x *ReportFailedLoginResponse) String() string
- type SSHShieldServiceClient
- type SSHShieldServiceServer
- type UnimplementedSSHShieldServiceServer
- type UnsafeSSHShieldServiceServer
Constants ¶
const ( SSHShieldService_GetVersionInfo_FullMethodName = "/sshshield.v1.SSHShieldService/GetVersionInfo" SSHShieldService_ReportFailedLogin_FullMethodName = "/sshshield.v1.SSHShieldService/ReportFailedLogin" )
Variables ¶
var File_sshshield_v1_sshshield_proto protoreflect.FileDescriptor
var SSHShieldService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "sshshield.v1.SSHShieldService", HandlerType: (*SSHShieldServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetVersionInfo", Handler: _SSHShieldService_GetVersionInfo_Handler, }, { MethodName: "ReportFailedLogin", Handler: _SSHShieldService_ReportFailedLogin_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "sshshield/v1/sshshield.proto", }
SSHShieldService_ServiceDesc is the grpc.ServiceDesc for SSHShieldService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterSSHShieldServiceServer ¶
func RegisterSSHShieldServiceServer(s grpc.ServiceRegistrar, srv SSHShieldServiceServer)
Types ¶
type ReportFailedLoginRequest ¶
type ReportFailedLoginRequest struct {
// client_ip is the source IP address of the failed attempt, IPv4 or IPv6.
// Required; an unparseable value is rejected with INVALID_ARGUMENT.
ClientIp string `protobuf:"bytes,1,opt,name=client_ip,json=clientIp,proto3" json:"client_ip,omitempty"`
// client_port is the source TCP port of the attempt, when known.
ClientPort int32 `protobuf:"varint,2,opt,name=client_port,json=clientPort,proto3" json:"client_port,omitempty"`
// username is the account the attempt tried to authenticate as.
Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"`
// timestamp is the RFC 3339 time the attempt occurred, as observed by the
// caller. Informational only; ssh-shield rate-limits against its own clock.
Timestamp string `protobuf:"bytes,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
// failure_info carries optional human-readable detail about why the attempt
// failed (auth method tried, server message, ...).
FailureInfo []string `protobuf:"bytes,5,rep,name=failure_info,json=failureInfo,proto3" json:"failure_info,omitempty"`
// proxy_id identifies the ssh-proxy instance that observed the attempt.
ProxyId string `protobuf:"bytes,6,opt,name=proxy_id,json=proxyId,proto3" json:"proxy_id,omitempty"`
// contains filtered or unexported fields
}
ReportFailedLoginRequest describes a single failed SSH login attempt. Its fields mirror the NATS FailedConnectionEvent one-for-one.
func (*ReportFailedLoginRequest) Descriptor
deprecated
func (*ReportFailedLoginRequest) Descriptor() ([]byte, []int)
Deprecated: Use ReportFailedLoginRequest.ProtoReflect.Descriptor instead.
func (*ReportFailedLoginRequest) GetClientIp ¶
func (x *ReportFailedLoginRequest) GetClientIp() string
func (*ReportFailedLoginRequest) GetClientPort ¶
func (x *ReportFailedLoginRequest) GetClientPort() int32
func (*ReportFailedLoginRequest) GetFailureInfo ¶
func (x *ReportFailedLoginRequest) GetFailureInfo() []string
func (*ReportFailedLoginRequest) GetProxyId ¶
func (x *ReportFailedLoginRequest) GetProxyId() string
func (*ReportFailedLoginRequest) GetTimestamp ¶
func (x *ReportFailedLoginRequest) GetTimestamp() string
func (*ReportFailedLoginRequest) GetUsername ¶
func (x *ReportFailedLoginRequest) GetUsername() string
func (*ReportFailedLoginRequest) ProtoMessage ¶
func (*ReportFailedLoginRequest) ProtoMessage()
func (*ReportFailedLoginRequest) ProtoReflect ¶
func (x *ReportFailedLoginRequest) ProtoReflect() protoreflect.Message
func (*ReportFailedLoginRequest) Reset ¶
func (x *ReportFailedLoginRequest) Reset()
func (*ReportFailedLoginRequest) String ¶
func (x *ReportFailedLoginRequest) String() string
type ReportFailedLoginResponse ¶
type ReportFailedLoginResponse struct {
// whitelisted is true when client_ip matched ssh-shield's whitelist. The
// attempt was then ignored and no counter was touched; blocked is false.
Whitelisted bool `protobuf:"varint,1,opt,name=whitelisted,proto3" json:"whitelisted,omitempty"`
// blocked is true when registering this attempt caused the IP to be
// blocked (or to have its block escalated).
Blocked bool `protobuf:"varint,2,opt,name=blocked,proto3" json:"blocked,omitempty"`
// block_seconds is the duration the IP is blocked for, in seconds. Set only
// when blocked is true.
BlockSeconds int64 `protobuf:"varint,3,opt,name=block_seconds,json=blockSeconds,proto3" json:"block_seconds,omitempty"`
// contains filtered or unexported fields
}
ReportFailedLoginResponse reports what ssh-shield did with the attempt.
func (*ReportFailedLoginResponse) Descriptor
deprecated
func (*ReportFailedLoginResponse) Descriptor() ([]byte, []int)
Deprecated: Use ReportFailedLoginResponse.ProtoReflect.Descriptor instead.
func (*ReportFailedLoginResponse) GetBlockSeconds ¶
func (x *ReportFailedLoginResponse) GetBlockSeconds() int64
func (*ReportFailedLoginResponse) GetBlocked ¶
func (x *ReportFailedLoginResponse) GetBlocked() bool
func (*ReportFailedLoginResponse) GetWhitelisted ¶
func (x *ReportFailedLoginResponse) GetWhitelisted() bool
func (*ReportFailedLoginResponse) ProtoMessage ¶
func (*ReportFailedLoginResponse) ProtoMessage()
func (*ReportFailedLoginResponse) ProtoReflect ¶
func (x *ReportFailedLoginResponse) ProtoReflect() protoreflect.Message
func (*ReportFailedLoginResponse) Reset ¶
func (x *ReportFailedLoginResponse) Reset()
func (*ReportFailedLoginResponse) String ¶
func (x *ReportFailedLoginResponse) String() string
type SSHShieldServiceClient ¶
type SSHShieldServiceClient interface {
// GetVersionInfo returns build and version metadata for this service: its
// released semantic version, the git commit it was built from, and a short
// description of what the service does.
GetVersionInfo(ctx context.Context, in *v1.GetVersionInfoRequest, opts ...grpc.CallOption) (*v1.GetVersionInfoResponse, error)
// ReportFailedLogin records a failed SSH login attempt from a source IP and
// runs it through ssh-shield's sliding-window rate limiter, blocking the IP
// via the configured plugins once it crosses the threshold. It is the
// request-driven equivalent of the failure events ssh-shield consumes from
// NATS and carries the same fields.
ReportFailedLogin(ctx context.Context, in *ReportFailedLoginRequest, opts ...grpc.CallOption) (*ReportFailedLoginResponse, error)
}
SSHShieldServiceClient is the client API for SSHShieldService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
SSHShieldService is the control-plane gRPC API of the ssh-shield service.
func NewSSHShieldServiceClient ¶
func NewSSHShieldServiceClient(cc grpc.ClientConnInterface) SSHShieldServiceClient
type SSHShieldServiceServer ¶
type SSHShieldServiceServer interface {
// GetVersionInfo returns build and version metadata for this service: its
// released semantic version, the git commit it was built from, and a short
// description of what the service does.
GetVersionInfo(context.Context, *v1.GetVersionInfoRequest) (*v1.GetVersionInfoResponse, error)
// ReportFailedLogin records a failed SSH login attempt from a source IP and
// runs it through ssh-shield's sliding-window rate limiter, blocking the IP
// via the configured plugins once it crosses the threshold. It is the
// request-driven equivalent of the failure events ssh-shield consumes from
// NATS and carries the same fields.
ReportFailedLogin(context.Context, *ReportFailedLoginRequest) (*ReportFailedLoginResponse, error)
// contains filtered or unexported methods
}
SSHShieldServiceServer is the server API for SSHShieldService service. All implementations must embed UnimplementedSSHShieldServiceServer for forward compatibility.
SSHShieldService is the control-plane gRPC API of the ssh-shield service.
type UnimplementedSSHShieldServiceServer ¶
type UnimplementedSSHShieldServiceServer struct{}
UnimplementedSSHShieldServiceServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedSSHShieldServiceServer) GetVersionInfo ¶
func (UnimplementedSSHShieldServiceServer) GetVersionInfo(context.Context, *v1.GetVersionInfoRequest) (*v1.GetVersionInfoResponse, error)
func (UnimplementedSSHShieldServiceServer) ReportFailedLogin ¶
func (UnimplementedSSHShieldServiceServer) ReportFailedLogin(context.Context, *ReportFailedLoginRequest) (*ReportFailedLoginResponse, error)
type UnsafeSSHShieldServiceServer ¶
type UnsafeSSHShieldServiceServer interface {
// contains filtered or unexported methods
}
UnsafeSSHShieldServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SSHShieldServiceServer will result in compilation errors.