rddr package¶
Subpackages¶
Submodules¶
rddr.config module¶
-
rddr.config._resolve_hostname(addr)¶ - Parameters
addr (
str) –
-
rddr.config.proxy_schema(direction)¶
-
rddr.config.validate_cfg(config)¶ Uses the cerberus module to validate the user’s configuration. Ensures config is valid, conforms to schema (given by variable
_proxy_schemadefined in rddr.config)- Parameters
config (
dict) – Dictionary of config parsed from the yaml file.
rddr.diff_interface module¶
-
class
rddr.diff_interface.AbstractRddrDiff(do_filter=False, logger=None, params=None)¶ Bases:
abc.ABCDefines the interface for all RDDR diff plugins. Users may extend this class to add support for a particular protocol to RDDR.
- Parameters
do_filter (
bool) – If True, will use the first two traffic streams as a filter pair to filter out non-deterministic noise.logger (
Optional[Logger]) – The logger instance to use for printing messages.params (
Optional[dict]) – Miscellaneous parameters for the diff class. Subclasses should define clearly what they expect to be passed as parameters.
-
diff_traffic(traffic)¶ Diffs the traffic from N instances. Returns True if traffic is consistent. Returns False if traffic diverges. This default implementation always returns True. Subclasses may raise the RddrInsufficientData exception if diff_traffic was called on partial data (i.e. more data is required from the instances to make a decision). The proxy tunnel will handle this exception by reading from the instances once more before calling diff_traffic again.
- Parameters
traffic (
List[bytes]) – List of bytestrings from N instances.- Return type
bool
-
modify_traffic(traffic, n_instances)¶ Return a list of the traffic to send to each of the app variants. This default implementation makes no modifications to the traffic.
- Parameters
traffic (
bytes) – Request to modify per recipient in addrlist.n_instances (
int) – Number of app instances in this deployment
- Return type
List[bytes]
-
render_denial()¶ Return a bytestring to be sent back to the client if divergent behavior is seen. An error message, for example.
- Return type
bytes
rddr.rddr module¶
-
class
rddr.rddr.Rddr(config)¶ Bases:
objectTop level class for Rddr. Encapsulates one incoming proxy and one or more outgoing proxy.
- Parameters
config (
dict) – RDDR configuration dictionary
-
handle_exception(loop, context)¶
-
async
run()¶ Endless loop. Calls run() on all proxies configured in separate threads.