This file is indexed.

/usr/share/yasat/plugins/syslogng.test is in yasat 755-1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

 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
#!/bin/sh
################################################################################
#                                                                              #
#   Copyright (C) 2008-2014 LABBE Corentin <clabbe.montjoie@gmail.com>
#
#    YASAT is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    YASAT is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with YASAT.  If not, see <http://www.gnu.org/licenses/>.
#                                                                              #
################################################################################


POSSIBLE_SYSLOGNG_CONF="/etc/syslog-ng/syslog-ng.conf /usr/local/etc/syslog-ng/syslog-ng.conf"
SYSLOGNG_CONF=""

for LOCATION in ${POSSIBLE_SYSLOGNG_CONF}
do
	if [ -e "${LOCATION}" ]
	then
		SYSLOGNG_CONF="${LOCATION}"
	fi
done

Title "Check syslog-ng"

if [ -z "$SYSLOGNG_CONF" ]
then
	return 1;
fi

if [ ! -e "$SYSLOGNG_CONF" ]
then
	return 1;
fi

Display --indent 2 --text "$SYSLOGNG_CONF" --result FOUND --color GREEN

SYSLOGNGCONFRIGHT="`stat $STAT_RIGHT $SYSLOGNG_CONF`"
if [ "$SYSLOGNGCONFRIGHT=" != '640' -a "$SYSLOGNGCONFRIGHT" != '600' ]
then
	Display --indent 2 --text "Rights of $SYSLOGNG_CONF" --result WARNING --color RED --advice GLOBAL_FILE_CHMOD640
else
	Display --indent 2 --text "Rights of $SYSLOGNG_CONF" --result OK --color GREEN
fi

if [ "`stat $STAT_USER $SYSLOGNG_CONF`" != 'root' ]
then
	Display --indent 2 --text "owner of $SYSLOGNG_CONF" --result WARNING --color RED --advice GLOBAL_FILE_MUST_BE_OWNED_BT_ROOT
else
	Display --indent 2 --text "owner of $SYSLOGNG_CONF" --result OK --color GREEN
fi

if [ "`stat $STAT_GROUP $SYSLOGNG_CONF`" != "$ROOTGROUP" ]
then
	Display --indent 2 --text "group of $SYSLOGNG_CONF" --result WARNING --color RED --advice GLOBAL_FILE_MUST_BE_GROUPED_BT_ROOT
else
	Display --indent 2 --text "group of $SYSLOGNG_CONF" --result OK --color GREEN
fi

#TODO check use_dns
#if [ `grep -v '^#*' $SYSLOGNG_CONF | grep 'use_dns'` ]
#then
#	echo "toto"
#fi

#TODO for logging local1-6

#TODO loghost tcp or udp better ?

return 0;