otupy.actuators.ctxd.ctxd_actuator_docker.CTXDActuator_docker

class CTXDActuator_docker(domain, asset_id, hostname, ip, port, protocol, endpoint, transfer, encoding, actuators)

Bases: CTXDActuator

CTXD implementation

This class provides an implementation of the CTXD Actuator.

Methods

connect_to_docker

get_connected_actuators

get_consumer

Returns consumer data

get_container_links

get_container_service

get_links

get_name_links

get_network_service

get_services

Returns the list of current services

get_services_hosting_vm

query

Query action

run

Entry point for running commands

Attributes

actuators

asset_id

conn

domain

encoding

endpoint

hostname

ip

links

It identifies the type of the service

my_links

It identifies the type of the service

my_services

Name of the service

port

protocol

services

Name of the service

transfer

__init__(domain, asset_id, hostname, ip, port, protocol, endpoint, transfer, encoding, actuators)

Initialization

Common parameters expected for all actuators:

  • auth: Authentication information to connect to external APIs for discovering services and links

  • config: Additional configuration parameters specific for each actuator (ofter related to endpoints or parameters of the external APIs)

  • peers: A list of Consumers that host the definition of external services (usually found as peers in links). They are currently provided

    at initialization time, waiting for some more automated discovery mechanism.

  • owner: The owner of the resource (in case of cloud resources, effective owners should be discovered by the actuator)

  • specifiers: This is the description of the actuator (e.g., its identifiers).

get_consumer(service_name: Name) Consumer

Returns consumer data

Returns the Consumer data for the selected service name.

Parameters:

service_name – name of the service which consumer is searched.

Returns:

The consumer serving the given service, if any, None otherwise.

get_services()

Returns the list of current services

Returns the list of discovered services. Filter by name and type.

Parameters:
  • name – The name of the service to retrieve (all if not set).

  • filter – The type of service (given by a void instance of ServiceType).

Returns:

A list of services that match the searching criteria.

It identifies the type of the service

It identifies the type of the service

my_services: ArrayOf = None

Name of the service

query(cmd)

Query action

This method implements the query action.

Parameters:

cmd – The Command including Target and optional Args.

Returns:

A Response including the result of the query and appropriate status code and messages.

run(cmd)

Entry point for running commands

This is the actuator entry point to receive OpenC2 commands from the otupy Consumer.

Parameters:

cmd – A Command in the format of the otupy framework.

Returns:

Response to the provided command.

services: ArrayOf = None

Name of the service