csle_collector.elk_manager package

Submodules

csle_collector.elk_manager.elk_manager module

class csle_collector.elk_manager.elk_manager.ElkManagerServicer[source]

Bases: csle_collector.elk_manager.elk_manager_pb2_grpc.ElkManagerServicer

gRPC server for managing an ELK stack. Allows to start/stop the ELK stack remotely and also to query the state of the ELK stack.

getElkStatus(request: elk_manager_pb2.GetElkStatusMsg, context: grpc.ServicerContext) elk_manager_pb2.ElkDTO[source]

Gets the state of the ELK server

Parameters
  • request – the gRPC request

  • context – the gRPC context

Returns

an ElkDTO with the state of the ELK stack server

startElastic(request: elk_manager_pb2.StartElasticMsg, context: grpc.ServicerContext) elk_manager_pb2.ElkDTO[source]

Starts elasticsearch

Parameters
  • request – the gRPC request

  • context – the gRPC context

Returns

an ElkDTO with the state of the ELK server

startElk(request: elk_manager_pb2.StartElkMsg, context: grpc.ServicerContext) elk_manager_pb2.ElkDTO[source]

Starts the ELK stack

Parameters
  • request – the gRPC request

  • context – the gRPC context

Returns

an ElkDTO with the state of the ELK server

startKibana(request: elk_manager_pb2.StartKibanaMsg, context: grpc.ServicerContext) elk_manager_pb2.ElkDTO[source]

Starts Kibana

Parameters
  • request – the gRPC request

  • context – the gRPC context

Returns

an ElkDTO with the state of the ELK server

startLogstash(request: elk_manager_pb2.StartLogstashMsg, context: grpc.ServicerContext) elk_manager_pb2.ElkDTO[source]

Starts Logstash

Parameters
  • request – the gRPC request

  • context – the gRPC context

Returns

an ElkDTO with the state of the ELK server

stopElastic(request: elk_manager_pb2.StartElasticMsg, context: grpc.ServicerContext) elk_manager_pb2.ElkDTO[source]

Stops elasticsearch

Parameters
  • request – the gRPC request

  • context – the gRPC context

Returns

an ElkDTO with the state of the ELK server

stopElk(request: elk_manager_pb2.StopElkMsg, context: grpc.ServicerContext) elk_manager_pb2.ElkDTO[source]

Stops the ELK stack

Parameters
  • request – the gRPC request

  • context – the gRPC context

Returns

an ElkDTO with the state of the ELK stack

stopKibana(request: elk_manager_pb2.StopKibanaMsg, context: grpc.ServicerContext) elk_manager_pb2.ElkDTO[source]

Stops Kibana

Parameters
  • request – the gRPC request

  • context – the gRPC context

Returns

an ElkDTO with the state of the ELK server

stopLogstash(request: elk_manager_pb2.StopLogstashMsg, context: grpc.ServicerContext) elk_manager_pb2.ElkDTO[source]

Stops Logstash

Parameters
  • request – the gRPC request

  • context – the gRPC context

Returns

an ElkDTO with the state of the ELK server

csle_collector.elk_manager.elk_manager.serve(port: int = 50045, log_dir: str = '/', max_workers: int = 10, log_file_name: str = 'elk_manager.log') None[source]

Starts the gRPC server for managing the ELK stack

Parameters
  • port – the port that the server will listen to

  • log_dir – the directory to write the log file

  • log_file_name – the file name of the log

  • max_workers – the maximum number of GRPC workers

Returns

None

csle_collector.elk_manager.elk_manager_pb2 module

Generated protocol buffer code.

csle_collector.elk_manager.elk_manager_pb2_grpc module

Client and server classes corresponding to protobuf-defined services.

class csle_collector.elk_manager.elk_manager_pb2_grpc.ElkManager[source]

Bases: object

Interface exported by the server

static getElkStatus(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None)[source]
static startElastic(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None)[source]
static startElk(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None)[source]
static startKibana(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None)[source]
static startLogstash(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None)[source]
static stopElastic(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None)[source]
static stopElk(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None)[source]
static stopKibana(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None)[source]
static stopLogstash(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None)[source]
class csle_collector.elk_manager.elk_manager_pb2_grpc.ElkManagerServicer[source]

Bases: object

Interface exported by the server

getElkStatus(request, context)[source]

Missing associated documentation comment in .proto file.

startElastic(request, context)[source]

Missing associated documentation comment in .proto file.

startElk(request, context)[source]

Missing associated documentation comment in .proto file.

startKibana(request, context)[source]

Missing associated documentation comment in .proto file.

startLogstash(request, context)[source]

Missing associated documentation comment in .proto file.

stopElastic(request, context)[source]

Missing associated documentation comment in .proto file.

stopElk(request, context)[source]

Missing associated documentation comment in .proto file.

stopKibana(request, context)[source]

Missing associated documentation comment in .proto file.

stopLogstash(request, context)[source]

Missing associated documentation comment in .proto file.

class csle_collector.elk_manager.elk_manager_pb2_grpc.ElkManagerStub(channel)[source]

Bases: object

Interface exported by the server

csle_collector.elk_manager.elk_manager_pb2_grpc.add_ElkManagerServicer_to_server(servicer, server)[source]

csle_collector.elk_manager.elk_manager_util module

class csle_collector.elk_manager.elk_manager_util.ElkManagerUtil[source]

Bases: object

Class with utility functions related to the ELK Manager

static elk_dto_empty() elk_manager_pb2.ElkDTO[source]
Returns

an empty ElkDTO

static elk_dto_from_dict(d: Dict[str, Any]) elk_manager_pb2.ElkDTO[source]

Converts a dict representation of an ElkDTO to a DTO

Parameters

d – the dict to convert

Returns

the converted DTO

static elk_dto_to_dict(elk_dto: elk_manager_pb2.ElkDTO) Dict[str, Any][source]

Converts an ElkDTO to a dict

Parameters

elk_dto – the dto to convert

Returns

a dict representation of the DTO

csle_collector.elk_manager.query_elk_manager module

csle_collector.elk_manager.query_elk_manager.get_elk_status(stub: csle_collector.elk_manager.elk_manager_pb2_grpc.ElkManagerStub, timeout=60) elk_manager_pb2.ElkDTO[source]

Queries the server for the ELK stack status

Parameters
  • stub – the stub to send the remote gRPC to the server

  • timeout – the GRPC timeout (seconds)

Returns

an ElkDTO describing the status of the ELK stack

csle_collector.elk_manager.query_elk_manager.start_elastic(stub: csle_collector.elk_manager.elk_manager_pb2_grpc.ElkManagerStub, timeout=60) elk_manager_pb2.ElkDTO[source]

Sends a request to the ELK server to start Elasticsearch

Parameters
  • stub – the stub to send the remote gRPC to the server

  • timeout – the GRPC timeout (seconds)

Returns

an ElkDTO describing the status of the ELK server

csle_collector.elk_manager.query_elk_manager.start_elk(stub: csle_collector.elk_manager.elk_manager_pb2_grpc.ElkManagerStub, timeout=60) elk_manager_pb2.ElkDTO[source]

Sends a request to the ELK server to start the ELK stack

Parameters
  • stub – the stub to send the remote gRPC to the server

  • timeout – the GRPC timeout (seconds)

Returns

an ElkDTO describing the status of the ELK server

csle_collector.elk_manager.query_elk_manager.start_kibana(stub: csle_collector.elk_manager.elk_manager_pb2_grpc.ElkManagerStub, timeout=60) elk_manager_pb2.ElkDTO[source]

Sends a request to the ELK server to start Kibana

Parameters
  • stub – the stub to send the remote gRPC to the server

  • timeout – the GRPC timeout (seconds)

Returns

an ElkDTO describing the status of the ELK server

csle_collector.elk_manager.query_elk_manager.start_logstash(stub: csle_collector.elk_manager.elk_manager_pb2_grpc.ElkManagerStub, timeout=60) elk_manager_pb2.ElkDTO[source]

Sends a request to the ELK server to start Logstash

Parameters
  • stub – the stub to send the remote gRPC to the server

  • timeout – the GRPC timeout (seconds)

Returns

an ElkDTO describing the status of the ELK server

csle_collector.elk_manager.query_elk_manager.stop_elastic(stub: csle_collector.elk_manager.elk_manager_pb2_grpc.ElkManagerStub, timeout=60) elk_manager_pb2.ElkDTO[source]

Sends a request to the ELK server to stop Elabticsearch

Parameters
  • stub – the stub to send the remote gRPC to the server

  • timeout – the GRPC timeout (seconds)

Returns

an ElkDTO describing the status of the ELK stack

csle_collector.elk_manager.query_elk_manager.stop_elk(stub: csle_collector.elk_manager.elk_manager_pb2_grpc.ElkManagerStub, timeout=60) elk_manager_pb2.ElkDTO[source]

Sends a request to the ELK server to stop the whole ELK stack

Parameters
  • stub – the stub to send the remote gRPC to the server

  • timeout – the GRPC timeout (seconds)

Returns

an ElkDTO describing the status of the ELK stack

csle_collector.elk_manager.query_elk_manager.stop_kibana(stub: csle_collector.elk_manager.elk_manager_pb2_grpc.ElkManagerStub, timeout=60) elk_manager_pb2.ElkDTO[source]

Sends a request to the ELK server to stop Kibana

Parameters
  • stub – the stub to send the remote gRPC to the server

  • timeout – the GRPC timeout (seconds)

Returns

an ElkDTO describing the status of the ELK stack

csle_collector.elk_manager.query_elk_manager.stop_logstash(stub: csle_collector.elk_manager.elk_manager_pb2_grpc.ElkManagerStub, timeout=60) elk_manager_pb2.ElkDTO[source]

Sends a request to the ELK server to stop Logstash

Parameters
  • stub – the stub to send the remote gRPC to the server

  • timeout – the GRPC timeout (seconds)

Returns

an ElkDTO describing the status of the ELK stack

Module contents