pg_snakeoil: The PostgreSQL Antivirus

Christoph Berg <[email protected]> Mon, 28 Jan 2019 14:43:04 +0100
Newsgroups gmane.comp.db.postgresql.announce
Message-ID <[email protected]>
Running typical on-access antivirus software on a PostgreSQL server has severe
drawbacks such as severely affecting performance or making the filesystem
unreliable.  The failure modes are extremely problematic when a
non-PostgreSQL-aware scanner blocks access to a file due to viruses, or even
false-positives and bugs in the scanner software.

We typically recommend not to run such software on PostgreSQL servers, as
PostgreSQL knows how to discern between code and data and will not execute any
viruses stored in a database. However, running anti-virus software is sometimes
required by local policy.

pg_snakeoil provides ClamAV scanning of all data in PostgreSQL in a way that
does not interfere with the proper functioning of PostgreSQL and does not cause
collateral damage or unnecessary downtimes.

https://github.com/credativ/pg_snakeoil
https://github.com/credativ/pg_snakeoil/releases/tag/v1.0

postgres=# SELECT so_is_infected('X5O<...Eicar string...>');
 so_is_infected
----------------
 t
(1 row)

postgres=# SELECT so_virus_name('X5O<...Eicar string...>');
    so_virus_name
----------------------
 Eicar-Test-Signature
(1 row)

Christoph

PS: Examples redacted because this mail shouldn't get filtered out :)
-- 
Senior Berater, Tel.: +49 2166 9901 187
credativ GmbH, HRB Mönchengladbach 12080, USt-ID-Nummer: DE204566209
Trompeterallee 108, 41189 Mönchengladbach
Geschäftsführung: Dr. Michael Meskes, Jörg Folz, Sascha Heuer
Unser Umgang mit personenbezogenen Daten unterliegt
folgenden Bestimmungen: https://www.credativ.de/datenschutz
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEXEj+YVf0kXlZcIfGTFprqxLSp64FAlxPBucACgkQTFprqxLS
p668Rw//SxLNnHKUGzZkxUNLaAnP58Zx+iKDuycS/Mu8zFUTdyd8XCQMzE3vqxvn
j7lkYsRLLLLHFSk9TrVnxhT+M5M6hLcrmL1IWKJRa+vgN5OaLFP77yPx8dxQFEPD
76Aw2BjnIyEooFZeEj2RSG7Q6rMLfPHVthoXGlXpJkZunHXeMfgFOH4pNCzKq/Bj
uyCN+/dJH8jvR+z5zZeB6toMVlDwtji4bB8cg8eWa6vG7GOVc4qEeWQZ5e0Ao5Id
9wAzheGs0vm8sw7GoM4Vr3NDAvn78LLuT1fmFqh0Ly8+IRkTj7aou07AtxKJH0VZ
YxQDDpwjQFmKOiMKANyDwcQIhYiAn5QA6sIYHqHbLUTygU5B3t9R7dmOzsgpC1fx
BM+7d4l2RnYqssayPwyyt/7NbM03bjTYZQeugXDH1YadHZoLVtKlG+Vu5IFzLvbg
A+9fA/IboQCl2mp5cLGrDzzAK8EgP83hf1AcPBx4ad1M45Z3KpMtE5o5tYxOhY4b
r8sVo81R0Y0KVCscMrfbM8AdVaVyN1Vz8fOJipAGnoxzmgzwgYvXBkkGiv174uM8
KRr6Jx0BnhRSC4x7mzgJgNSxk63K76GwYWt5RSLQ87AWZ1nfGYmXBqfY8hCdle2j
EKJdn0EI+LHVpQG7wubRFOYFkC9qK+YYV+dr0L5VAxsxhSp4ins=
=cR2/
-----END PGP SIGNATURE-----