BOALifeCycle Abstract

This file contains the class from which all lifecycles will have to inherit in order to be executed as a lifecycle. If a lifecycle does not inherit from the implemented class in this file, an error will be raised.

class lifecycles.boalc_abstract.BOALifeCycleAbstract(instance, report, lifecycle_args, execute_method_callback, analysis)

BOALifeCycleAbstract class.

This class implements the necessary methods which will be invoked after by BOALifeCycleManager. Moreover, it defines variables with important information (e.g. “args” variable which contains the given arguments throught the rules file).

__init__(instance, report, lifecycle_args, execute_method_callback, analysis)

It initializes the class.

Parameters
  • instance – initialized instance to be invoked.

  • report (BOAReportAbstract) – report where add found threats.

  • lifecycle_args (dict) – args to be used by the lifecycle.

  • execute_method_callback (func) – function which will be executed in order to execute instance.

  • analysis (str) – information about which analysis we are running.

__weakref__

list of weak references to the object (if defined)

abstract execute_lifecycle()

Method which defines the concrete lifecycle to be executed. This method will have to be implemented by those lifecycles which want to define a new lifecycle.

get_name()

Method which returns the name of the concrete instance.

This method is defined because a security module can only access method by name (it invokes the methods by a method which is given by a callback) and no directly access to the variables.

This method could be invoked by a security modules in order to, for example, give a concrete error message.

Returns

self.who_i_am (i.e. ‘“module_name”.”class_name”’)

Return type

str

abstract raise_exception_if_non_valid_analysis()

Method which will be executed when a lifecycle has been initialized and should raise an exception if the analysis is not valid for the lifecycle.

Raises

BOALCAnalysisException – when the selected analysis is not compatible with the lifecycle.