hawat.blueprints.filters.forms module

This module contains custom reporting filter management forms for Hawat.

class hawat.blueprints.filters.forms.AdminFilterForm(*args, **kwargs)[source]

Bases: hawat.blueprints.filters.forms.BaseFilterForm

Class representing reporting filter create form.

group = <UnboundField(QuerySelectField, (l'Group:',), {'allow_blank': False, 'query_factory': <function get_available_groups>})>
class hawat.blueprints.filters.forms.BaseFilterForm(*args, **kwargs)[source]

Bases: hawat.forms.BaseItemForm

Class representing base reporting filter form.

cancel = <UnboundField(SubmitField, (l'Cancel',), {})>
categories = <UnboundField(SelectMultipleField, (l'Categories:',), {'filters': [<function BaseFilterForm.<lambda>>], 'validators': [<wtforms.validators.Optional object>], 'choices': [('', l'<< no preference >>')]})>
description = <UnboundField(TextAreaField, (l'Description:',), {'validators': [<wtforms.validators.DataRequired object>]})>
detectors = <UnboundField(SelectMultipleField, (l'Detectors:',), {'filters': [<function BaseFilterForm.<lambda>>], 'validators': [<wtforms.validators.Optional object>], 'choices': [('', l'<< no preference >>')]})>
enabled = <UnboundField(RadioField, (l'State:',), {'coerce': <function str_to_bool>, 'validators': [<wtforms.validators.InputRequired object>], 'choices': [(True, l'Enabled'), (False, l'Disabled')], 'filters': [<function str_to_bool>]})>
filter = <UnboundField(TextAreaField, (l'Filter:',), {'validators': [<wtforms.validators.Optional object>, <function check_filter>]})>
ips = <UnboundField(CommaListField, (l'Source IPs:',), {'validators': [<wtforms.validators.Optional object>, <function check_network_record_list>], 'widget': <wtforms.widgets.core.TextArea object>})>
name = <UnboundField(StringField, (l'Name:',), {'validators': [<wtforms.validators.DataRequired object>, <wtforms.validators.Length object>]})>
preview = <UnboundField(SubmitField, (l'Preview',), {})>
submit = <UnboundField(SubmitField, (l'Submit',), {})>
type = <UnboundField(SelectField, (l'Type:',), {'validators': [<wtforms.validators.DataRequired object>], 'choices': [('basic', l'Basic'), ('advanced', l'Advanced')]})>
valid_from = <UnboundField(SmartDateTimeField, (l'Valid from:',), {'validators': [<wtforms.validators.Optional object>]})>
valid_to = <UnboundField(SmartDateTimeField, (l'Valid to:',), {'validators': [<wtforms.validators.Optional object>]})>
class hawat.blueprints.filters.forms.PlaygroundFilterForm(formdata=<object object>, **kwargs)[source]

Bases: flask_wtf.form.FlaskForm

Class representing IP geolocation search form.

event = <UnboundField(TextAreaField, (l'IDEA event:',), {'validators': [<wtforms.validators.DataRequired object>, <function check_event>]})>
filter = <UnboundField(TextAreaField, (l'Filtering rule:',), {'validators': [<wtforms.validators.DataRequired object>, <function check_filter>]})>
submit = <UnboundField(SubmitField, (l'Check',), {})>
hawat.blueprints.filters.forms.check_event(form, field)[source]

Callback for validating IDEA event JSON.

hawat.blueprints.filters.forms.check_filter(form, field)[source]

Callback for validating Pynspect filter.

hawat.blueprints.filters.forms.get_available_groups()[source]

Query the database for list of all available groups.