hawat.blueprints.events.forms module

This module contains various IDEA event database search forms for Hawat application.

class hawat.blueprints.events.forms.EventDashboardForm(formdata=<object object>, **kwargs)[source]

Bases: flask_wtf.form.FlaskForm

Class representing event dashboard search form.

dt_from = <UnboundField(SmartDateTimeField, (l'From:',), {'default': <function EventDashboardForm.<lambda>>, 'validators': [<wtforms.validators.Optional object>]})>
dt_to = <UnboundField(SmartDateTimeField, (l'To:',), {'validators': [<wtforms.validators.Optional object>]})>
submit = <UnboundField(SubmitField, (l'Search',), {})>
class hawat.blueprints.events.forms.SimpleEventSearchForm(*args, **kwargs)[source]

Bases: hawat.forms.BaseSearchForm

Class representing simple event search form.

categories = <UnboundField(SelectMultipleField, (l'Categories:',), {'filters': [<function SimpleEventSearchForm.<lambda>>], 'validators': [<wtforms.validators.Optional object>], 'choices': [('__EMPTY__', l'<< without value >>'), ('__ANY__', l'<< any value >>')]})>
classes = <UnboundField(SelectMultipleField, (l'Classes:',), {'filters': [<function SimpleEventSearchForm.<lambda>>], 'validators': [<wtforms.validators.Optional object>], 'choices': [('__EMPTY__', l'<< without value >>'), ('__ANY__', l'<< any value >>')]})>
description = <UnboundField(StringField, (l'Description:',), {'validators': [<wtforms.validators.Optional object>]})>
detector_types = <UnboundField(SelectMultipleField, (l'Detector types:',), {'filters': [<function SimpleEventSearchForm.<lambda>>], 'validators': [<wtforms.validators.Optional object>], 'choices': [('__EMPTY__', l'<< without value >>'), ('__ANY__', l'<< any value >>')]})>
detectors = <UnboundField(SelectMultipleField, (l'Detectors:',), {'description': l'Name of the detector that detected the event.', 'filters': [<function SimpleEventSearchForm.<lambda>>], 'validators': [<wtforms.validators.Optional object>], 'choices': [('__EMPTY__', l'<< without value >>'), ('__ANY__', l'<< any value >>')]})>
dt_from = <UnboundField(SmartDateTimeField, (l'Detection time from:',), {'validators': [<wtforms.validators.Optional object>]})>
dt_to = <UnboundField(SmartDateTimeField, (l'Detection time to:',), {'validators': [<wtforms.validators.Optional object>]})>
groups = <UnboundField(QuerySelectMultipleField, (l'Abuse group:',), {'get_pk': <function SimpleEventSearchForm.<lambda>>, 'allow_blank': False, 'query_factory': <function get_available_groups>})>
host_addrs = <UnboundField(CommaListField, (l'Host addresses:',), {'description': l'Comma separated list of event source or target IP4/6 addresses, ranges or networks. Any additional whitespace is ignored.', 'validators': [<wtforms.validators.Optional object>, <function check_network_record_list>], 'widget': <wtforms.widgets.core.TextArea object>})>
host_ports = <UnboundField(CommaListField, (l'Host ports:',), {'description': l'Comma separated list of event source or target ports as integers. Any additional whitespace is ignored.', 'validators': [<wtforms.validators.Optional object>, <function check_port_list>]})>
host_types = <UnboundField(SelectMultipleField, (l'Host types:',), {'description': l'Specification of event source or target type. Each event source or target may be optionally assigned one or more labels to better categorize type of a source or target.', 'filters': [<function SimpleEventSearchForm.<lambda>>], 'validators': [<wtforms.validators.Optional object>], 'choices': []})>
inspection_errs = <UnboundField(SelectMultipleField, (l'Inspection errors:',), {'filters': [<function SimpleEventSearchForm.<lambda>>], 'validators': [<wtforms.validators.Optional object>], 'choices': [('__EMPTY__', l'<< without value >>'), ('__ANY__', l'<< any value >>')]})>
static is_multivalue(field_name)[source]

Check, if given form field is a multivalue field.

Parameters

field_name (str) – Name of the form field.

Returns

True, if the field can contain multiple values, False otherwise.

Return type

bool

not_categories = <UnboundField(BooleanField, (l'Negate category selection:',), {'validators': [<wtforms.validators.Optional object>]})>
not_classess = <UnboundField(BooleanField, (l'Negate class selection:',), {'validators': [<wtforms.validators.Optional object>]})>
not_detector_types = <UnboundField(BooleanField, (l'Negate detector_type selection:',), {'validators': [<wtforms.validators.Optional object>]})>
not_detectors = <UnboundField(BooleanField, (l'Negate detector selection:',), {'validators': [<wtforms.validators.Optional object>]})>
not_groups = <UnboundField(BooleanField, (l'Negate group selection:',), {'validators': [<wtforms.validators.Optional object>]})>
not_inspection_errs = <UnboundField(BooleanField, (l'Negate inspection error selection:',), {'validators': [<wtforms.validators.Optional object>]})>
not_protocols = <UnboundField(BooleanField, (l'Negate protocol selection:',), {'validators': [<wtforms.validators.Optional object>]})>
not_severities = <UnboundField(BooleanField, (l'Negate severity selection:',), {'validators': [<wtforms.validators.Optional object>]})>
protocols = <UnboundField(SelectMultipleField, (l'Protocols:',), {'filters': [<function SimpleEventSearchForm.<lambda>>], 'validators': [<wtforms.validators.Optional object>], 'choices': [('__EMPTY__', l'<< without value >>'), ('__ANY__', l'<< any value >>')]})>
severities = <UnboundField(SelectMultipleField, (l'Severities:',), {'filters': [<function SimpleEventSearchForm.<lambda>>], 'validators': [<wtforms.validators.Optional object>], 'choices': [('__EMPTY__', l'<< without value >>'), ('__ANY__', l'<< any value >>')]})>
sortby = <UnboundField(SelectField, (l'Sort by:',), {'default': 'time.desc', 'validators': [<wtforms.validators.Optional object>], 'choices': [('time.desc', l'by time descending'), ('time.asc', l'by time ascending'), ('detecttime.desc', l'by detection time descending'), ('detecttime.asc', l'by detection time ascending'), ('storagetime.desc', l'by storage time descending'), ('storagetime.asc', l'by storage time ascending')]})>
source_addrs = <UnboundField(CommaListField, (l'Source addresses:',), {'description': l'Comma separated list of event source IP4/6 addresses, ranges or networks. In this context a source does not necessarily mean a source of the connection, but rather a source of the problem as reported by a detector. Any additional whitespace is ignored.', 'validators': [<wtforms.validators.Optional object>, <function check_network_record_list>], 'widget': <wtforms.widgets.core.TextArea object>})>
source_ports = <UnboundField(CommaListField, (l'Source ports:',), {'description': l'Comma separated list of event source ports as integers. In this context a source does not necessarily mean a source of the connection, but rather a source of the problem as reported by a detector. Any additional whitespace is ignored.', 'validators': [<wtforms.validators.Optional object>, <function check_port_list>]})>
source_types = <UnboundField(SelectMultipleField, (l'Source types:',), {'description': l'Specification of event source type. Each event source may be optionally assigned one or more labels to better categorize type of a source.', 'filters': [<function SimpleEventSearchForm.<lambda>>], 'validators': [<wtforms.validators.Optional object>], 'choices': []})>
st_from = <UnboundField(SmartDateTimeField, (l'Storage time from:',), {'validators': [<wtforms.validators.Optional object>]})>
st_to = <UnboundField(SmartDateTimeField, (l'Storage time to:',), {'validators': [<wtforms.validators.Optional object>]})>
target_addrs = <UnboundField(CommaListField, (l'Target addresses:',), {'description': l'Comma separated list of event target IP4/6 addresses, ranges or networks. In this context a target does not necessarily mean a target of the connection, but rather a victim of the problem as reported by a detector. Any additional whitespace is ignored.', 'validators': [<wtforms.validators.Optional object>, <function check_network_record_list>], 'widget': <wtforms.widgets.core.TextArea object>})>
target_ports = <UnboundField(CommaListField, (l'Target ports:',), {'description': l'Comma separated list of event target ports as integers. In this context a target does not necessarily mean a target of the connection, but rather a victim of the problem as reported by a detector. Any additional whitespace is ignored.', 'validators': [<wtforms.validators.Optional object>, <function check_port_list>]})>
target_types = <UnboundField(SelectMultipleField, (l'Target types:',), {'description': l'Specification of event target type. Each event target may be optionally assigned one or more labels to better categorize type of a target.', 'filters': [<function SimpleEventSearchForm.<lambda>>], 'validators': [<wtforms.validators.Optional object>], 'choices': []})>
hawat.blueprints.events.forms.get_available_groups()[source]

Query the database for list of all available groups.