Event Listeners: package fuzzinator.listener
¶
- class fuzzinator.listener.EmailListener(config, event, param_name, from_address, to_address, smtp_host, smtp_port, smtp_timeout=5)¶
EventListener subclass that can be used to send e-mail notification about various events.
- Parameters:
config – ConfigParser object containing information about the fuzz session.
event – The name of the event to send notification about.
param_name – The name of the event’s parameter containing the information to send.
from_address – E-mail address to send notifications from.
to_address – Target e-mail address to send the notification to.
smtp_host – Host of the smtp server to send e-mails from.
smtp_port – Port of the smtp server to send e-mails from.
smtp_timeout – Timeout in seconds for blocking SMTP operations like the connection attempt. (Optional, default: 5)
- send_mail(data)¶
Send e-mail with the provided data.
- Parameters:
data – Information to fill subject and content fields with.
- class fuzzinator.listener.EventListener(config)¶
A no-op base class for listeners that can get notified by
fuzzinator.Controller
on various events of a fuzz sessions.Note
Subclasses should be aware that some notification methods may be called from subprocesses.
- Parameters:
config (configparser.ConfigParser) – Fuzzinator settings.
- on_fuzz_job_added(job_id, cost, sut, fuzzer, batch)¶
Invoked when a new (still inactive) fuzz job is instantiated.
- Parameters:
job_id (int) – a unique identifier of the new fuzz job.
cost (int) – cost associated with the new fuzz job.
sut (str) – short name of the SUT of the new fuzz job (name of the corresponding config section without the “sut.” prefix).
fuzzer (str) – short name of the new fuzz job (name of the corresponding config section without the “fuzz.” prefix).
batch (int, float) – batch size of the new fuzz job, i.e., number of test cases requested from the fuzzer (may be
inf
).
- on_issue_added(job_id, issue)¶
Invoked when a new issue is found.
- Parameters:
job_id (int) – identifier of the job that has found the issue.
issue (dict) – the issue that was found (all relevant information - e.g., the SUT that reported the issue, the test case that triggered the issue, the fuzzer that generated the test case, the ID of the issue - is stored in appropriate properties of the issue).
- on_issue_invalidated(job_id, issue)¶
Invoked when an issue seems invalid.
- on_issue_reduced(job_id, issue)¶
Invoked when an issue got reduced.
- on_issue_updated(job_id, issue)¶
Invoked when the status of an issue changed.
- on_job_activated(job_id)¶
Invoked when a previously instantiated job is activated (started).
- Parameters:
job_id (int) – unique identifier of the activated job.
- on_job_progressed(job_id, progress)¶
Invoked when an activated job makes progress.
- Parameters:
- on_job_removed(job_id)¶
Invoked when an active job has finished.
- Parameters:
job_id (int) – unique identifier of the finished job.
- on_load_updated(load)¶
Invoked when the framework’s load changes.
- Parameters:
load (int) – number between 0 and controller’s capacity.
- on_reduce_job_added(job_id, cost, sut, issue_oid, issue_id, size)¶
Invoked when a new (still inactive) reduce job is instantiated.
- Parameters:
job_id (int) – a unique identifier of the new reduce job.
cost (int) – cost associated with the new reduce job.
sut (str) – short name of the SUT used in the new reduce job (name of the corresponding config section without the “sut.” prefix).
issue_oid (str) –
'_id'
property of the issue to be reduced.issue_id (Any) –
'id'
property of the issue to be reduced.size (int) – size of the test case associated with the issue to be reduced.
- on_stats_updated()¶
Invoked when statistics about fuzzers, SUTs, and issues (e.g., execution counts, issue counts, unique issue counts) are updated in the framework’s database.
- on_update_job_added(job_id, cost, sut)¶
Invoked when a new (still inactive) update job is instantiated.
- on_validate_job_added(job_id, cost, sut, issue_oid, issue_id)¶
Invoked when a new (still inactive) validate job is instantiated.
- Parameters:
job_id (int) – a unique identifier of the new validate job.
cost (int) – cost associated with the new validate job.
sut (str) – short name of the SUT used in the new validate job (name of the corresponding config section without the “sut.” prefix).
issue_oid (str) –
'_id'
property of the issue to be validated.issue_id (Any) –
'id'
property of the issue to be validated.
- class fuzzinator.listener.ListenerManager(listeners=None)¶
Class that registers listeners to various events and executes all of them when the event has triggered.
- Parameters:
listeners – List of listener objects.
- add(listener)¶
Register a new listener in the manager.
- Parameters:
listener – The new listener to register.