Skip to content

jxdv/gohard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gohard

gohard (golang harden) is a partial rewrite of grapheneX, which I also try to actively maintain. The goal was to get rid of all third party libs (not successful), and only have a CLI app.

I started learning Golang recently, so I thought this would be a good practice.

Build

64-bit linux

GOOS=linux GOARCH=amd64 go build -o bin/

64-bit windows

set GOOS=windows GOARCH=amd64
go build

There's a possibility that Microsoft Defender will flag this binary as malicious and refuse to execute it. Disabling real-time protection is a must-do in order to run.


[UNIX] Create a symlink for gohard binary:

sudo apt-get install -y coreutils
sudo ln -s $(readlink -f bin/gohard) /usr/local/bin

Usage

[UNIX] Help message:

gohard -h

[UNIX] Use SSH hardening modules:

sudo -E gohard --service=ssh

[UNIX] Use Kernel hardening modules

sudo -E gohard --service=kernel

[WINDOWS] Use firewall hardening modules

cmd /k gohard.exe --service=firewall

And basically the same way for all the other services.

You can use 'ranges' to execute more than 1 module at the same time:

valid_range

If you enter either wrong start / end index, gohard will exit:

invalid_range

You can also execute all available modules using '-':

all

If any command doesn't finish successfully gohard will throw out an error, but will continue with the execution of all remaining modules:

error

Dockerizing

Build the tag first:

docker build -t gohard .

Running any hardening service:

sudo -E docker run --rm -it gohard --service=kernel

About

🛡️ Decrease the attack surface of your system.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published