Exim gets a second chance

tube recycle those 1’s and 0’s

Exim was something the zoo thought of using before using something else now in production here at the zoo but doing our default mail server seemed heavy weather on a basic host.

So i configured exim which was a new experience for me without the gay russian spies at cambridge* (my blog) to help

I found  acls tricky being that

10.0.0.4 : 127.0.0.1

Did not work. – but

x.x.x.4:127.0.0.1

Did

It is a bit whiny and the update-exim4.conf.conf on debian  is not the most obvious file to file the settings in debian..  Not that i expect to edit it often

I still prefer my first choice.for smtp.

*Трахни меня товарищ

rpz secret society woes in bind on debian

Sisyphus is still a role model

So i wanted a dns firewall, (my blog) i did not want to pay or use a blocklist nameserver so it was time to do it yourself.  So our dns nameserver got upgraded eventually and i had a go.

rpz’s supposedly made this easy with all bad sites in one file opposed the many files per site.tld [per xone in rbldns and slow]- although rpz usage is hard to track down.   My first attempt was met with

ignoring out-of-zone data (citricbenz. website)

Apparently should be made with

citricbenz. website. in cname .

Citrixbenz is a zeus trojan server* when i wrote this and still might be and the only entry in my zone

However it dont work until you assign a policy and they have bizarre syntax. Something kind of does and does not work

changed from 2 to 1 qname, 0 to 0 nsdname, 0 to 0 IP, 0 to 0 NSIP, 0 to 0 CLIENTIP entries

So something is working.

The next day was interesting as i used the chrome browser which passed along my attempts to access the named example – i had to assure cbl that i was not zeus infected as i use cbl on the zoos website (my blog) .  Moral of the tale do not use google software things to try out security stuff.

Having fixed that issue on our internal router i had a bit more luck and got a working rpz zone by blocking yahoo.com as that s safer to test with and my attempts to display a redirected website message ended in failure although nxdomain works.

I still seem to be resolving the real ip rather than lookup to the zone i created. which means i am close and i achieved interception of the request with

zone "internal.zoo" policy passthru;
zone "rpz.zoo" policy cname compromised.zoo;

the cname compromised.zoo redirects the bad site request ** to compromised.zoo. – .zoo being our domain name/tld and compromised being the zone name. It tells a user that something is wrong

Logging is important here.

Order matters here [precedent] the passthru is first, and the more restrictive.  note the lack of semi colons and quote statements which feels a bit odd when option { x; y; z }; is the normal syntax bind knows and parses and most of us expect.

Your webbroswer is faster than our dns rpz.and has the same data

So a race condition can develop.,If you have infected things the rpz will do more than just the browser blocklist your browser uses. although the log will detect the rpz hit.

client internal.zoo.lan#16983 (windrushvalleyjoinery.co.uk): rpz QNAME DROP rewrite windrushvalleyjoinery.co.uk via windrushvalleyjoinery.co.uk.malware.zoo

This stuff is quite hard to figure out

As to who’s fault this is after all the zoo clearly should be paying some security firm for this by the three and half dns professionals on the internet who guard this knowledge like a secret, or is out of date

Stats are interesting bind reported

[malware.zoo]
                   7 response policy zone rewrites

So not informative – that seems a good place to end.

I might do a further post on how i make zones but being honest the zoo appears to be immune from visiting dodgy sites as either the browser stops it and so while the zones exist they do not trigger for lack of a match.

weird shit with a cyrus imap server

One of the zoo’s imap servers decided to play dead when the other three where perfectly happy on the same box.  Having recently done a debian upgrade it was my job to fix it.   However i cascaded one fault to another store which was not my fault as i was using bad software that i thought was good from ten years ago.

Having spent a fun couple of days trying to fix the thing i found that it is best to not use gyrus admin gui as it fucks up acls and cyrus users.  So good to know and DO NOT USE GYRUS. – use cyradm instead.

In the end i restored the instance from backup after getting some stuff to work most of it did not and cyrus imap is not the most verbose thing with one debug setting in /etc/default/cyrus-imap your on your own.

Something went bad but with three other stores working away it was still an non easy diagnosis and what it was is something cyrus imap kept mum on.  It was good to know that gyrus admin does more harm than good these days and the permissions to our imap stores are horrible compared to modern imap.  However since it been over ten years since i started with cyrus imap and you can knock off seven days for downtime those being upgrades so cyrus imap is generally good software.

I had a sort of mostly working fixed message store thing but many messages and folders where not showing up and as the zoo damm insist on getting it all back i opted for the backup as the easier fix.

Email was flowing in but he store was not accepting it

I still had to delete the sockets and reconstruct the data with [/usr/lib/cyrus/bin/reconstruct -C /etc/cyrus/zoo1.conf] but the data is mostly there as requested.

modsecurity on debian

Modsecuritty left me confused – i thought i had the basic rules but had the extended crs rules as well and so it did not need configuring.  Debian (my blog) wiki keeps mum on the subject as well.

I know its working although its reporting via ruby,  upgrades via python make it a multidisciplinary tool.

From what i read outside of Debian it seems to work with our stuff so it remains on.  Mystery software that sounds like a future problem for me.to disable.

Its log messages are also hard to grep and awk.

I guess i shall be writing about mod-security rules at some point in the future…

some Debian 9.4 fun

with debian 9.4 postfix (my blog) started working once again, and opendmarc (my blog) had a funny five minutes when pidfile mismatched in the systemd config compared to the opendmarc.conf.I also needed dpkg --configure -a when apt decided stuff was still wrong with opendmarc..

who was right is a debate but I have not changed stuff i still have an opinion of systemd still sucks.

Opendmarc logging for reports also seems broken as to why i will have to look at it but it was and then it did not

I lost cups printers on an separate 686 Debian kernel but the rest of the zoo on i386 printers works so not a terrible headache

Overall forwards and a bit backwards too

Fixing systemd postfix failures via cron

Being when i write this it is winter i decided to reboot the zoos server and put in standard* more for the cooling fans, having done that (free room heat) i restarted and forget to check if postfix had started (my blog) .

Eventually i hand type the postmulti (my blog) command and it works. As reboots are rare this is not an everyday occurrence i can excuse the behaviour after all systemd wont tell me why it fails since its perfect so i must be to blame for going outside of ‘default’ systemd configuration..

So i decide to create an onboot script with cron and the @reboot command and that now starts postfix for me and does something that systemd cannot do

I imagine the idiots who develop systemd are most upset with me and will development a cron replacement that disables that feature.  If they do then i think my migration to a bsd variant will be guaranteed.

If your software sucks like systemd does then best do not blame us ‘users’ for stuff that other things can do.

*opposed to hurricane/typhoon speed which is good summer setting

apache2-doc debian weirdness fixed

If like the zoo you upgraded from debian 8 to debian 9 (my blog) then apache2-doc fails to do something on the lines of

ERROR: Conf apache2-doc does not exist!
dpkg: error processing package apache2 (–configure):

But apache still runs.  – An purge and install eg:

apt purge apache2-doc;apt install apache2-doc

Fixes it so shit software like systemd will not complain about it.  Honestly no idea why you have to do this when the version of the package was current but that’s how things go with systemd

debian 93

Did not do anything seriously nasty that i was immediately aware of and the systemd fault mentioned here (my blog) means systemd cannot load postfix on start up at all systend is very shit software.

zeitgeist-daemon is another headache with systemd as i baked a disk and could not start the x server on the machine on next login.  So i killed all my users processes [not root] and gave up and found some hardware elsewhere that worked.  I shall look into removing zeitgeist-daemon

I think i also lost x access for root in 9.2 as well not that i use it often [once a year] but having a gui as root is nicer than vi when you have four servers to do stuff to..

I could see a migration to the bsd way if things continue to go a certain way.- I demand very little but when systemd wont start stuff,magic daemons stop x and none of it your fault then perhaps linux as a server is not the thing i thought it was.

On that thought lets leave as accommodating linux quirks is possible but not that desirable perhaps you can justify calling /usr/sbin/postfix instead of using systemd in scripts but i feel perhaps there is something that works rather than is supposed too but does not.

I look forward to exploring bsd and knowing more so i can make an informed choice.

Creating and deleting files automatically in shell scripts

I frigging love linux for this shit

appends the date to filename $date + (“%Y%m%d”)

example

tar -zcf documents.backup.$(date +”%Y%m%d”).gz Documents

locate files of five days and older find * -type f -mtime +5

So there i was creating files and then wondering about the bother in deleting them manually when i thought there must be some way and a bit of thinking meant no human interaction from me with a cron job.

You want to the aim the find at the right place with the delete syntax which i have omitted.

Only moan i now have to delete my calender reminder i set.