Bug 208935 - security/ossec-hids-server -- fixes for MYSQL, PGSQL options, update to latest, etc
Summary: security/ossec-hids-server -- fixes for MYSQL, PGSQL options, update to lates...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Matthew Seaman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-20 13:58 UTC by Matthew Seaman
Modified: 2016-04-21 19:38 UTC (History)
0 users

See Also:
matthew: maintainer-feedback+


Attachments
Updates to security/ossec-hids-server port (10.71 KB, patch)
2016-04-20 13:58 UTC, Matthew Seaman
no flags Details | Diff
Updates to security/ossec-hids-server port (10.86 KB, patch)
2016-04-20 15:53 UTC, Matthew Seaman
no flags Details | Diff
Updates to security/ossec-hids-server port (11.48 KB, patch)
2016-04-21 14:44 UTC, Matthew Seaman
no flags Details | Diff
Updates to security/ossec-hids-server port (12.38 KB, patch)
2016-04-21 15:12 UTC, Matthew Seaman
no flags Details | Diff
Updates to security/ossec-hids-server port (13.67 KB, patch)
2016-04-21 16:30 UTC, Matthew Seaman
matthew: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Seaman freebsd_committer freebsd_triage 2016-04-20 13:58:33 UTC
Created attachment 169492 [details]
Updates to security/ossec-hids-server port

* Modernize OPTIONS handling somewhat: this fixes compilation when either
    the MYSQL or PGSQL options are enabled

  * Add OPTION-dependent targets to install the postgresql or mysql DB schemas
    as portdocs when either of those two options are enabled.

  * Add a patch for the DB schemas to allow for longer entries in the 
    system.information column (submitted upstream and committed as 
    https://github.com/ossec/ossec-hids/commit/7a4b0d32e2b67bbef5d68dd7aeeee4e70b9c1982

  * Add a 'reload' command to the ossec-hids RC script

  * Update to version 2.8.3

  * Generally update patch files via 'make makepatch'

DB changes compile tested with postgresql and mysql, but only thoroughly run-time tested with postgresql.  Passes poudriere testport for i386 and amd64 on 9.3, 10.1 and 10.2-RELEASE.
Comment 1 Matthew Seaman freebsd_committer freebsd_triage 2016-04-20 15:53:08 UTC
Created attachment 169496 [details]
Updates to security/ossec-hids-server port

Now with working modifications to the rc script...
Comment 2 Brad Davis freebsd_committer freebsd_triage 2016-04-21 01:17:29 UTC
Looks good to me.

Would you like to take maintainer?  I changed jobs and do not use OSSEC anymore and I would rather someone that uses it be the maintainer.
Comment 3 Matthew Seaman freebsd_committer freebsd_triage 2016-04-21 09:08:08 UTC
I'm just evaluating it at the moment, but I'm not particularly enamored of what I'm seeing.  So I'd prefer not to take maintainership. Thank you for the offer though.

If you approve, I'll happily commit the fixes I've developed so far, and I think I'll possibly have a few more changes to do with agentless monitoring.
Comment 4 Matthew Seaman freebsd_committer freebsd_triage 2016-04-21 14:44:54 UTC
Created attachment 169525 [details]
Updates to security/ossec-hids-server port

The expect scripts in ${LOCALBASE}ossec-hids/agentless need to be executable by the ossec user.  Change group ownership to ossec to permit this.
Comment 5 Matthew Seaman freebsd_committer freebsd_triage 2016-04-21 15:12:39 UTC
Created attachment 169526 [details]
Updates to security/ossec-hids-server port

Don't install the log files as part of the package.  This will trash any existing log files on upgrade or reinstall.  Instead, ensure that the log files have been created with the correct ownership and permissions as a start precmd in the rc script.
Comment 6 Brad Davis freebsd_committer freebsd_triage 2016-04-21 16:04:56 UTC
Yes, you have my approval.
Comment 7 Matthew Seaman freebsd_committer freebsd_triage 2016-04-21 16:30:43 UTC
Created attachment 169529 [details]
Updates to security/ossec-hids-server port

When the ossec-hids service is started at boot, the path does not include /usr/local/bin.  This means that expect scripts used for agentless monitoring give 'command not found' with a shebang line of '#!/usr/bin/env expect'

Use shebangfix to set an explicit path '#!/usr/local/bin/expect'
Comment 8 Matthew Seaman freebsd_committer freebsd_triage 2016-04-21 16:34:12 UTC
Thanks.  I'll grab this ticket and commit the updates tonight.
Comment 9 commit-hook freebsd_committer freebsd_triage 2016-04-21 19:37:58 UTC
A commit references this bug:

Author: matthew
Date: Thu Apr 21 19:37:13 UTC 2016
New revision: 413754
URL: https://svnweb.freebsd.org/changeset/ports/413754

Log:
  * Modernize OPTIONS handling somewhat: this fixes compilation when
    either the MYSQL or PGSQL options are enabled

  * Add OPTION-dependent targets to install the postgresql or mysql DB
    schemas as portdocs when either of those two options are enabled.

  * Add a patch for the DB schemas to allow for longer entries in the
    system.information column (submitted upstream and committed as
    https://github.com/ossec/ossec-hids/commit/7a4b0d32e2b67bbef5d68dd7aeeee4e70b9c1982

  * Add a 'reload' command to the ossec-hids RC script

  * Update to version 2.8.3

  * Generally update patch files via 'make makepatch'

  * Change expect scripts used by agentlessd to group ossec so they are
    executable by the ossec user.

  * Use shebangfix to set an explicit path to where expect is installed,
    since it isn't on the default path inherited from the system init
    scripts, so /usr/bin/env doesn't find the command interpreter.

  * Change CONFLICTS to CONFLICTS_INSTALL between each of the the
    ossec-hids-{client,local,server} ports.

  DB changes compile tested with postgresql and mysql, but only
  thoroughly run-time tested with postgresql.

  PR:		208935
  Submitted by:	matthew
  Approved by:	brd (maintainer)

Changes:
  head/security/ossec-hids-server/Makefile
  head/security/ossec-hids-server/distinfo
  head/security/ossec-hids-server/files/ossec-hids.in
  head/security/ossec-hids-server/files/patch-src__InstallAgent.sh
  head/security/ossec-hids-server/files/patch-src__InstallServer.sh
  head/security/ossec-hids-server/files/patch-src__LOCATION
  head/security/ossec-hids-server/files/patch-src__headers__defs.h
  head/security/ossec-hids-server/files/patch-src_os__dbd_mysql.schema
  head/security/ossec-hids-server/files/patch-src_os__dbd_postgresql.schema
  head/security/ossec-hids-server/pkg-plist
Comment 10 Matthew Seaman freebsd_committer freebsd_triage 2016-04-21 19:38:27 UTC
Committed, thanks!