This file is indexed.

/usr/bin/prelude-notify is in prelude-notify 0.9.1-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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/python
#
# Copyright (C) 2008 PreludeIDS Technologies. All Rights Reserved.
# Author: Sebastien Tricaud <toady@inl.fr>
#
# This file is part of the Prelude-Notify program.
#
# This program 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 2, or (at your option)
# any later version.
#
# This program 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 this program; see the file COPYING.  If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.

import PreludeEasy
from PreludeEasy import ClientEasy, ConnectionPool, Connection, IDMEF
import gobject, gtk, pynotify

from PreludeNotify import ManagerConnection, notifyaction, pnstatusicon, pnconfig, threshold, x11idle, heartbeat

import sys


class Env:
        pass

env = Env()
env.gloop = gobject.MainLoop()
env.config = pnconfig.PnConfig(env)
env.notify = notifyaction.PreludeNotify(env)
env.hbmonitor = heartbeat.HeartbeatMonitor(env)
env.is_idle = False

idle = x11idle.X11Idle()
statusicon = pnstatusicon.PreludeStatusIcon(env.gloop, env.config)


def idle_timer_cb():
        idle_timeout = env.config.get("general","x11_idle_timeout")
        if idle_timeout:
                if idle.IdleTimeGet() < int(env.config.get("general","x11_idle_timeout")):
                        env.is_idle = False
                        env.notify.flush()
                        statusicon.SeenAlerts()
                else:
                        env.is_idle = True
                        statusicon.MissedAlerts()

        return True


def _expire_cb(item):
    idmef = item.idmef

    if item.count > 1:
        cstr = "%d x " % item.count
    else:
        cstr = ""

    src = cstr + (idmef.Get("alert.source(0).node.address(0).address") or "(unknown)")
    cl = idmef.Get("alert.classification.text") or "(unknown)"

    desc = idmef.Get("alert.assessment.impact.description")

    if desc:
        desc = "<b>" + cl + "</b>\n" + desc
    else:
        desc = cl

    env.notify.run(idmef.Get("alert.assessment.impact.severity"), item.messageid, src, desc)


env.expire_cb = _expire_cb

env.thresholding = threshold.Threshold(env.config.get("general","threshold_timeout"), env.expire_cb)

filter = env.config.get("idmef", "filter")
if filter != "":
        env.criteria = PreludeEasy.IDMEFCriteria(filter)
else:
        env.criteria = None

env.managercon = ManagerConnection.Session(env, env.config.get("idmef", "profile"))
for addr in env.config.get("manager","addresses").split(","):
        env.managercon.addAddress(addr)

gobject.timeout_add(1000, idle_timer_cb)
env.gloop.run()