Author Topic: HowTo: add ids/ips module to zentyal 4.1, 4.2  (Read 5533 times)

julio

  • Guest
HowTo: add ids/ips module to zentyal 4.1, 4.2
« on: July 01, 2015, 07:30:28 pm »
open a terminal window and "copy & paste" the following commands:

zentyal 4.1:
Code: [Select]
sudo apt-get install zbuildtools build-essential fakeroot dpkg-dev -y
cd ~/Downloads
wget http://archive.zentyal.org/zentyal/pool/main/z/zentyal-ips/zentyal-ips_3.5.1.tar.gz
tar -xf zentyal-ips_3.5.1.tar.gz
mv zentyal-ips-3.5.1 zentyal-ips-4.1
sed -i '1 i\zentyal-ips (4.1) trusty; urgency=medium\n\n  * New release\n\n -- xy <xy@xy.com>  Mon, 29 Jun 2015 00:00:00 +0100\n' ./zentyal-ips-4.1/debian/changelog
sed -i '1 i\4.1\n        + Adapted to 4.1' ./zentyal-ips-4.1/ChangeLog
sed -i 's#Depends: zentyal-core (>= 3.5), zentyal-core (<< 4.0~1), zentyal-firewall,#Depends: zentyal-core (>= 4.1), zentyal-core (<< 4.2), zentyal-firewall,#g' ./zentyal-ips-4.1/debian/control
wget 'https://docs.google.com/uc?export=download&id=0B4_d-7xL0AS_Q0ZPWlAwN3dmWHc' -O ips-stubs_4.1.diff
patch -t -p1 -i ips-stubs_4.1.diff
cd ./zentyal-ips-4.1
dpkg-buildpackage -rfakeroot -b
cd ..
sudo dpkg -i zentyal-ips_4.1_all.deb
sudo apt-get install -f -y
sudo sed -i 's\next if ($pkg->{name} eq '"'"'zentyal-ids'"'"');\#next if ($pkg->{name} eq '"'"'zentyal-ids'"'"');\g' /usr/share/zentyal/templates/software/ebox.mas
sudo service zentyal webadmin restart

zentyal 4.2:
Code: [Select]
sudo apt-get install zbuildtools build-essential fakeroot dpkg-dev -y
cd ~/Downloads
wget http://archive.zentyal.org/zentyal/pool/main/z/zentyal-ips/zentyal-ips_3.5.1.tar.gz
tar -xf zentyal-ips_3.5.1.tar.gz
mv zentyal-ips-3.5.1 zentyal-ips-4.2
sed -i '1 i\zentyal-ips (4.2) trusty; urgency=medium\n\n  * New release\n\n -- xy <xy@xy.com>  Mon, 29 Jun 2015 00:00:00 +0100\n' ./zentyal-ips-4.2/debian/changelog
sed -i '1 i\4.2\n        + Adapted to 4.2' ./zentyal-ips-4.2/ChangeLog
sed -i 's#Depends: zentyal-core (>= 3.5), zentyal-core (<< 4.0~1), zentyal-firewall,#Depends: zentyal-core (>= 4.2), zentyal-core (<< 4.3), zentyal-firewall,#g' ./zentyal-ips-4.2/debian/control
wget 'https://docs.google.com/uc?export=download&id=0B4_d-7xL0AS_aXJqYUd0R21hOG8' -O ips-stubs_4.2.diff
patch -t -p1 -i ips-stubs_4.2.diff
cd ./zentyal-ips-4.2
dpkg-buildpackage -rfakeroot -b
cd ..
sudo dpkg -i zentyal-ips_4.2_all.deb
sudo apt-get install -f -y
sudo sed -i 's\next if ($pkg->{name} eq '"'"'zentyal-ids'"'"');\#next if ($pkg->{name} eq '"'"'zentyal-ids'"'"');\g' /usr/share/zentyal/templates/software/ebox.mas
sudo service zentyal webadmin restart
« Last Edit: April 12, 2016, 08:43:51 pm by julio »

gabor.strama

  • Zen Monk
  • **
  • Posts: 53
  • Karma: +5/-0
    • View Profile
Re: HowTo: add ids/ips module to zentyal 4.1
« Reply #1 on: April 12, 2016, 06:06:12 pm »
Hello!

Great work!
But I have one question:
This install method is work with zentyal 4.2.2?

gabor.strama

  • Zen Monk
  • **
  • Posts: 53
  • Karma: +5/-0
    • View Profile
Re: HowTo: add ids/ips module to zentyal 4.1
« Reply #2 on: April 12, 2016, 07:42:46 pm »
Hello!

I made some modification, but if i try to made some admin modification i will got this error:


Error trace

Can't locate object method "securityUpdatesAddOn" via package "EBox::RemoteServices" at /usr/share/perl5/EBox/IPS/Composite/General.pm line 50.

Stack:
  [/usr/share/perl5/EBox/IPS/Composite/General.pm:50]
  [<anonymous component>:147]
  [<anonymous component>:34]
 at /usr/share/perl5/EBox/CGI/Base.pm line 364

    in EBox::CGI::Base::run at /usr/share/perl5/EBox/CGI/Base.pm line 364

      361:         my ($protocol, $port);
      362:         my $url;
      363:         my $host = $request->env->{HTTP_HOST};
      364:         if ($referer) {
      365:             my $parsedURL = new URI($referer);
      366:             $protocol = $parsedURL->scheme();
      367:             $port = $parsedURL->port();

    Show function arguments
    in (eval) at /usr/share/perl5/EBox/CGI/Run.pm line 92

       89:                 $handler = new $classname(@extraParams);
       90:             }
       91:         }
       92:         $handler->run();
       93:         $redis->commit();
       94:         return $handler->response()->finalize();
       95:     } catch ($ex) {

    in EBox::CGI::Run::run at /usr/share/perl5/EBox/CGI/Run.pm line 68

       65:     $redis->begin();
       66:
       67:     my $url = $self->urlFromRequest($request);
       68:     try {
       69:         my $effectiveUrl = _urlAlias($url);
       70:         my @extraParams = (request => $request);
       71:         if ($htmlblocks) {

    Show function arguments
    in main::__ANON__ at /usr/share/zentyal/psgi/zentyal.psgi line 46

       43:     local $SIG{__WARN__} = sub { EBox::warn($_[0]) };
       44:
       45:     my $req = Plack::Request->new($env);
       46:     return EBox::CGI::Run->run($req);
       47: };
       48:
       49: my $builder = new Plack::Builder();

    Show function arguments
    in Plack::App::URLMap::call at /usr/share/perl5/Plack/App/URLMap.pm line 71

       68:         return $self->response_cb($app->($env), sub {
       69:             $env->{PATH_INFO} = $orig_path_info;
       70:             $env->{SCRIPT_NAME} = $orig_script_name;
       71:         });
       72:     }
       73:
       74:     DEBUG && warn "All matching failed.\n";

    Show function arguments
    in Plack::Component::__ANON__ at /usr/share/perl5/Plack/Component.pm line 50

       47: sub to_app {
       48:     my $self = shift;
       49:     $self->prepare_app;
       50:     return sub { $self->call(@_) };
       51: }
       52:
       53:

    Show function arguments
    in EBox::Middleware::Auth::call at /usr/share/perl5/EBox/Middleware/Auth.pm line 366

      363:         $self->_logout($env);
      364:     } elsif ($self->_validateSession($env)) {
      365:         delete $env->{'psgix.session'}{AuthReason};
      366:         return $self->app->($env);
      367:     } else {
      368:         # Require authentication, redirect to the login form.
      369:         return $self->_redirectToLogin($env);

    Show function arguments
    in Plack::Component::__ANON__ at /usr/share/perl5/Plack/Component.pm line 50

       47: sub to_app {
       48:     my $self = shift;
       49:     $self->prepare_app;
       50:     return sub { $self->call(@_) };
       51: }
       52:
       53:

    Show function arguments
    in Plack::Middleware::Conditional::call at /usr/share/perl5/Plack/Middleware/Conditional.pm line 16

       13:     my($self, $env) = @_;
       14:
       15:     my $app = $self->condition->($env) ? $self->middleware : $self->app;
       16:     return $app->($env);
       17: }
       18:
       19: 1;

    Show function arguments
    in Plack::Component::__ANON__ at /usr/share/perl5/Plack/Component.pm line 50

       47: sub to_app {
       48:     my $self = shift;
       49:     $self->prepare_app;
       50:     return sub { $self->call(@_) };
       51: }
       52:
       53:

    Show function arguments
    in EBox::WebAdmin::Middleware::SubAppAuth::call at /usr/share/perl5/EBox/WebAdmin/Middleware/SubAppAuth.pm line 57

       54:             }
       55:         }
       56:     }
       57:     return $self->app->($env);
       58: }
       59:
       60: 1;

    Show function arguments
    in Plack::Component::__ANON__ at /usr/share/perl5/Plack/Component.pm line 50

       47: sub to_app {
       48:     my $self = shift;
       49:     $self->prepare_app;
       50:     return sub { $self->call(@_) };
       51: }
       52:
       53:

    Show function arguments
    in Plack::Middleware::Session::call at /usr/share/perl5/Plack/Middleware/Session.pm line 52

       49:
       50:     $env->{'psgix.session.options'} = { id => $id };
       51:
       52:     my $res = $self->app->($env);
       53:     $self->response_cb($res, sub { $self->finalize($env, $_[0]) });
       54: }
       55:

    Show function arguments
    in Plack::Component::__ANON__ at /usr/share/perl5/Plack/Component.pm line 50

       47: sub to_app {
       48:     my $self = shift;
       49:     $self->prepare_app;
       50:     return sub { $self->call(@_) };
       51: }
       52:
       53:

    Show function arguments
    in Plack::Middleware::ReverseProxy::call at /usr/share/perl5/Plack/Middleware/ReverseProxy.pm line 68

       65:         }
       66:     }
       67:
       68:     $self->app->($env);
       69: }
       70:
       71: 1;

    Show function arguments
    in Plack::Component::__ANON__ at /usr/share/perl5/Plack/Component.pm line 50

       47: sub to_app {
       48:     my $self = shift;
       49:     $self->prepare_app;
       50:     return sub { $self->call(@_) };
       51: }
       52:
       53:

    Show function arguments
    in (eval) at /usr/share/perl5/EBox/Middleware/UnhandledError.pm line 78

       75:     my $res;
       76:     my $caught = 0;
       77:     try {
       78:         $res = $self->app->($env);
       79:     } catch ($e) {
       80:         $caught = 1;
       81:         # This $res will only be used if $trace is undef

    in EBox::Middleware::UnhandledError::call at /usr/share/perl5/EBox/Middleware/UnhandledError.pm line 77

       74:
       75:     my $res;
       76:     my $caught = 0;
       77:     try {
       78:         $res = $self->app->($env);
       79:     } catch ($e) {
       80:         $caught = 1;

    Show function arguments
    in Plack::Component::__ANON__ at /usr/share/perl5/Plack/Component.pm line 50

       47: sub to_app {
       48:     my $self = shift;
       49:     $self->prepare_app;
       50:     return sub { $self->call(@_) };
       51: }
       52:
       53:

    Show function arguments
    in (eval) at /usr/share/zentyal/psgi/zentyal.psgi line 0

        1: # Copyright (C) 2010-2014 Zentyal S.L.
        2: #
        3: # This program is free software; you can redistribute it and/or modify

    at /usr/share/zentyal/psgi/zentyal.psgi line 0

        1: # Copyright (C) 2010-2014 Zentyal S.L.
        2: #
        3: # This program is free software; you can redistribute it and/or modify

I use this script:

sudo apt-get install zbuildtools build-essential fakeroot dpkg-dev -y
cd ~/Downloads
wget http://archive.zentyal.org/zentyal/pool/main/z/zentyal-ips/zentyal-ips_3.5.1.tar.gz
tar -xf zentyal-ips_3.5.1.tar.gz
mv zentyal-ips-3.5.1 zentyal-ips-4.2.2
sed -i '1 i\zentyal-ips (4.2.2) trusty; urgency=medium\n\n  * New release\n\n -- xy <xy@xy.com>  Mon, 29 Jun 2015 00:00:00 +0100\n' ./zentyal-ips-4.2.2/debian/changelog
sed -i '1 i\4.2.2\n        + Adapted to 4.2.2' ./zentyal-ips-4.2.2/ChangeLog
sed -i 's#Depends: zentyal-core (>= 3.5), zentyal-core (<< 4.0~1), zentyal-firewall,#Depends: zentyal-core (>= 4.2.2), zentyal-firewall,#g' ./zentyal-ips-4.2.2/debian/control
wget 'https://docs.google.com/uc?export=download&id=0B4_d-7xL0AS_a0E4eXIwZnpmU00' -O ips-stubs.diff
patch -t -p1 -i ips-stubs.diff
cd ./zentyal-ips-4.2.2
dpkg-buildpackage -rfakeroot -b
cd ..
sudo dpkg -i zentyal-ips_4.2.2_all.deb
sudo apt-get install -f -y
sudo sed -i 's\next if ($pkg->{name} eq '"'"'zentyal-ids'"'"');\#next if ($pkg->{name} eq '"'"'zentyal-ids'"'"');\g' /usr/share/zentyal/templates/software/ebox.mas
sudo service zentyal webadmin restart

I hope this some row is help for you....


julio

  • Guest
Re: HowTo: add ids/ips module to zentyal 4.1, 4.2
« Reply #3 on: April 12, 2016, 08:40:14 pm »
hi gabor.strama,

please purge your old ips module installation with:
Code: [Select]
sudo apt-get purge --auto-remove zentyal-ips
delete your old sources:
Code: [Select]
rm ~/Downloads/zentyal-ips_3.5.1.tar.gz
rm -rf ~/Downloads/zentyal-ips-4.2.2
rm ~/Downloads/ips-stubs.diff
rm ~/Downloads/zentyal-ips_4.2.2_all.deb
rm ~/Downloads/zentyal-ips_4.2.2_amd64.changes

and try one more time with the new instructions.
« Last Edit: April 12, 2016, 08:42:54 pm by julio »

gabor.strama

  • Zen Monk
  • **
  • Posts: 53
  • Karma: +5/-0
    • View Profile
Re: HowTo: add ids/ips module to zentyal 4.1, 4.2
« Reply #4 on: April 14, 2016, 03:18:21 pm »
Than's a lot!

It is work for me....

Great JOB!

Have a nice day!

gabor.strama

  • Zen Monk
  • **
  • Posts: 53
  • Karma: +5/-0
    • View Profile
Re: HowTo: add ids/ips module to zentyal 4.1, 4.2
« Reply #5 on: April 15, 2016, 09:42:38 am »
Hello Julio!

Have you seen any chance to make a solution how can we use again pppoe in zentyal?

Sorry about the offtopic question, i want to send in personal message but the system don't left it....

redhair7

  • Zen Apprentice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: HowTo: add ids/ips module to zentyal 4.1, 4.2
« Reply #6 on: October 18, 2016, 03:41:35 pm »
Hi Julio.

Link to ips-stubs.diff is down.

Can u fix it. please.

julio

  • Guest
Re: HowTo: add ids/ips module to zentyal 4.1, 4.2
« Reply #7 on: October 18, 2016, 07:04:10 pm »
Please check one more time, booth diffs is online...

jclendineng

  • Guest
Re: HowTo: add ids/ips module to zentyal 4.1, 4.2
« Reply #8 on: October 19, 2016, 10:39:17 pm »
Installed without a hitch...thanks man!!

jclendineng

  • Guest
Re: HowTo: add ids/ips module to zentyal 4.1, 4.2
« Reply #9 on: December 24, 2016, 03:05:21 am »
I edited the code to work on 5.0 but i must have missed something, or its just not compatible.  Has anyone configured snort in ubuntu? Never done it but it looks pretty straightforward.