tapas.threat_models.base_classes.ThreatModel

class tapas.threat_models.base_classes.ThreatModel

Bases: abc.ABC

Abstract base class for a threat model.

A threat model describes the conditions under which an attack takes place:
  • What the attacker is trying to learn.

  • What the attacker knows about the method.

  • What the attacker knows about the training dataset.

__init__()

Methods

__init__()

load(name)

Load a ThreatModel saved with self.save(name).

save([name])

Save a copy of this ThreatModel, including all internal variables.

test(attack, *args, **kwargs)

This method should implement the logic for testing an attack's success against the prescribed threat model.

classmethod load(name)

Load a ThreatModel saved with self.save(name).

Parameters

name (str) – The prefix of the filename (name.pkl) to which the threat model was saved.

save(name=None)

Save a copy of this ThreatModel, including all internal variables.

Parameters

name (str (default None)) – The prefix of the filename (name.pkl) to which this threat model is saved. If self.name is None, then this attempts to use self._name, which is set exclusively by ThreatModel.load(name).

abstract test(attack, *args, **kwargs)

This method should implement the logic for testing an attack’s success against the prescribed threat model. It takes as argument an Attack object, as well as (potential) additional parameters.