forked from dropbox/securitybot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcustom_alert.py
More file actions
28 lines (22 loc) · 976 Bytes
/
Copy pathcustom_alert.py
File metadata and controls
28 lines (22 loc) · 976 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/python
'''
Creates a custom Securitybot alert for a specified user.
'''
import argparse
from securitybot.sql import SQLEngine
from securitybot.util import create_new_alert
from typing import Any
def main(args):
# type: (Any) -> None
SQLEngine('localhost', 'root', '', 'securitybot')
create_new_alert('custom_alert', args.name[0], args.title[0], args.reason[0])
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Send a custom Securitybot alert')
parser.add_argument('-n', '--name', dest='name', nargs=1, required=True,
help='Username to send alert to')
parser.add_argument('-t', '--title', dest='title', nargs=1, required=True,
help='User-visible alert title')
parser.add_argument('-r', '--reason', dest='reason', nargs=1,
help='Long-form reason for the alert to provided context to user.')
args = parser.parse_args()
main(args)