HexaCluster / pgdsat

PostgreSQL Database Security Assessment Tool
https://hexacluster.ai/
GNU General Public License v3.0
219 stars 10 forks source link

Add support for homebrew installation #12

Open remyleone opened 1 month ago

remyleone commented 1 month ago

It would be helpful to have macos support for pgdstat because I connect to several databases remotely from my mac and I would like to assess whether they are secure or not. Could you have a port on macos and an installation with the homebrew package manager?

darold commented 1 month ago

This is Perl software so it should works asis on MacOs provide that you have a Perl interpreter installed. The program uses the psql command so PostgreSQL client must be present too.

If you have any pgdsat execution issue on MacOs please report here.

remyleone commented 1 month ago

Does not work on macos because systemctl is not present:

$ perl Makefile.PL 
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for pgdsat
Writing MYMETA.yml and MYMETA.json
$ make
cp lib/PGDSAT.pm blib/lib/PGDSAT.pm
cp lib/PGDSAT/Labels.pm blib/lib/PGDSAT/Labels.pm
cp lib/PGDSAT/Messages.pm blib/lib/PGDSAT/Messages.pm
cp lib/PGDSAT/Report.pm blib/lib/PGDSAT/Report.pm
cp lib/PGDSAT/Netmask.pm blib/lib/PGDSAT/Netmask.pm
cp pgdsat blib/script/pgdsat
"/opt/homebrew/Cellar/perl/5.38.2_1/bin/perl" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/pgdsat
Manifying 1 pod document
$ sudo make install
Password:
Manifying 1 pod document
Installing /opt/homebrew/Cellar/perl/5.38.2_1/lib/perl5/site_perl/5.38/PGDSAT.pm
Installing /opt/homebrew/Cellar/perl/5.38.2_1/lib/perl5/site_perl/5.38/PGDSAT/Labels.pm
Installing /opt/homebrew/Cellar/perl/5.38.2_1/lib/perl5/site_perl/5.38/PGDSAT/Netmask.pm
Installing /opt/homebrew/Cellar/perl/5.38.2_1/lib/perl5/site_perl/5.38/PGDSAT/Messages.pm
Installing /opt/homebrew/Cellar/perl/5.38.2_1/lib/perl5/site_perl/5.38/PGDSAT/Report.pm
Installing /opt/homebrew/Cellar/perl/5.38.2_1/share/man/man1/pgdsat.1p
Installing /opt/homebrew/Cellar/perl/5.38.2_1/bin/pgdsat
Appending installation info to /opt/homebrew/Cellar/perl/5.38.2_1/lib/perl5/5.38/darwin-thread-multi-2level/perllocal.pod
$ /opt/homebrew/Cellar/perl/5.38.2_1/bin/pgdsat
FATAL: command systemctl is not available from environment variable $PATH
remyleone commented 1 month ago

In addition the whole point of homebrew would be to avoid doing those manual steps: https://docs.brew.sh/Gems,-Eggs-and-Perl-Modules