NCSC-NL / taranis3

Taranis
Other
59 stars 17 forks source link

Bootstrap and Postgres problem #24

Closed hattek closed 4 years ago

hattek commented 5 years ago

I've deployed a freshly installed Ubuntu 18.04.2 server on Hyper-V with the latest updates available - only the OpenSSH Server package is installed and nothing more. A sudo account 'taranis' has also been created.

I've installed perl modules, CPAN and running the bootstrap as root (as described in the guide). I've also tried installing everything as sudo account 'taranis' but unfortunately I'm getting the same failure at the end - see below.

sudo su - root

root@irtest01:~# wget http://github.com/NCSC-NL/taranis3/releases/download/v3.6.1/taranis-3.6.1.tar.gz

root@irtest01:~# apt-get install perl-modules

root@irtest01:~# perl -MCPAN -e 'install CPAN'

root@irtest01:~# tar xzf taranis-3.6.1.tar.gz taranis-3.6.1/taranis-bootstrap

root@irtest01:~# mv taranis-3.6.1/taranis-bootstrap .

root@irtest01:~# ./taranis-bootstrap -u 'taranis' -g 'taranis' -m '/opt/taranis' taranis-3.6.1.tar.gz

administrator email: some@email.com taranis vhost name: irtest01 website uses https [yes]: no running test server [yesy]: yes

Do you want to build the XS Stash module? [y] y Do you want to use the XS Stash by default? [y] y

database host: [peer] peer database name: [taranis] taranis database user: [taranis] taranis database password: [taranis] taranis

Import PAUSE and author keys to GnuPG? [y] y

After agreeing to import the author keys to GnuPH I get the following, and the installation is aborted:

Importing... done. Locating bin:gpg... found at /usr/bin/gpg. Checking if your kit is complete... Looks good Generating a Unix-style Makefile Writing Makefile for Module::Signature Writing MYMETA.yml and MYMETA.json AUDREYT/Module-Signature-0.83.tar.gz /usr/bin/perl Makefile.PL INSTALLDIRS=site -- OK Running make for A/AU/AUDREYT/Module-Signature-0.83.tar.gz cp lib/Module/Signature.pm blib/lib/Module/Signature.pm cp script/cpansign blib/script/cpansign "/usr/bin/perl" "-Iinc" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/cpansign Manifying 1 pod document Manifying 1 pod document AUDREYT/Module-Signature-0.83.tar.gz /usr/bin/make -- OK Running make test for AUDREYT/Module-Signature-0.83.tar.gz PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef Test::Harness::Switches; test_harness(0, 'inc', 'blib/lib', 'blib/arch')" t/.t t/0-signature.t .. skipped: Set the environment variable TEST_SIGNATURE to enable this test. t/1-basic.t ...... ok t/2-cygwin.t ..... skipped: Cygwin only tests t/3-verify.t ..... ok All tests successful. Files=4, Tests=8, 19 wallclock secs ( 0.02 usr 0.00 sys + 0.79 cusr 0.15 csys = 0.96 CPU) Result: PASS AUDREYT/Module-Signature-0.83.tar.gz /usr/bin/make test -- OK Running make install for AUDREYT/Module-Signature-0.83.tar.gz Manifying 1 pod document Manifying 1 pod document Installing /home/taranis/lib/perl5/Module/Signature.pm Installing /home/taranis/man/man1/cpansign.1p Installing /home/taranis/man/man3/Module::Signature.3pm Installing /home/taranis/bin/cpansign Appending installation info to /home/taranis/lib/perl5/x86_64-linux-gnu-thread-multi/perllocal.pod AUDREYT/Module-Signature-0.83.tar.gz /usr/bin/make install -- OK *** running /home/taranis/sources/taranis-3.6.1/install/420.postgres-init

Tried to stop and start postgresql: systemctl stop postgresql systemctl start postgresql systemctl status postgresql

The status is active and the version of postgresql is 10.8.

The pg_hba.conf looks like this:

TYPE DB USER CIDR-ADDRESS METHOD OPTIONS

local taranis taranis trust # taranis autoconf local all postgres trust # taranis autoconf host taranis taranis 10.31.11.254 md5 # taranis autoconf host taranis taranis 10.31.8.0/22 md5 # taranis autoconf host taranis taranis 10.31.8.0/24 md5 # taranis autoconf host all all 0.0.0.0/0 reject host all all ::0/0 reject

I've read somewhere that changing local taranis taranis trust ... to... local taranis taranis md5 solves the problem, but after running the bootstrap again the script changes it back to its original state.

Any idea what have gone wrong? I really appreciate any pointers and feedback.

Thanks!

markov2 commented 5 years ago

It may be some configuration option of Postgres which block you from using 'trust', but really I have no idea. I hope you have time to figure that out.

... but after running the bootstrap again the script changes it back to its original state.

Well, you can always disable and patch scripts. taranis-bootstrap will not unpack the sources again. Simply put an 'exit 0' on the top of script /home/taranis/sources/taranis-3.6.1/install/421.postgres-hba

Any idea what have gone wrong? I really appreciate any pointers and feedback.

Distributions have different ways to pre-configure postgres. It's a nightmare for me. -- Regards, MarkOv


   Mark Overmeer MSc                                MARKOV Solutions
   Mark@Overmeer.net                          solutions@overmeer.net

http://Mark.Overmeer.net http://solutions.overmeer.net

pkleinert commented 5 years ago

What I did to install was removing the default route line (I think the PGSQL is missing the netmask which is mandatory in CIDR notation) since it was redundant in my case. host taranis taranis 10.31.11.254 md5 Alternatively, add /32 to it. host taranis taranis 10.31.11.254/32 md5 Also, I disabled the configuration script as described by MarkOv too. Bye, Peter