Skip to content

Commit a323c4c

Browse files
committed
chore: remove MalwareDB compilation
* This repo is now just for Postgres with the needed extensions. * The MalwareDB main repo has a Dockerfile for MalwareDB on Docker. Signed-off-by: Richard Zak <richard.j.zak@gmail.com>
1 parent a1e60a8 commit a323c4c

File tree

10 files changed

+5
-188
lines changed

10 files changed

+5
-188
lines changed

.github/workflows/docker-publish-malwaredb.yml

Lines changed: 0 additions & 87 deletions
This file was deleted.

.github/workflows/docker-publish-postgres.yml renamed to .github/workflows/publish.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Docker Postgres
22

33
on:
4-
schedule:
5-
- cron: '23 59 30 * *'
64
push:
75
branches: [ "main" ]
86
# Publish semver tags as releases.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
/.idea
22
/temp
33
/tmp
4+
pg_data
5+
samples
File renamed without changes.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2023 The MalwareDB Developers
189+
Copyright 2023-2026 The MalwareDB Developers
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

MalwareDB/Dockerfile

Lines changed: 0 additions & 59 deletions
This file was deleted.

MalwareDB/start.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

Postgres/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,23 @@
1-
## Dockerfile for MalwareDB
1+
## Dockerfile for Postgres for MalwareDB
22

3-
There are two Dockerfiles:
4-
* `MalwareDB/Dockerfile` builds a container with both Postgres with the extensions and MalwareDB.
5-
* `Postgres/Dockerfile` builds Postgres only with the extensions. This is for installations where MalwareDB should be separate from the database, or by those who'd like to use the similarity extensions.
6-
7-
Both use Postgres 15 from Debian 12 Bookworm.
3+
This Docker file builds extensions for Postgres on Debian for use with MalwareDB.
84

95
### Postgres Extensions
106
Postgres is installed, and extensions built with extensions for:
117
* [LZJD](https://github.com/malwaredb/LZJD)
128
* [SSDeep](https://github.com/malwaredb/ssdeep_psql)
13-
* [SDHash](https://github.com/malwaredb/sdhash_psql)
149
* [TLSH](https://github.com/malwaredb/tlsh_pg)
1510

1611
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:
1712
* `CREATE OR REPLACE FUNCTION lzjd_compare(TEXT, TEXT) RETURNS INTEGER AS 'lzjd_psql.so', 'pg_lzjd_compare' LANGUAGE 'c';`
1813
* `CREATE OR REPLACE FUNCTION fuzzy_hash_compare(TEXT, TEXT) RETURNS INTEGER AS 'ssdeep_psql.so', 'pg_fuzzy_hash_compare' LANGUAGE 'c';`
19-
* `CREATE OR REPLACE FUNCTION sdhash_compare(TEXT, TEXT) RETURNS INTEGER AS 'sdhash_psql.so', 'pg_sdhash_compare' LANGUAGE 'c';`
2014
* `CREATE OR REPLACE FUNCTION tlsh_compare(TEXT, TEXT) RETURNS INTEGER AS 'tlsh_psql.so', 'pg_tlsh_compare' LANGUAGE 'c';`
2115

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

2418
```
2519
$ git clone https://github.com/malwaredb/docker.git
26-
$ cd docker/Postgres
2720
$ docker build -t postgres-similarity/latest .
2821
$ mkdir pg_data
2922
$ docker run -v `pwd`/pg_data:/var/lib/postgresql/data -p 5432:5432 -e POSTGRES_PASSWORD=yoursecurepassword postgres-similarity/latest
3023
```
31-
32-
### MalwareDB
33-
The images are about ~4GB, could probably be smaller. The SQL commands for adding the fuzzy hash functions above are added by the `start.sh` script at container start. The Postgres server won't be accessible outside the container.
34-
35-
You should use this with an existing Postgres data instance so you can have the administrative settings in order (users, groups, sources). At present, the administrative functions aren't available over the HTTP API.
36-
37-
```
38-
$ git clone https://github.com/malwaredb/docker.git
39-
$ cd docker/MalwareDB
40-
$ docker build -t malwaredb/latest .
41-
$ mkdir mdb_data
42-
$ mkdir mdb_data/db
43-
$ mkdir mdb_data/samples
44-
$ docker run -v `pwd`/mdb_data/db:/var/lib/postgresql/data -v `pwd`/samples:/malware_samples -p 8080:8080 malwaredb/latest
45-
```

0 commit comments

Comments
 (0)