aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ossec-hids/01_makefile.patch
blob: c0536f29d38c5badf4412aa7333d0f9039a5181d (plain)
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
Index: ossec-hids-2.8.2/Makefile
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ ossec-hids-2.8.2/Makefile	2015-08-10 04:36:27.819134760 +0000
@@ -0,0 +1,71 @@
+#
+# Santiago Bassett <santiago.bassett@gmail.com>
+# 06/15/2015
+#
+
+DESTDIR?=/
+DIR=$(DESTDIR)/var/ossec
+OSSEC_INIT=$(DIR)/etc/ossec-init.conf
+
+all:
+	echo "HEXTRA=-DMAX_AGENTS=16384" >> src/Config.OS
+	(cd src; make all; make build)
+
+clean:
+	rm bin/* || /bin/true
+	mkdir -p $(DIR)/rules/translated/
+	chmod 750 $(DIR) || /bin/true
+	chmod 750 $(DIR)/* || /bin/true
+	chmod 750 $(DIR)/rules/translated/ || /bin/true
+	chmod 750 $(DIR)/rules/translated/* || /bin/true
+	(cd src; make clean)
+	rm -f src/Config.OS
+	rm -f src/analysisd/compiled_rules/compiled_rules.h
+	rm -f src/isbigendian.c
+	rm -f src/analysisd/ossec-makelists
+	rm -f src/analysisd/ossec-logtest
+	rm -f src/isbigendian
+
+install:
+	mkdir -p $(DIR)
+	(cd $(DIR); mkdir -p logs logs/archives logs/alerts logs/firewall bin stats rules queue queue/alerts queue/ossec queue/fts queue/syscheck queue/rootcheck queue/diff queue/agent-info queue/agentless queue/rids tmp var var/run etc etc/init.d etc/shared active-response active-response/bin agentless .ssh contrib)
+	cp -pr etc/rules/* $(DIR)/rules/
+	chmod -x $(DIR)/rules/*.xml
+	chmod -x $(DIR)/rules/log-entries/*
+	chmod -x $(DIR)/rules/translated/pure_ftpd/*.xml
+	cp -pL /etc/localtime $(DIR)/etc/ 2>/dev/null || /bin/true
+	cp -p /etc/TIMEZONE $(DIR)/etc/   2>/dev/null || /bin/true
+	cp -p contrib/compile_alerts.pl $(DIR)/contrib/
+	cp -p contrib/compile_alerts.txt $(DIR)/contrib/
+	cp -p contrib/config2xml $(DIR)/contrib/
+	cp -p contrib/ossec-batch-manager.pl $(DIR)/contrib/
+	cp -p contrib/ossec-eps.sh $(DIR)/contrib/
+	cp -pr bin/ossec* $(DIR)/bin/
+	cp -pr bin/manage_agents $(DIR)/bin/
+	cp -pr bin/syscheck_update $(DIR)/bin/
+	cp -pr bin/verify-agent-conf $(DIR)/bin/
+	cp -pr bin/clear_stats $(DIR)/bin/
+	cp -pr bin/list_agents $(DIR)/bin/
+	cp -pr bin/agent_control $(DIR)/bin/
+	cp -pr bin/syscheck_control $(DIR)/bin/
+	cp -pr bin/rootcheck_control $(DIR)/bin/
+	cp -pr contrib/util.sh $(DIR)/bin/
+	cp -pr src/init/ossec-server.sh $(DIR)/bin/ossec-control
+	cp -pr etc/decoder.xml $(DIR)/etc/
+	chmod -x $(DIR)/etc/decoder.xml
+	cp -pr etc/local_decoder.xml $(DIR)/etc/ > /dev/null 2>&1 || /bin/true
+	cp -pr etc/local_internal_options.conf $(DIR)/etc/ > /dev/null 2>&1 || /bin/true
+	cp -pr etc/client.keys $(DIR)/etc/ > /dev/null 2>&1 ||/bin/true
+	cp -pr src/agentlessd/scripts/* $(DIR)/agentless/
+	cp -pr etc/internal_options.conf $(DIR)/etc/
+	chmod -x $(DIR)/etc/internal_options.conf
+	cp -pr etc/ossec-server.conf $(DIR)/etc/ossec.conf
+	chmod -x $(DIR)/etc/ossec.conf
+	cp -pr src/rootcheck/db/*.txt $(DIR)/etc/shared/
+	chmod -x $(DIR)/etc/shared/*.txt
+	cp -p active-response/*.sh $(DIR)/active-response/bin/
+	cp -p active-response/firewalls/*.sh $(DIR)/active-response/bin/
+	echo "DIRECTORY=\"/var/ossec\"" > $(OSSEC_INIT)
+	echo "VERSION=\"$(cat src/VERSION)" >> $(OSSEC_INIT)
+	echo "DATE=\"`date`\"" >> $(OSSEC_INIT)
+	echo "TYPE=\"server\"" >> $(OSSEC_INIT)