Add a vulnerability_found event for notice when we detect a vuln
Fixes #637 Note: This PR does *not* actually raise the event; it merely adds support for it
This commit is contained in:
parent
3677947521
commit
0f3db709ea
19 changed files with 476 additions and 159 deletions
|
|
@ -0,0 +1,41 @@
|
|||
"""Add vulnerability_found event
|
||||
|
||||
Revision ID: 5cdc2d819c5
|
||||
Revises: 50925110da8c
|
||||
Create Date: 2015-10-13 18:05:32.157858
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '5cdc2d819c5'
|
||||
down_revision = '50925110da8c'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
|
||||
def upgrade(tables):
|
||||
op.bulk_insert(tables.externalnotificationevent,
|
||||
[
|
||||
{'id':6, 'name':'vulnerability_found'},
|
||||
])
|
||||
|
||||
op.bulk_insert(tables.notificationkind,
|
||||
[
|
||||
{'id':11, 'name':'vulnerability_found'},
|
||||
])
|
||||
|
||||
|
||||
def downgrade(tables):
|
||||
op.execute(
|
||||
(tables.externalnotificationevent.delete()
|
||||
.where(tables.externalnotificationevent.c.name == op.inline_literal('vulnerability_found')))
|
||||
|
||||
)
|
||||
|
||||
op.execute(
|
||||
(tables.notificationkind.delete()
|
||||
.where(tables.notificationkind.c.name == op.inline_literal('vulnerability_found')))
|
||||
|
||||
)
|
||||
Reference in a new issue