Example #1
0
class NoteForm(FlaskForm):
    """note edit form"""

    host_id = IntegerField('Host_id', [InputRequired(), host_id_exists])
    service_id = IntegerField(
        'Service_id', [Optional(), service_id_exists_and_belongs_to_host])
    xtype = StringNoneField('xType', [Length(max=250)])
    data = TextAreaNoneField('Data', render_kw={'rows': '10'})
    tags = TextAreaListField('Tags',
                             render_kw={'class': 'form-control tageditor'})
    comment = TextAreaNoneField('Comment')
    submit = SubmitField('Save')
    return_url = HiddenField()
Example #2
0
class AnnotateForm(FlaskForm):
    """generic annotation form; update tags and comments"""

    tags = TextAreaListField('Tags',
                             render_kw={'class': 'form-control tageditor'})
    comment = TextAreaNoneField('Comment')
    submit = SubmitField('Save')
Example #3
0
class ExclImportForm(FlaskForm):
    """exclusions list import form"""

    data = TextAreaNoneField('Data', [InputRequired()],
                             render_kw={'rows': '10'})
    replace = BooleanField('Replace')
    submit = SubmitField('Import')
Example #4
0
class TaskForm(FlaskForm):
    """profile edit form"""

    name = StringNoneField('Name', [InputRequired(), Length(min=1, max=250)])
    module = StringNoneField(
        'Module', [InputRequired(), Length(min=1, max=250)])
    params = TextAreaNoneField('Parameters', render_kw={'rows': '10'})
    submit = SubmitField('Save')
Example #5
0
class VulnForm(FlaskForm):
    """note edit form"""

    host_id = IntegerField('Host_id', [InputRequired(), host_id_exists])
    service_id = IntegerField(
        'Service_id', [Optional(), service_id_exists_and_belongs_to_host])
    name = StringNoneField('Name', [InputRequired(), Length(min=1, max=1000)])
    xtype = StringNoneField('xType', [Length(max=250)])
    severity = SelectField('Severity', [InputRequired()],
                           choices=SeverityEnum.choices(),
                           coerce=SeverityEnum.coerce)
    descr = TextAreaNoneField('Descr', render_kw={'rows': '5'})
    data = TextAreaNoneField('Data', render_kw={'rows': '5'})
    refs = TextAreaListField('Refs', render_kw={'rows': '5'})
    tags = TextAreaListField('Tags',
                             render_kw={'class': 'form-control tageditor'})
    comment = TextAreaNoneField('Comment')
    submit = SubmitField('Save')
    return_url = HiddenField()
Example #6
0
class ExclForm(FlaskForm):
    """exclustion edit form"""

    family = SelectField('Family', [InputRequired(), valid_excl_family],
                         choices=ExclFamily.choices(),
                         coerce=ExclFamily.coerce)
    value = StringNoneField(
        'Value',
        [InputRequired(), Length(min=1), valid_excl_value])
    comment = TextAreaNoneField('Comment')
    submit = SubmitField('Save')
Example #7
0
class HostForm(FlaskForm):
    """host edit form"""

    address = StringNoneField(
        'Address',
        [InputRequired(), IPAddress(ipv4=True, ipv6=True)])
    hostname = StringNoneField('Hostname', [Length(max=256)])
    os = StringNoneField('Os')
    tags = TextAreaListField('Tags',
                             render_kw={'class': 'form-control tageditor'})
    comment = TextAreaNoneField('Comment')
    submit = SubmitField('Save')
    return_url = HiddenField()
Example #8
0
class ServiceForm(FlaskForm):
    """service edit form"""

    host_id = IntegerField('Host_id', [InputRequired(), host_id_exists])
    proto = StringNoneField('Proto', [InputRequired(), Length(min=1, max=250)])
    port = IntegerField(
        'Port',
        [InputRequired(), NumberRange(min=0, max=65535)])
    state = StringNoneField('State', [Length(max=250)])
    name = StringNoneField('Name', [Length(max=250)])
    info = StringNoneField('Info')
    tags = TextAreaListField('Tags',
                             render_kw={'class': 'form-control tageditor'})
    comment = TextAreaNoneField('Comment')
    submit = SubmitField('Save')
    return_url = HiddenField()