Service API Reference¶
honeycomb.servicemanager.base_service module¶
Custom Service implementation from MazeRunner.
-
class
honeycomb.servicemanager.base_service.
DockerService
(*args, **kwargs)[source]¶ Bases:
honeycomb.servicemanager.base_service.ServerCustomService
Provides an ability to run a Docker container that will be monitored for events.
-
docker_image_name
¶ Return docker image name.
-
docker_params
¶ Return a dictionary of docker run parameters.
See also
Docker run: https://docs.docker.com/engine/reference/run/
Returns: Dictionary, e.g., dict(ports={80: 80})
-
-
class
honeycomb.servicemanager.base_service.
ServerCustomService
(alert_types: list, service_args: dict = {})[source]¶ Bases:
multiprocessing.context.Process
Custom Service Class.
This class provides a basic wrapper for honeycomb (and mazerunner) services.
-
alert_types
= None¶ List of alert types, parsed from config.json
-
alerts_queue
= None¶
-
emit
(**kwargs)[source]¶ Send alerts to logfile.
Parameters: kwargs – Fields to pass to honeycomb.decoymanager.models.Alert
-
logger
= <Logger honeycomb.servicemanager.base_service (DEBUG)>¶ Logger to be used by plugins and collected by main logger.
-
on_server_shutdown
()[source]¶ Shutdown function of the server.
Override this and take care to gracefully shut down your service (e.g., close files)
-
on_server_start
()[source]¶ Service run loop function.
The service manager will call this function in a new thread.
Note
Must call
signal_ready()
after finishing configuration
-
run_service
()[source]¶ Run the service and start an alert processing queue.
See also
Use
on_server_start()
andon_server_shutdown()
for starting and shutting down your service
-
service_args
= None¶ Validated dictionary of service arguments (see:
honeycomb.utils.plugin_utils.parse_plugin_args()
)
-
thread_server
= None¶
-