Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 1.33 KB

File metadata and controls

23 lines (18 loc) · 1.33 KB

Dockerfile for Postgres for MalwareDB

This experimental Docker file builds extensions for Postgres on Debian for use with MalwareDB. Please see Docker Postgres for more information.

Postgres Extensions

Postgres is installed with extensions for:

To use the extensions, you have to add them to each database schema you wish to use them as the schema owner, or as the postgres user. SQL commands:

  • CREATE OR REPLACE FUNCTION lzjd_compare(TEXT, TEXT) RETURNS INTEGER AS 'lzjd_psql.so', 'pg_lzjd_compare' LANGUAGE 'c';
  • CREATE OR REPLACE FUNCTION fuzzy_hash_compare(TEXT, TEXT) RETURNS INTEGER AS 'ssdeep_psql.so', 'pg_fuzzy_hash_compare' LANGUAGE 'c';
  • CREATE OR REPLACE FUNCTION tlsh_compare(TEXT, TEXT) RETURNS INTEGER AS 'tlsh_psql.so', 'pg_tlsh_compare' LANGUAGE 'c';

Be sure to set the admin password for Postgres via the POSTGRES_PASSWORD environment variable, shown below.

$ git clone https://github.com/malwaredb/pg_docker.git
$ docker build -t postgres-similarity/latest .
$ mkdir pg_data
$ docker run -v `pwd`/pg_data:/var/lib/postgresql/18/data -p 5432:5432 -e POSTGRES_PASSWORD=yoursecurepassword postgres-similarity/latest