Watcher - Master manual - Rev. 1.4 Watcher A real-time intrusion detection system and ‘superordinate firewall management’ solution for Linux server systems. ... keep network bandits away … Watcher Master 1.4 Page 1 of 52 Watcher - Master manual - Rev. 1.4 Watcher - Master manual Revision 1.4 Watcher Master 1.4 Page 2 of 52 Watcher - Master manual - Rev. 1.4 Philosophies Kiss … Keep it small & simple. Easy is beautiful. Do one thing and do it well. “Everything should be made as simple as possible – but not simpler” (Albert Einstein) “Every work of art has one indispensable mark … the center of it is simple, however much the fulfillment may be complicated.” (Gilbert K. Chesterton) Watcher Master 1.4 Page 3 of 52 Watcher - Master manual - Rev. 1.4 Contents Scope of this document........................................................................................................................ 6 »Preface................................................................................................................................................ 7 1 Preface............................................................................................................................................... 7 1.1 Why Watcher?............................................................................................................................8 1.2 What’s the audience for Watcher?...........................................................................................10 1.3 What does Watcher need?........................................................................................................ 10 1.3.1 Firewall............................................................................................................................10 1.3.2 System logger...................................................................................................................11 1.4 What does Watcher do?............................................................................................................11 1.5 How does Watcher do this?......................................................................................................12 1.6 How is Watcher constructed?...................................................................................................12 1.7 What’s new in this revision?.................................................................................................... 13 1.7.1 Geo-Blocking & Geo-Tracking........................................................................................13 1.7.1.1 Geo-Blocking........................................................................................................... 13 1.7.1.2 Geo-Tracking............................................................................................................14 »Part 1 – Overview and concepts.......................................................................................................15 2 Overview.........................................................................................................................................15 2.1 Overall architecture..................................................................................................................15 2.2 Watcher master.........................................................................................................................16 2.3 Watcher modules......................................................................................................................17 2.4 Dynloaders............................................................................................................................... 17 »Part 2 - Watcher Installation.............................................................................................................18 3 Installing Watcher............................................................................................................................18 3.1 Pre-installation considerations.................................................................................................18 3.1.1 Turning off SELINUX..................................................................................................... 18 3.1.2 Switching to syslog-ng.....................................................................................................18 3.2 Install path & unpacking..........................................................................................................18 3.3 Preparation............................................................................................................................... 19 3.3.1 Needed programs............................................................................................................. 20 3.3.2 Toolpath............................................................................................................................20 »Part 3 – Watcher operation............................................................................................................... 21 4 Operation tasks................................................................................................................................ 21 4.1 Watcher master operation........................................................................................................ 21 4.1.1 Starting and stopping the watcher service........................................................................21 4.1.2 Maintaining static lists (blacklist, whitelist)....................................................................22 5 Common framework features.......................................................................................................... 24 5.1 Logging & Tracing...................................................................................................................24 5.2 Debugging aid..........................................................................................................................25 5.3 Runtime IPsets......................................................................................................................... 26 5.3.1 The ‘tarpit’ set..................................................................................................................27 5.3.2 The ‘custody’ set..............................................................................................................28 5.3.3 The ‘validate’ (pseudo-)set...............................................................................................28 6 Appendix A - Additional information.............................................................................................. 30 6.1 Watcher directory structure......................................................................................................30 6.2 Watcher Toolbox...................................................................................................................... 30 6.2.1 Informational commands................................................................................................. 31 Watcher Master 1.4 Page 4 of 52 Watcher - Master manual - Rev. 1.4 6.2.1.1 Trace......................................................................................................................... 31 6.2.1.2 Watcher-Report.........................................................................................................31 6.2.2 Firewall commands.......................................................................................................... 33 6.2.2.1 Blacklist....................................................................................................................33 6.2.2.2 Whitelist................................................................................................................... 33 6.2.3 Measuring commands......................................................................................................34 6.2.3.1 Attackrate (experimental)......................................................................................... 34 6.2.3.2 Procrate.....................................................................................................................34 6.2.4 Navigation commands......................................................................................................34 6.2.4.1 Masterpath................................................................................................................ 34 6.2.4.2 Module......................................................................................................................35 6.2.4.3 Dynload.................................................................................................................... 35 6.2.4.4 Rules.........................................................................................................................35 6.2.5 Other commands..............................................................................................................36 6.2.5.1 Check........................................................................................................................36 6.2.5.2 Freeme...................................................................................................................... 37 6.2.5.3 MyFritzbox...............................................................................................................37 6.2.5.4 MyRouter..................................................................................................................38 6.2.5.5 Refresh......................................................................................................................38 6.2.5.6 Restart.......................................................................................................................39 6.2.5.7 Untreated..................................................................................................................40 6.2.6 Goodies............................................................................................................................40 6.2.6.1 hook-watcher............................................................................................................ 40 6.3 Dynloaders............................................................................................................................... 42 6.3.1 Repeated dynloader calls.................................................................................................43 6.4 Rolling your own custom dynloader........................................................................................45 7 Appendix B – Other systems........................................................................................................... 49 7.1 Debian......................................................................................................................................50 7.2 Ubuntu (Server edition)...........................................................................................................50 7.3 SuSE.........................................................................................................................................51 Watcher Master 1.4 Page 5 of 52 Watcher - Master manual - Rev. 1.4 Scope of this document This document explains the Watcher framework which provides the basis for everything that is running in the Watcher framework. For the service related modules there is a separate document ‘Watcher modules’, that explains the modules in detail; i.e. their construction, maintenance & operation, etc. In this document only the way how modules are integrated into the framework is outlined in a terse manner. Watcher is chiefly designed for so-called ‘root servers’ that are running million-wise as ‘exposed hosts’ as rented computer systems in data centers to provide ‘internet presence’ for freelancers, small companies and private persons. Dynamic loaders are are treated as part of the framework and are discussed in the section ‘Dynloader’. Watcher Master 1.4 Page 6 of 52 Watcher - Master manual - Rev. 1.4 » PREFACE 1 Preface • Why wait that a burglar or an attacker of a computer system can disturb your running services or overload it with pointless or even knowingly malicious requests? • Moreover, why have the services to be in charge of defending themselves from burglars and attackers? Having bandits rejected right at the entry before they can mess with the services on the computer system is the far better solution, since it preserves the performance of your services. The good thing with computer networks is, that they are organized by transferring ‚packets‘ with determined structure and the specific services have ‚port numbers’ by which they are identified. A usual ‚packet‘ transferred by IP (‚Internet Protocol‘) for IP V4 looks about like this … IP header Source IP addr Target IP addr. Protocol bits ... other transport 177.15.238.16 98.73.115.4 tcp, udp, ... information … TCP/UDP protocol header Source port Service (dest.) port Sequence number ... other transport xxxxx 25 nnnnnnn information … Data block The information in the header of the packet is what the ‚routing‘ deals with to take the ‚data‘ to the ‘service’ for processing. Firewalls in between use the header information to allow or deny the transport of a packet – that‘s all what a firewall does in principle. So any incoming data packet identifies the ‚requestor‘ by its ‚source IP address‘ and the ‚service port‘ classifies what the requestor is up to do on the target system. Watcher Master 1.4 Page 7 of 52 Watcher - Master manual - Rev. 1.4 By tracking the requestor’s behavior it is possible to identify the requestor as a normal service user or as a ‚burglar‘ or ‚attacker‘ of the target system. 1.1 Why Watcher? There are already other ‘Intrusion Detection Systems’ (IDS) and ‘Intrusion Prevention Systems’ (IPS) in the field like ‘Fail2Ban’, ‘Snort’, ‘Suricata’ and quite a couple of other solutions. Why don’t we just use them? The trouble is: ‘integration’ and fitness for the purpose. We were not willing to integrate and maintain several different IDS/IPS systems for the main services that an ‘exposed host’ is delivering to the open Internet. These services are: • Login services • Mail Transport & Mailbox access services • WEB services (http/https) Those services run on some specific ‘service ports’ that must be open in the firewall for the purpose of the machine. Other service ports are shut in the firewall anyway and therefore there is no need to deal with them at all at the service level. Watcher brings it to the point … since ‘service related’ Watcher modules automatically track the log files in real-time of only those services that are under attack by bandits on the Internet. And Watcher integrates this trilogy of scanners into a single framework – so there is no messing with a couple of different systems and tools. • Fail2ban … only takes care of the ‘login’ services and so it is not sufficient on ‘root servers’ that also run mail transport, mailbox & WEB services. • Suricata … is more a full-fledged ‘network traffic analyzer’ than an IDS/IPS and is overkill for the purpose of protecting services that run over open service ports in the firewall. • Snort … is meanwhile a commercial product and owned by CISCO-Talos. There is a ‘community’ edition available but this is restricted by a ‘for personal use only’ policy. Due to its age Snort is pretty much outdated. Indications of attacks can be directly found in the service’s log files and there is no need for ‘scientific low-level network analysis’. For example, if a Postfix MTA complains in its log file with “…: connect from unknown[] …” Watcher Master 1.4 Page 8 of 52 Watcher - Master manual - Rev. 1.4 the situation is entirely clear. It says by the pattern ‘\: connect from unknown\[‘, that someone coming from a NXdomain (Non-eXistend domain; i.e. not known by any DNS) is trying do deliver a mail message across this MTA. But MTAs do not talk to NXdomains, since they are not ‘open relays’ to transport mail messages for any anonymous sender that comes along. So a Watcher module related to a service just syncronously reads in real-time the logs of services straight from the system-logger. Each ‘Module Process’ is straight related to a so-called ‘facility’ of the system-logger to which the service delivers its log. Then the system-logger (rsyslog or syslog-ng) passes this log messages through a FIFO directly to the ‘Module Process’ of a Watcher module for determination and registration of an attacker in an exclusive database that results probably in a DROP in the firewall for an attacker, if a configurable limit of ‘affairs’ is reached. So Watcher integrates all ‘scanners’ (modules) into a single framework and there is no need to operate and maintain a bunch of several different products. Watcher Master 1.4 Page 9 of 52 Watcher - Master manual - Rev. 1.4 1.2 What’s the audience for Watcher? Watcher is addressed to anyone who has to operate a server on the open internet these days as an ‘exposed host’. These are usually so-called ‘root servers’ and machines that are running in the DMZ of a data center. In such a situation a server system is exposed to access by anyone (i.e. any other system accessing the Internet) which is essential for some services; e.g. Mail transport agents (MTAs like PostFix, Exim, Qmail,…), WEB services, and last but not least ‘console login’ services to maintain and operate the own servers across the internet. Companies and people that have rented a so-called ‘root server’ from a provider to hang out their business or organization domains to the open internet for presentation are facing the harsh winds that are going ‘round on the open internet. SPAM, SCAM, break-in attempts, and other kinds of attacks are instantly seen when the computer system is exposed to the open Internet. 1.3 What does Watcher need? 1.3.1 Firewall Since Watcher is a ‘subordinate firewall manager’ Watcher needs a flawlessly working firewall on the system. It is assumed that a firewall is already installed and running. The Prep routine will check this in the first stage of preparation and denies preparation of the Watcher framework if there is no suitable firewall installed and running. A modern Linux kernel provides two different ‘firewall systems’: • xtables …. maintained by iptables, ebtables, arptables & ipset • nftables … maintained by ‘NetFilter Tables’ (NFT) In Watcher Rev. 1.x series the ‘traditional’ xtables kernel firewall is supported, that is maintained by the iptables command, the iptables-service and the ipset tool. (Watcher Rev. 2 will be fully based on ‘nftables’ that integrates IPV4 & IPV6, iptables, arptables, ebtables and ipset in a single framework that is maintained by the ‘nft’ tool.) Assure that iptables, iptables-services & ipset tools are installed and working flawlessly. The ‘firewalld’ is not supported, since ‘firewalld’ is just a PYTHON wrapper around the native ‘nft’ commands that maintain a nftables kernel firewall. Watcher Master 1.4 Page 10 of 52 Watcher - Master manual - Rev. 1.4 1.3.2 System logger The Watcher modules read the system logger output in real time through exclusively assigned FIFOs (‘named pipes’). This takes manual preparation of your system logger before any of the installed and activated modules can work. See the installation manual for modules on how the system logger (rsyslog or syslog-ng) must be prepared in order to work with Watcher modules properly. 1.4 What does Watcher do? The Watcher master package provides the • framework • libraries (APIs for awk & bash) • system determination and automatic preparation tasks • start-up services As that the Watcher master is the basis for operation and must be installed first of all. Watcher modules automatically and dynamically track specific system logs on the system and determines the behavior of requestors. In this sense Watcher is an ‘intrusion detection’ system. But Watcher does not only detect burglars & attackers but takes measures against future attempts to keep the services free from defending themselves instead of doing their usual tasks. This leads to a much better performance of the services. Watcher modules record every attempt of burglary & attack in a database and if a configurable maximum of attempts (‘affairs’ in Watcher’s nomenclature) is reached the modules puts a DROP into the firewall and records this in the database as well. There are several watcher modules in order to track the behavior of requestors on several different services. • Console Logins (SSHD) • Mail transport request to the MTA & Mail-box access services (POP, IMAP, …) • WEB server log scanner (integrated with release 1.3) • Geo-Blocking dynloader & Geo-Tracking (pseudo-)module (new with release 1.4) Ill-behavior of requestors is honored by a DROP in the firewall after some identified requests, that show hostility or pointlessness of a requestor. This way a requestor is blocked right at the ‚front door‘ and cannot pester a service with attacks; e.g. attempts of pushing SPAM through a mail server or gaining console access to the system. Watcher Master 1.4 Page 11 of 52 Watcher - Master manual - Rev. 1.4 1.5 How does Watcher do this? At system start-up (or after reboot) the system starts the Watcher service (Master) which in turn flushes the firewall within seconds from several resources. Since revision 1.3 it takes not even a second. Watcher runs a master process and starts several modules for specific services. • The WatchLG module tracks hostile login attempts. • The WatchMX module tracks mail transport requests for signs of abuse and illegal access. • The WatchMB (as a companion of WatchMX) tracks illegal access to the mail users’ mailboxes or illegal mail transport request usually conducted by SPAMers. • The GeoTrack (Pseudo-)module Each module has its own database where all the illegal access attempts are stored during scanning of the requestor’s behavior. So it is easily possible to restore the firewall with DROP information for IP addresses that were identified in the past as ‘burglar’, ‘SPAMmer’, ‘attacker’ a.s.o The GeoTrack (pseudo) module even blocks complete subnets (CIDRs), if a country is on the list in the configured ‘ZONES=...’ variable. On a running system it looks like this ... [root@hphws2 Watcher]# ps -ef | grep -i watch root 2873 1 0 07:32 ? 00:00:00 /bin/bash modules/WatchLG/WatchLG root 2874 1 0 07:32 ? 00:00:00 /bin/bash modules/WatchMX/WatchMX root 2875 1 0 07:32 ? 00:00:00 /bin/bash ../WatchMB/WatchMB 1.6 How is Watcher constructed? Philosophy: KISS … Keep It Small & Simple. Watcher avoids the use of any fancy programming languages or 3rd-party runtime environments and no compilation of source code is needed. Watcher is entirely based on ‘onboard tools’ that any modern UNIX-like operating system provides anyway or that are publicly available as reliable OpenSource components. Essentially Watcher uses GNU bash, GNU awk and relies on other GNU implementations of the UNIX tool-set (like GNU grep, etc.; ‘coreutils’ et al) that comes with every basic installation of a Linux system. Watcher Master 1.4 Page 12 of 52 Watcher - Master manual - Rev. 1.4 The Watcher development started in 2013 on an old SuSE 9.7 Linux system as a mere hack just to prevent break-in attempts to a rental ‘root server’ in a data center. Later on Watcher development continued on a CentOS system (CentOS-6 in 2016 and since 2018 on CentOS-7) whereas CentOS is known for its “old-fashioned” orientation. “Latest-is-greatest” is not the way of CentOS but reliability, stability & maintainability. So CentOS is often running with all tools at least one release level behind the actual releases . By growing Watcher on such a basis it is pretty much guaranteed, that Watcher works just fine on newer systems like RHEL-8/CentOS-8 or even newer. This also keeps ways open to easily adapt Watcher to other Linux distributions (Debian, Ubuntu, …) or even other operating systems (AIX, HPUX, Solaris, ...) for which GNU renditions of the UNIX tool-set are available. Revision 1.3 introduced extended to support for: • SuSE Linux Enterprise Server (SLES) & openSuSE Leap • Debian • Ubuntu 1.7 What’s new in this revision? The previous release Watcher 1.3 completed the trilogy of modules by implementing the module “WB” for reacting on WEB server attacks. Watcher 1.4 provides geo-blocking and geo-tracking on top. Note in particular that geo-blocking and geo-tracking do not block single IP addresses but block entire sub-nets based on the CIDR the attacker lives in. The lists for the geo-blocking dynloader already come in with CIDR notation. The GeoTrack pseudo-module determines in a sophisticated process the CIDR from official resources for an incoming IP address; i.e. the first IP address of a CIDR range triggers the blocking of the entire CIDR range. 1.7.1 Geo-Blocking & Geo-Tracking Watcher revision 1.4 drops-in geo-blocking & geo-tracking. The experience shows, that over 60% of all attacks are coming from Russia & China. Blocking such countries by DROPs in the firewall can increase the effectivity of attack suppression to a level of 95%. This was the motivation to implement geo-blocking and geo-tracking. 1.7.1.1 Geo-Blocking Geo-Blocking is implemented as a ‘dynloader’ by the name ‘geo’. The dynloader ‘geo’ loads lists from ‘ipdeny.com’, turn these lists into loadable file for IPSET and loads the firewall information into the ipset ‘geo’. Watcher Master 1.4 Page 13 of 52 Watcher - Master manual - Rev. 1.4 As typical for dyloaders they are called just once during Watcher startup in the load-phase. Consecutive runs must be implemented by an entry in the root’s crontab file to update the firewall information with the schedule of the updated lists by the list provider. 1.7.1.2 Geo-Tracking Geo-Tracking is implemented as a (pseudo-)module ‘GeoTrack’. It’s called pseudo-module since it follows the module concept but does not serve a particular system service (Login, MTA/Mailbox, WEB server) but is fed by the regular modules every time a culprit is registered to the database of a regular module. Watcher Master 1.4 Page 14 of 52 Watcher - Master manual - Rev. 1.4 » PART 1 – OVERVIEW AND CONCEPTS 2 Overview 2.1 Overall architecture Watcher Master 1.4 Page 15 of 52 Watcher - Master manual - Rev. 1.4 2.2 Watcher master The ‘Watcher master’ provides the framework and library for other components like ‘dynamic loaders’ (dynloader) and ‘modules’ that address specific services on a particular server system. It acts as a ‘one-shot’ service for the initial load of the firewall at system startup or after reboot and then dies. The watcher master gets started by the operating system if it is enabled as a service. In turn the master starts the configured modules as these are enabled in the watcher.conf configuration file if these dynloaders or modules are installed at all. The master process does not use a database. In the first place Watcher master provides global ‘blacklist’ & ‘whitelist’ files that are maintained manually and provides a local blacklist for IP addresses and complete networks (CIDR format) that are to be DROPed consequently because of known ill-behavior. In addition the master provides mechanisms to request DROP lists from global resources (like SpamHaus or NixSPAM, etc.). Such programs are called ‘dynamic loaders’ (DynLoader) In principal the Watcher master can run without any modules using only its own static blacklisting and the worked out information from common/external resources. But with installed modules the tracking of burglars, attempts of system abuses & attacks gets fully dynamic. Watcher Master 1.4 Page 16 of 52 Watcher - Master manual - Rev. 1.4 2.3 Watcher modules The Watcher modules are the real work horses in the Watcher system. Modules are autonomous processes that get started and stopped by the Watcher master service. Once started they run independently in the Watcher framework and can even restart themselves if they crash for some reason that occurred. Modules provide: • Real-time intrusion detection & prevention • Storage of their information in exclusive databases (sqlite3) for fast retrieval and update (instead of linear file searches that turn out getting slower-and-slower as data grows) • Statistic reports to get measurement data of the efficiency of the measures • Self-cleaning through automatic housekeeping of the databases through database expiration. • Autonomous feed of the firewall with DROPs. • Autonomous logging and extended tracing for the intrusion detection. For a detailed explanation of the Watcher modules see the separate “Watcher modules manual”. 2.4 Dynloaders Dynamic loaders (dynloaders) are specific programs that can fetch information from external resources. These ‘external resources’ can be anything: local files, lists from the Internet, etc. See the section for dynloaders in 42 Watcher Master 1.4 Page 17 of 52 Watcher - Master manual - Rev. 1.4 » PART 2 - WATCHER INSTALLATION 3 Installing Watcher The watcher service takes some basic system resources so that it can work. In its preparation routine ./Prep it checks whether the needed system components are present and automatically creates a ‘system.conf’ file that adapts and explains the system to the Watcher master, the dynloaders, the modules and the utility programs. 3.1 Pre-installation considerations 3.1.1 Turning off SELINUX On a ‘root-server’ or datacenter server in the DMZ there are usually no users but the ‘superuser’ allowed and/or registered. Having SELINUX enabled does more harm than it does any good in such a situation where no non-privileged users are connecting the system. For instance, SELINUX rules forbid the system logger to write log files outside of /var/log/… and on ORACLE Linux it was found, that creating ‘named pipes’ (FIFOs) where they are needed was forbidden. Turning SELINUX ‘off’ solves all this. Edit the file /etc/selinux/conf and change: SELINUX=disabled Then reboot the system before you continue. 3.1.2 Switching to syslog-ng Practically all linux distributions come usually with ‘rsyslog’ installed as the standard system logger. But experience showed, that ‘rsyslog’ has its flaws which are not acceptable: • hanging FIFOs • redundant criss-cross logging to several log files for log streams from the WEB module’s After switching to ‘syslog-ng’ all these quirks were gone and configuring works far better as ‘syslog-ng’ is smarter and excellently documented. So it is recommended to replace ‘rsyslog’ with ‘syslog-ng’ (OCE; Open Community Edition) which is fairly easy to accomplish. See the section ‘Configure the system logger’ for details. 3.2 Install path & unpacking Before the Watcher master package is unpacked a choice must be made where to locate and unpack the package. The Watcher system can run from any path you like. Good choices are: Watcher Master 1.4 Page 18 of 52 Watcher - Master manual - Rev. 1.4 • /opt/… • /usr/local/… • /root/bin/… (or just /root/…); provided your root filesystem is not short of disk space. A Watcher system that ran for some time consumes about 100-120MB. The most filesystem consumption comes from module databases and the *.trace files of the modules that live directly in the module path. So calculating ~200-250MB of filespace is a good choice to be prepared of future extensions; e.g. if you plan to roll your own dynloader. The master package unpacks to a relative path ‘Watcher/...” and all Watcher packages (master & modules) are stored in simple ‘*.tar’ files. To unpack the package file just type: # tar xvf .tar To continue installation change to the installation directory with: # cd Watcher 3.3 Preparation In the installation directory (master path) you will find a program named Prep The PREP script will handle a big part of the installation tasks for you. • It checks the platform on which it is running: RedHat, SuSE, Debian/Ubuntu ... • It checks for needed programs which the watcher modules, dynloaders and utility programs depend on • Places a start-up script in /etc/init.d/… and/or systemd configuration and enables the ‘auto start’ of the watcher service (master) Just go to the installation directory (MASTER_PATH) and type in: ./Prep [ENTER] ‘Prep’ itself is started with a so-called ‘she-bang’ (#!) to the GNU bash normally found in /bin/bash. If there is no GNU bash installed on your system ‘Prep’ fails with an error message from the shell that you are using: (your shell) ./Prep: /bin/bash: bad interpreter: No such file or directory If this should happen install a GNU bash V3.x or newer on the system which is absolutely essential. Not even ‘Prep’ can start without. If ‘Prep’ detects other missing things it will tell you and the missing things must be installed on the system before Prep will continue with further preparation for the Watcher framework. If the check for needed tools passed successfully then Prep continues with the preparation of the startup in /etc/init.d and prepares the Watcher startup in traditional SysV manner. When it detects a Watcher Master 1.4 Page 19 of 52 Watcher - Master manual - Rev. 1.4 systemd-style startup concept on the system a ‘watcher.service’ file will be also installed in /usr/lib/systemd/system/watcher.service. 3.3.1 Needed programs Absolutely essential: • GNU bash V4 or newer • GNU awk V4 or newer • GNU grep V2.2 or newer Additionally needed: • ‘iptables’ & iptables-services • ‘ipset’ (essential since Watcher 1.3) • ‘ipcalc’ for validation of IP addresses (not available on Debian-like systems; e.g. Ubuntu) • ‘realpath’ since all Watcher components check WHERE they are running and determine their own file position and name for identification in log-files and such. • ‘sqlite3’ if any of the modules is in use; the watcher-master itself does not need a database • … also … • ‘at’ for the auto-restart after a module runs into a crash • ‘bc’ for some floating-point calculations; e.g. for tools like Watcher-Report, Procrate, etc. 3.3.2 Toolpath Some of the tools that come with the Watcher master or the modules symlink themselves to the path provided by the TOOLS_LINK variable defined in watcher.conf /usr/local/sbin to be widely available. [root@vmd28527 Watcher]# ls -l /usr/local/sbin/ total 8 lrwxrwxrwx 1 root root 28 Nov 17 10:28 Freeme -> /root/bin/Watcher/bin/freeme lrwxrwxrwx 1 root root 44 Nov 17 10:28 LGinjector -> /root/bin/Watcher/modules/WatchLG/LGinjector lrwxrwxrwx 1 root root 44 Nov 17 10:28 MXinjector -> /root/bin/Watcher/modules/WatchMX/Mxinjector To easily access these tools the PATH variable can be extended in the superuser’s .profile, .bash_profile or the ./bashrc file: export PATH=/usr/local/sbin:$PATH This way all the Watcher tools are generally available from $TOOLPATH. Note, that you must log-out and log-in again after such a change to your PATH variable. Watcher Master 1.4 Page 20 of 52 Watcher - Master manual - Rev. 1.4 » PART 3 – WATCHER OPERATION 4 Operation tasks Watcher on the whole is designed for ‘minimum maintenance’. So the amount of maintenance tasks for the framework is fairly small. 4.1 Watcher master operation 4.1.1 Starting and stopping the watcher service [root@hphws2 etc]# service watcher start Starting service watcher: Watcher V1.3 ... Running on centos 7 Language en_US.UTF-8, LC_ALL: en_US.UTF-8 Watcher-ramdisk on /root/bin/Watcher-1.3/Pool … size=20480k) Present DynLoaders: nixspam spamhaus Present Modules : WatchLG WatchMB WatchMX Loading firewall ... Took 0.6890 seconds for 16038 total firewall DROPs Loadrate: 23277 DROPs per second Starting module WatchLG ... Starting module WatchMX ... Starting module WatchWB ... Installed modules: WatchLG WatchMX WatchWB [OK] Possible options are: stop Stops all modules Note: This will NOT unload the DROPs from the firewall. The system remains protected until the iptables service is stopped/restarted as well. start This triggers the ‘Load’ programs from dynloaders, modules and static files (blacklist, whitelist, ...) and finally calls FillFW to set up the firewall with complete initial DROP information from all resources before the modules get started. Finally reads the local manually maintained ‘blacklist’ and ‘whitelist’ files. restart Does a ‘stop’ followed by ‘start’ in one rush. Note that the iptables service is not affected by this. Only the watcher modules and dynloaders are triggered to load their exclusive IPSETs from their resources. reload Restarts the iptables service prior to restart the watcher service; i.e. it starts based on a ‘plain’ setup of your firewall settings. Watcher Master 1.4 Page 21 of 52 Watcher - Master manual - Rev. 1.4 (full) Deprecated. Replaced by ‘reload’ With Watcher revision 1.3 no longer needed and removed from the options. If your particular system has a systemd-style startup system the ‘systemctl’ command might be used to control the Watcher startup: # systemctl