-
Notifications
You must be signed in to change notification settings - Fork 64
/
Makefile
122 lines (105 loc) · 3.17 KB
/
Makefile
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
all:
@echo
@echo No make target for all\/default.
@echo Try \'make help\'
@echo
default: all
install:
@echo
@echo No make target for install.
@echo Try \'make help\'
@echo
help:
@echo
@echo --- View daemon help display
@echo ------------------------------
@echo make daemon-help
@echo
@echo --- New instance setup
@echo ------------------------
@echo -- Set up new DB with fixtures
@echo make newdb
@echo -- Set up new DB without fixtures
@echo make newdb-setup
@echo -- Collect static files
@echo make staticfiles
@echo
@echo --- View help on individual fixtures
@echo --------------------------------------
@echo make fixture-help
@echo
@echo --- Update LogESP
@echo -------------------
@echo make update
@echo
fixture-help:
@echo
@echo --- Fixtures
@echo --------------
@echo - Note- \'make new-db\' installs fixtures automatically.
@echo - Avoid installing them twice.
@echo
@echo -- Install all fixtures
@echo make fixtures
@echo -- Install only risk management fixtures
@echo make risk-fixtures
@echo -- Install only asset type fixtures
@echo make asset-fixtures
@echo -- Install only siem parse fixtures
@echo make parser-fixtures
@echo -- Install only example siem rules
@echo make example-rules
@echo
daemon-help:
@echo
@echo --- Daemon help
@echo -----------------
@echo -- Use scripts/logesp to start parser and sentry daemons
@echo scripts/logesp -h
@echo
@echo Make sure to edit config/parser.conf
@echo Restart daemons with scripts/logesp restart to re-read config
@echo
update: update-deps update-logesp
update-deps:
@echo Updating environment...
pip install -Ur requirements.txt
update-logesp:
@echo Pulling changes from GitHub...
git pull
@echo Updating database
python manage.py migrate
@echo Restarting logesp daemon...
systemctl restart logespd
@echo Restarting UWSGI...
systemctl restart logesp-uwsgi
@echo Have a nice day!
newdb: newdb-setup fixtures
newdb-setup:
@echo --- Loading initial migrations...
python manage.py migrate
@echo --- Creating superuser...
python manage.py createsuperuser
staticfiles:
@echo --- Collecting static files...
python manage.py collectstatic
mkdir -p media
risk-fixtures:
@echo --- Loading NIST threat data fixtures...
python manage.py loaddata risk/fixtures/nist_threat_event_types.json risk/fixtures/nist_threat_src_types.json
python manage.py loaddata risk/fixtures/generic_nist_threat_events.json risk/fixtures/generic_nist_threat_sources.json
@echo --- Loading risk response type fixtures...
python manage.py loaddata risk/fixtures/risk_response_types.json
asset-fixtures:
@echo --- Loading basic asset type fixtures...
python manage.py loaddata hwam/fixtures/hardware_asset_types.json hwam/fixtures/software_asset_types.json
parser-fixtures:
@echo --- Loading standard syslog parser fixtures...
python manage.py loaddata siem/fixtures/example_parsers.json
@echo --- Loading parse helpers...
python manage.py loaddata siem/fixtures/example_parse_helpers.json
example-rules:
@echo --- Loading example rule fixtures...
python manage.py loaddata siem/fixtures/example_limit_rules.json
fixtures: risk-fixtures asset-fixtures parser-fixtures example-rules
@echo --- Have a nice day!