Build docker container for sbserver (proxy for Google Safe Browsing APIs v4)
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
Dockerfile
LICENSE
README.md
makefile

README.md

google-sbserver-docker

Build docker container for sbserver, proxy for Google Safe Browsing APIs v4.

Building and dependencies

UPX, UNIX make, and Docker (CE) are required to build.

sudo docker build . -t objectcomp/sbserver

Running

Please get an API-Key from Google Developer Console.

sbserver runs on port :8080 by default. To make sbserver accessible from the outside world, this example simply maps host port 8080 to container port 8080:

sudo docker run --name sbserver -e APIKEY=<our API-key> -p 8080:8080 sbserver

Output should be similar to the following

safebrowsing: 2018/03/04 09:51:35 database.go:111: no database file specified
safebrowsing: 2018/03/04 09:51:40 database.go:243: Server requested next update in 30m18.537s
Starting server at 0.0.0.0:8080
safebrowsing: 2018/03/04 09:51:42 database.go:389: database is now healthy
safebrowsing: 2018/03/04 09:51:42 safebrowser.go:551: Next update in 30m18.537s

Test call

As sbserver is running, we can now call the API with a random entry taken from Malwaredomains.com:

curl -X POST -H "Content-Type: application/json" --data '{ "threatInfo": { "threatEntries": [ {"url": "bankofamerica-com-system-login-in-informtion-sitkey-upgrade.org"} ] } }' http://127.0.0.1:8080/v4/threatMatches:find

->

{
	"matches": [ 
		{ 
			"threatType":"SOCIAL_ENGINEERING",
			"platformType":"ANY_PLATFORM",
			"threatEntryType":"URL",
			"threat": 
				{
					"url":"bankofamerica-com-system-login-in-informtion-sitkey-upgrade.org"
				}
		}
	]
}

Docker Hub

Please find the resulting image on hub.docker.com

References