honeycomb.servicemanager package

Submodules

honeycomb.servicemanager.base_service module

Custom Service implementation from MazeRunner.

class honeycomb.servicemanager.base_service.ServerCustomService(alert_types, service_args={})[source]

Bases: multiprocessing.context.Process

Custom Service Class.

This class provides a basic wrapper for honeycomb and mazerunner services.

Parameters:service_args – Validated dictionary of service arguments (see: honeycomb.Honeycomb.parse_service_args())
add_alert_to_queue(alert_dict)[source]

Log alert and send to integrations.

emit(**kwargs)[source]

Send alerts to logfile.

Parameters:kwargs – Fields to pass to honeycomb.decoymanager.models.Alert
logger = <logging.Logger object>
on_server_shutdown()[source]

Shutdown function of the server.

Override this and take care of gracefully shutting down you 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()[source]

Daemon entry point.

run_service()[source]

Run the service and start an alert processing queue.

See also

Use on_server_start() and on_server_shutdown() for starting and shutting down your service

signal_ready()[source]

Signal the service manager this service is ready for incoming connections.

honeycomb.servicemanager.defs module

Hooneycomb services definitions and constants.

honeycomb.servicemanager.defs.ALLOWED_PROTOCOLS = ['TCP', 'UDP']

Parameters.

honeycomb.servicemanager.defs.STDERRLOG = 'stderr.log'

Service section.

honeycomb.servicemanager.error_messages module

Hooneycomb services error messages.

honeycomb.servicemanager.exceptions module

Honeycomb Service Manager Exceptions.

exception honeycomb.servicemanager.exceptions.ServiceManagerException(*args, **kwargs)[source]

Bases: honeycomb.exceptions.PluginError

Generic Seriver Manager Exception.

exception honeycomb.servicemanager.exceptions.ServiceNotFound(*args, **kwargs)[source]

Bases: honeycomb.servicemanager.exceptions.ServiceManagerException

Specified service does not exist.

msg_format = 'Cannot find service named {}, try installing it?'
exception honeycomb.servicemanager.exceptions.UnsupportedOS(*args, **kwargs)[source]

Bases: honeycomb.servicemanager.exceptions.ServiceManagerException

Specified service does not exist.

msg_format = 'Service requires running on {} and you are using {}'

honeycomb.servicemanager.models module

Hooneycomb service models.

class honeycomb.servicemanager.models.OSFamilies[source]

Bases: honeycomb.defs.IBaseType

Defines supported platforms for services.

ALL = BaseNameLabel(name='All', label='All')
LINUX = BaseNameLabel(name='Linux', label='Linux')
MACOS = BaseNameLabel(name='Darwin', label='Darwin')
WINDOWS = BaseNameLabel(name='Windows', label='Windows')
class honeycomb.servicemanager.models.ServiceType(name, ports, label, allow_many, supported_os_families, alert_types=[])[source]

Bases: object

Holds loaded service metadata.

honeycomb.servicemanager.registration module

Honeycomb serivce manager.

honeycomb.servicemanager.registration.get_service_module(service_path)[source]

Add custom paths to sys and import service module.

Parameters:service_path – Path to service folder
honeycomb.servicemanager.registration.register_service(package_folder)[source]

Register a honeycomb service.

Parameters:package_folder – Path to folder with service to load
Returns:Validated service object
Return type:honeycomb.utils.defs.ServiceType()

Module contents

Honeycomb Service Manager.