| 1 | Configuring SWATCH |
|---|
| 2 | |
|---|
| 3 | On AUTH1 |
|---|
| 4 | |
|---|
| 5 | 1. Create the configuration file for swatch: |
|---|
| 6 | |
|---|
| 7 | - Edit /usr/local/etc/swatch.conf -- use TAB and not SPACE |
|---|
| 8 | for the lines below "watchfor"! |
|---|
| 9 | |
|---|
| 10 | $ sudo vi /usr/local/etc/swatch.conf |
|---|
| 11 | |
|---|
| 12 | - - - - - - - - - - - - - - cut below - - - - - - - - - - - - - |
|---|
| 13 | |
|---|
| 14 | watchfor /client ([0-9A-F.:]+)\D\d+ \((\S+)\): zone transfer '(.*)\/IN' denied/ |
|---|
| 15 | mail=sysadm,subject=Zone AXFR denied for $3 from $1 |
|---|
| 16 | threshold type=limit,count=1,seconds=600 |
|---|
| 17 | |
|---|
| 18 | - - - - - - - - - - - - - - cut above - - - - - - - - - - - - - |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | 2. Enable the mail server |
|---|
| 22 | |
|---|
| 23 | - Add to /etc/rc.conf |
|---|
| 24 | |
|---|
| 25 | postfix_enable="YES" |
|---|
| 26 | |
|---|
| 27 | - Then run the following commands |
|---|
| 28 | |
|---|
| 29 | $ sudo newaliases |
|---|
| 30 | $ sudo service postfix start |
|---|
| 31 | |
|---|
| 32 | 3. Try sending mail to yourself |
|---|
| 33 | |
|---|
| 34 | - Now send yourself an email: |
|---|
| 35 | |
|---|
| 36 | $ echo hello | mail sysadm@auth1.grpX.dns.nsrc.org |
|---|
| 37 | |
|---|
| 38 | ... don't forget to replace X above with the number of your group. |
|---|
| 39 | |
|---|
| 40 | - See if the mail has arrived: |
|---|
| 41 | |
|---|
| 42 | $ mutt -f /var/mail/sysadm |
|---|
| 43 | |
|---|
| 44 | (answer Yes if you are asked to create the folder for the mail) |
|---|
| 45 | |
|---|
| 46 | 4. Start swatch: |
|---|
| 47 | |
|---|
| 48 | - This must be done as root, remember to use sudo: |
|---|
| 49 | |
|---|
| 50 | $ sudo -s |
|---|
| 51 | |
|---|
| 52 | # swatch -c /usr/local/etc/swatch.conf --tail-file=/etc/namedb/log/general --daemon |
|---|
| 53 | |
|---|
| 54 | # exit |
|---|
| 55 | |
|---|
| 56 | $ ps axuww | grep swatch |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | - You should see a line like the following: |
|---|
| 60 | |
|---|
| 61 | root 58811 0.0 0.0 11500 2124 5 RJ 11:41AM 0:00.02 /usr/local/bin/perl /usr/local/bin/swatch -c /usr/local/etc/swatch.conf --tail-file=/etc/namedb/log/general --daemon |
|---|
| 62 | |
|---|
| 63 | 7. Ask another group to perform a zone transfer of your zone: |
|---|
| 64 | |
|---|
| 65 | From their machine: |
|---|
| 66 | |
|---|
| 67 | # dig @auth1.grpX.dns.nsrc.org YOURTLD axfr (where X is YOUR group) |
|---|
| 68 | |
|---|
| 69 | Q: do they get a copy of your zone ? |
|---|
| 70 | Q: do you get an email about it ? |
|---|
| 71 | |
|---|
| 72 | 8. Check that mails are coming in: |
|---|
| 73 | |
|---|
| 74 | # mutt -f /var/mail/sysadm |
|---|
| 75 | |
|---|
| 76 | Note the information contained in the message. |
|---|
| 77 | |
|---|