Skip to content
This repository has been archived by the owner on Apr 19, 2021. It is now read-only.

Commit

Permalink
issues 944 937 943
Browse files Browse the repository at this point in the history
  • Loading branch information
dougburks committed Jul 4, 2016
1 parent 27ed77f commit 4f66917
Show file tree
Hide file tree
Showing 5 changed files with 189 additions and 8 deletions.
6 changes: 6 additions & 0 deletions debian/changelog
@@ -1,3 +1,9 @@
securityonion-nsmnow-admin-scripts (20120724-0ubuntu0securityonion135) trusty; urgency=medium

* issues 944 937 943

-- Doug Burks <doug.burks@gmail.com> Mon, 04 Jul 2016 11:36:19 -0400

securityonion-nsmnow-admin-scripts (20120724-0ubuntu0securityonion134) trusty; urgency=medium

* nsm_sensor_backup-data missing leading slash in directory #931
Expand Down
117 changes: 117 additions & 0 deletions debian/patches/issues-944-937-943
@@ -0,0 +1,117 @@
Description: <short summary of the patch>
TODO: Put a short summary on the line above and replace this paragraph
with a longer explanation of this change. Complete the meta-information
with other relevant fields (see below for details). To make it easier, the
information below has been extracted from the changelog. Adjust it or drop
it.
.
securityonion-nsmnow-admin-scripts (20120724-0ubuntu0securityonion135) trusty; urgency=medium
.
* issues 944 937 943
Author: Doug Burks <doug.burks@gmail.com>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- securityonion-nsmnow-admin-scripts-20120724.orig/usr/sbin/nsm_sensor_backup-config
+++ securityonion-nsmnow-admin-scripts-20120724/usr/sbin/nsm_sensor_backup-config
@@ -165,9 +165,12 @@ then
BACKUP_FILE=$PROMPT_RET
fi

-# prompt to backup the configuration
+# prompt to backup the configuration, ignore if --force-yes is used
prompt_user_yesno "Backup Sensor Configuration" "All configurations for sensor \"$SENSOR_NAME\" will be backed up to:\n$BACKUP_FILE\n\nDo you want to continue?" "N"
-[ "$?" -ne 0 ] && exit 1
+if [ $FORCE_YES == "yes" ]
+then
+ PROMPT_RET=Y
+fi
if [ "$PROMPT_RET" != "Y" -a "$PROMPT_RET" != "y" ]
then
exit 1
--- securityonion-nsmnow-admin-scripts-20120724.orig/usr/sbin/nsm_server_backup-config
+++ securityonion-nsmnow-admin-scripts-20120724/usr/sbin/nsm_server_backup-config
@@ -162,8 +162,13 @@ then
BACKUP_FILE=$PROMPT_RET
fi

-# prompt to backup the configuration
+# prompt to backup the configuration, ignore if --force-yes is used
prompt_user_yesno "Backup Server Configuration" "All configurations for server \"$SERVER_NAME\" will be backed up to:\n$BACKUP_FILE\n\nDo you want to continue?" "N"
+Do you want to continue?" "N"
+if [ $FORCE_YES == "yes" ]
+then
+ PROMPT_RET=Y
+fi
[ "$?" -ne 0 ] && exit 1
if [ "$PROMPT_RET" != "Y" -a "$PROMPT_RET" != "y" ]
then
--- /dev/null
+++ securityonion-nsmnow-admin-scripts-20120724/usr/sbin/nsm_server_user-list
@@ -0,0 +1,55 @@
+#!/bin/bash
+#
+# Copyright (C) 2008-2009 SecurixLive <dev@securixlive.com>
+# Modified by Doug Burks for Security Onion
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License Version 2 as
+# published by the Free Software Foundation. You may not use, modify or
+# distribute this program under any other version of the GNU General
+# Public License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+#
+# INCLUDES
+#
+INC="/etc/nsm/administration.conf"
+. $INC
+
+. $NSM_LIB_DIR/lib-console-utils
+. $NSM_LIB_DIR/lib-nsm-common-utils
+. $NSM_LIB_DIR/lib-nsm-server-utils
+
+# ensure we are root user before continuing any further
+is_root
+if [ "${?}" -ne 0 ]
+then
+ echo_error_msg 0 "OOPS: Must be root to run this script!"
+ exit 1;
+fi
+
+SERVER_NAME="securityonion"
+
+# check that the server DOES exist via its config
+if [ ! -f "/etc/nsm/${SERVER_NAME}/server.conf" ]
+then
+ echo_error_msg 0 "OOPS: The server \"${SERVER_NAME}\" does not exist!"
+ exit 1
+else
+ # load existing variables for the server
+ . /etc/nsm/${SERVER_NAME}/server.conf
+fi
+
+mysql --defaults-file=/etc/mysql/debian.cnf -Dsecurityonion_db -e 'select uid,username,email,last_login,tzoffset from user_info where username != "auto";'
+
+exit 0
+
1 change: 1 addition & 0 deletions debian/patches/series
Expand Up @@ -128,3 +128,4 @@ Issue-#859:-NSM:-mkdir--p-varrunnsm-before-trying-to-chown
NSM:-Squert-object_mappings-table-has-wrong-permissions-#866
Issue-924:-NSM:-set-DEBUG-1-in-etcsguildsguild.conf
nsm_sensor_backup-data-missing-leading-slash-in-directory-#931
issues-944-937-943
18 changes: 10 additions & 8 deletions debian/postinst
Expand Up @@ -29,15 +29,17 @@ case "$1" in
mysql --defaults-file=/etc/mysql/debian.cnf -N -B -e "GRANT INSERT,UPDATE ON securityonion_db.object_mappings TO 'readonly'@'localhost';" || echo "Error updating permissions on Squert object_mappings."
fi

# commenting out the following section because some users rely on sguild debug 2
# example: https://github.com/Security-Onion-Solutions/security-onion/wiki/ThirdPartyIntegration
# change sguild debug to 1
FILE='/etc/sguild/sguild.conf'
if [ -f $FILE ]; then
if grep "set DEBUG 2" $FILE >/dev/null 2>&1; then
echo "Sguild DEBUG is currently set to 2."
echo "Setting sguild DEBUG to 1."
sed -i 's|set DEBUG 2|set DEBUG 1|g' $FILE || echo "Error updating $FILE"
fi
fi
#FILE='/etc/sguild/sguild.conf'
#if [ -f $FILE ]; then
# if grep "set DEBUG 2" $FILE >/dev/null 2>&1; then
# echo "Sguild DEBUG is currently set to 2."
# echo "Setting sguild DEBUG to 1."
# sed -i 's|set DEBUG 2|set DEBUG 1|g' $FILE || echo "Error updating $FILE"
# fi
#fi

;;

Expand Down
55 changes: 55 additions & 0 deletions usr/sbin/nsm_server_user-list
@@ -0,0 +1,55 @@
#!/bin/bash
#
# Copyright (C) 2008-2009 SecurixLive <dev@securixlive.com>
# Modified by Doug Burks for Security Onion
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Version 2 as
# published by the Free Software Foundation. You may not use, modify or
# distribute this program under any other version of the GNU General
# Public License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#

#
# INCLUDES
#
INC="/etc/nsm/administration.conf"
. $INC

. $NSM_LIB_DIR/lib-console-utils
. $NSM_LIB_DIR/lib-nsm-common-utils
. $NSM_LIB_DIR/lib-nsm-server-utils

# ensure we are root user before continuing any further
is_root
if [ "${?}" -ne 0 ]
then
echo_error_msg 0 "OOPS: Must be root to run this script!"
exit 1;
fi

SERVER_NAME="securityonion"

# check that the server DOES exist via its config
if [ ! -f "/etc/nsm/${SERVER_NAME}/server.conf" ]
then
echo_error_msg 0 "OOPS: The server \"${SERVER_NAME}\" does not exist!"
exit 1
else
# load existing variables for the server
. /etc/nsm/${SERVER_NAME}/server.conf
fi

mysql --defaults-file=/etc/mysql/debian.cnf -Dsecurityonion_db -e 'select uid,username,email,last_login,tzoffset from user_info where username != "auto";'

exit 0

0 comments on commit 4f66917

Please sign in to comment.