]> git.ipfire.org Git - thirdparty/suricata-update.git/log
thirdparty/suricata-update.git
6 years agoAdd no-checksum option 194/head
Vagisha Gupta [Mon, 2 Sep 2019 07:54:12 +0000 (13:24 +0530)] 
Add no-checksum option

Added a `--no-checksum` option to the add-source command and an optional
"checksum" in SourceConfiguration class for add-sources and
enabled-sources.
Also, a check is added to skip downloading the checksum URL if the
source is configured  with checksum false.

Redmine issue:
    https://redmine.openinfosecfoundation.org/issues/3100

6 years agoRedo variable and function names reserved for Python
Vagisha Gupta [Mon, 10 Jun 2019 19:33:09 +0000 (01:03 +0530)] 
Redo variable and function names reserved for Python

Changed the conflicting variable name `filter` and function name
`filter()` accordingly which suricata-update uses as it is reserved
for use in Python standard modules.

6 years agoLog a warning if index is old
Vagisha Gupta [Wed, 10 Jul 2019 05:31:01 +0000 (11:01 +0530)] 
Log a warning if index is old

If the index is older than 2 weeks, logged a warning that the
index is old and user needs to update it by running
`suricata-update update-sources`.

6 years agochangelog: add missing tickets
Jason Ish [Wed, 28 Aug 2019 22:18:18 +0000 (16:18 -0600)] 
changelog: add missing tickets

6 years agoAdd a check to apply colour if output stream on tty
Vagisha Gupta [Mon, 5 Aug 2019 09:10:51 +0000 (14:40 +0530)] 
Add a check to apply colour if output stream on tty

6 years agoSeparate log messages to stderr and stdout
Vagisha Gupta [Mon, 5 Aug 2019 09:05:55 +0000 (14:35 +0530)] 
Separate log messages to stderr and stdout

Currently, all the messages in suricata-update are logged to stderr.
Changes are made to split between log messages where regular
output (INFO, DEBUG) goes to stdout whereas ERRORS, WARNINGS and
CRITICAL messages goes to stderr.

6 years agochangelog: fix for issue 2875
Jason Ish [Wed, 28 Aug 2019 21:59:38 +0000 (15:59 -0600)] 
changelog: fix for issue 2875

6 years agoImprove permission warning
Vagisha Gupta [Tue, 28 May 2019 07:20:29 +0000 (12:50 +0530)] 
Improve permission warning

Improve permission warning when Suricata-update runs with the wrong user

When suricata-update runs with a non-root user, it gives an ugly traceback.
To avoid those ugly tracebacks, try except block is put around the operation
that are being performed on the file i.e. shutil.copyfile(src, dest) and
exit cleanly with an error in the log.
Also, to avoid ugly tracebacks for permission of suricata.yaml, try-except
is put around where it is accessed and exit cleanly.

6 years agochangelog: fix for issue 2867
Jason Ish [Wed, 28 Aug 2019 21:42:32 +0000 (15:42 -0600)] 
changelog: fix for issue 2867

6 years agoFix TypeError : Failure with missing rule params
Vrinda Narayan [Thu, 28 Mar 2019 12:02:48 +0000 (17:32 +0530)] 
Fix TypeError : Failure with missing rule params

Bug #2867 : Failure with missing rule params
If sometimes a rule is not parsed correctly and sid or gid are of
NoneType the program shows a TypeError. While parsing the rule, the sid
can be checked to make sure that sid is not of type None, and if it is,
raise a BadSidError and log it, the rule is not added to the list of
final rules.

6 years agochangelog: pull in changelog for 1.0.4 and 1.0.5
Jason Ish [Wed, 28 Aug 2019 21:35:30 +0000 (15:35 -0600)] 
changelog: pull in changelog for 1.0.4 and 1.0.5

6 years agoCatch Keyboard Interrupt and exit cleanly.
Vrinda Narayan [Wed, 13 Mar 2019 09:53:43 +0000 (15:23 +0530)] 
Catch Keyboard Interrupt and exit cleanly.

Optimization #2878 https://redmine.openinfosecfoundation.org/issues/2878
Can be done by importing python library signal, and defining a function
signal_handler which will print a message if keyboard interrupt is
detected and exit the program.

6 years agoAdd "offline" command
Vagisha Gupta [Thu, 20 Jun 2019 18:09:06 +0000 (23:39 +0530)] 
Add "offline" command

Add a command line option `--offline` that uses locally cached
latest version of rules without trying to download rules from
sources.

6 years agoLog a warning on duplicate SID
Vagisha Gupta [Mon, 3 Jun 2019 08:53:24 +0000 (14:23 +0530)] 
Log a warning on duplicate SID

Currently when suricata-update encounters a rule with duplicate SIDs,
it silently uses the one with the higher revision without logging the
warnings.
On duplicate SID, warnings are logged for equal as well as different
revisions.

6 years agoParse rule files alphabetically
Vidushi Agrawal [Sun, 5 May 2019 18:33:34 +0000 (00:03 +0530)] 
Parse rule files alphabetically

Sort the file names before parsing them.
Example:
Currently,
```
suricata-update -v
```
generates
```
24/3/2019 -- 10:38:16 - <Debug> -- Parsing rules/emerging-chat.rules.
24/3/2019 -- 10:38:16 - <Debug> -- Parsing sslblacklist.rules.
24/3/2019 -- 10:38:16 - <Debug> -- Parsing rules/emerging-web_client.rules.
24/3/2019 -- 10:38:16 - <Debug> -- Parsing rules/botcc.portgrouped.rules.
24/3/2019 -- 10:38:16 - <Debug> -- Parsing rules/emerging-smtp.rules.
```
i.e., the rule files are not parsed in alphabetical order.

Thus, changing the parser to load these files in alphabetical order by sorting the filenames before starting to work on them fixes the issue. Now the output generated on running
```
suricata-update -v
```
is
```
24/3/2019 -- 10:34:24 - <Debug> -- Parsing rules/botcc.rules.
24/3/2019 -- 10:34:24 - <Debug> -- Parsing rules/ciarmy.rules.
24/3/2019 -- 10:34:24 - <Debug> -- Parsing rules/compromised.rules.
24/3/2019 -- 10:34:24 - <Debug> -- Parsing rules/drop.rules.
24/3/2019 -- 10:34:24 - <Debug> -- Parsing rules/dshield.rules.
24/3/2019 -- 10:34:24 - <Debug> -- Parsing rules/emerging-activex.rules.
```
Rules files are now parsed in sorted order.

Closes Redmine ticket #2892

6 years agoadd test cases for flowbit dependencies and noalert option 149/head
Konstantin Klinger [Fri, 10 May 2019 04:39:16 +0000 (06:39 +0200)] 
add test cases for flowbit dependencies and noalert option

6 years agorule: recognise more noalert cases
Konstantin Klinger [Fri, 10 May 2019 04:22:26 +0000 (06:22 +0200)] 
rule: recognise more noalert cases

This commit ensures that rules only tagged with "noalert;" option
and not only with "flowbits:noalert;" will get the rule.noalert
value set to true.

6 years agomake sure that noalert is set in newly enabled rules
Konstantin Klinger [Fri, 10 May 2019 04:20:39 +0000 (06:20 +0200)] 
make sure that noalert is set in newly enabled rules

This commit adds functionality that ensures that previously
disabled rules enabled by flowbit dependencies will receive
the noalert option.

6 years agotests: update test index to latest index 145/head
Jason Ish [Fri, 26 Apr 2019 21:10:46 +0000 (15:10 -0600)] 
tests: update test index to latest index

6 years agodoc: update default index url
Jason Ish [Wed, 24 Apr 2019 05:04:53 +0000 (23:04 -0600)] 
doc: update default index url

From jasonish repo to
  https://www.openinfosecfoundation.org/rules/index.yaml

6 years agoindex: update embedded intel index
Jason Ish [Wed, 24 Apr 2019 05:03:28 +0000 (23:03 -0600)] 
index: update embedded intel index

6 years agoindex update: use oisf index, not jasonish
Jason Ish [Wed, 24 Apr 2019 05:03:07 +0000 (23:03 -0600)] 
index update: use oisf index, not jasonish

6 years agoaddress code comments
Sascha Steinbiss [Sat, 19 Jan 2019 23:10:19 +0000 (00:10 +0100)] 
address code comments

6 years agoadd documentation paragraph about updating
Sascha Steinbiss [Sat, 22 Dec 2018 16:44:16 +0000 (17:44 +0100)] 
add documentation paragraph about updating

6 years agoprint info log message on changed source parameter
Sascha Steinbiss [Sat, 22 Dec 2018 16:06:33 +0000 (17:06 +0100)] 
print info log message on changed source parameter

6 years agodo not fail on repeated enabling/disabling of sources
Sascha Steinbiss [Wed, 5 Dec 2018 13:01:04 +0000 (14:01 +0100)] 
do not fail on repeated enabling/disabling of sources

6 years agoFix default for the --ignore flag 132/head
Vidushi Agrawal [Fri, 15 Mar 2019 21:56:04 +0000 (03:26 +0530)] 
Fix default for the --ignore flag

suricata-update doesn't properly load some sections in update.yaml file.
Example:
Even after setting the following in update.yaml
```
ignore:
  - "*deleted.rules"
  - "*pop3.rules"
```

```
$ ./bin/suricata-update -v
```
generates
```
16/3/2019 -- 03:14:59 - <Debug> -- Parsing rules/emerging-pop3.rules.
16/3/2019 -- 03:15:01 - <Debug> -- Parsing rules/emerging-deleted.rules.
```
which means the files do not get ignored. It seems that the code loading command line parameters override previous settings even when no parameters are given.
Thus changing the default for the --ignore flag from "[]" to "None", fixes the issue.

Closes Redmine ticket #2851.

6 years agoFix Failure with --no-merge
Vagisha Gupta [Wed, 13 Mar 2019 14:57:20 +0000 (20:27 +0530)] 
Fix Failure with --no-merge

UnboundLocalError: local variable 'rule' referenced before assignment

'suricata-update --no-merge' runs into an error.
'rule.id' is changed to 'key' variable to fix this issue because 'rule' is
not used in the loop. Appended 'key' to the added list i.e. List of rule IDs
that have been added.

6 years agoAdd timeout of 30 sec for all GET requests
Shivani Bhardwaj [Tue, 22 Jan 2019 15:49:37 +0000 (21:19 +0530)] 
Add timeout of 30 sec for all GET requests

suricata-update has been reported to get hung in case the download fails
for a particular source. Add a timeout parameter to urllib to avoid that
and continue further processing after a timeout of 30 seconds.

Closes redmine ticket #2703.

6 years agoFix null pointer dereference issue detected by coverity
Shivani Bhardwaj [Fri, 22 Feb 2019 12:50:15 +0000 (18:20 +0530)] 
Fix null pointer dereference issue detected by coverity

Coverity scan of the current code raised the following issue:
```
>>>     CID 327298:  Null pointer dereferences  (FORWARD_NULL)
>>>     Accessing a property of null-like value "val".
271                 if val.find("noalert") > -1:
```

Fix this by adding a null check on val.

Closes redmine ticket #2834.

6 years agoAdd dhcp-events.rules as a known engine provided rule.
Jason Ish [Wed, 6 Mar 2019 15:23:54 +0000 (09:23 -0600)] 
Add dhcp-events.rules as a known engine provided rule.

7 years agotests: test rule without rev gets rev 0
Jason Ish [Mon, 11 Feb 2019 19:53:48 +0000 (13:53 -0600)] 
tests: test rule without rev gets rev 0

7 years agorules: default rev to 0 for rules without a rev
Jason Ish [Mon, 11 Feb 2019 17:19:53 +0000 (11:19 -0600)] 
rules: default rev to 0 for rules without a rev

Comparisons between none types in Python 2 were allowed, Python 3
throws an exception here causing rules without a rev to break
suricata-update.

7 years agoFree some collection types before testing Suricata
Jason Ish [Mon, 11 Feb 2019 15:36:42 +0000 (09:36 -0600)] 
Free some collection types before testing Suricata

Forces Python to free up some memory before starting Suricata
which may use a lot of memory itself.

Fixup for low memory devices.

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/2791

7 years agoOptimize report generation memory usage
Jason Ish [Fri, 1 Feb 2019 18:15:06 +0000 (12:15 -0600)] 
Optimize report generation memory usage

Avoid the need to keep the complete parsed old ruleset in memory
while building the report by generating the report as the old
ruleset is parsed.

In my tests has a good amount of memory saving.

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/2791

7 years agorules: don't store a tokenized list of options
Jason Ish [Thu, 31 Jan 2019 04:43:02 +0000 (22:43 -0600)] 
rules: don't store a tokenized list of options

Its not required by suricata-update, and contributes to
excessive memory usage.

In support of issue:
https://redmine.openinfosecfoundation.org/issues/2791

7 years agorule: set noalert field to True of noalert flowbit set
Jason Ish [Thu, 31 Jan 2019 04:32:55 +0000 (22:32 -0600)] 
rule: set noalert field to True of noalert flowbit set

This is done to check if a rule is noalert instead of iterating
through the options as the options list is being removed.

7 years agoAvoid failure in case of obsoletion of attribute
Shivani Bhardwaj [Mon, 14 Jan 2019 17:22:49 +0000 (22:52 +0530)] 
Avoid failure in case of obsoletion of attribute

`platform` is currently (Py3.7) shipped with `linux_distribution`
attribute but it has been Deprecated since Py3.5. In future when it
becomes obsolete, suricata-update will break while creating User-Agent
header. In order to avoid this, check for the attribute before adding it
to User-Agent.

This renders redmine issue #2645 invalid.

7 years agointegration test: log python version info 84/head
Jason Ish [Fri, 21 Dec 2018 14:44:22 +0000 (08:44 -0600)] 
integration test: log python version info

7 years agotravis: call integration test
Jason Ish [Fri, 21 Dec 2018 14:39:22 +0000 (08:39 -0600)] 
travis: call integration test

7 years agochangelog: update for 1.0.3
Jason Ish [Fri, 21 Dec 2018 14:30:54 +0000 (08:30 -0600)] 
changelog: update for 1.0.3

7 years agoMake header an optional argument
Shivani Bhardwaj [Fri, 21 Dec 2018 09:14:53 +0000 (14:44 +0530)] 
Make header an optional argument

header was being used as a required argument in SourceConfiguration
class. Since SourceConfiguration class has been used multiple times
across commands, not all the commands require header argument and thus
it breaks. Fix it by making header an optional argument.

Closes redmine ticket #2753

7 years agochangelog: update for 1.0.2
Jason Ish [Tue, 18 Dec 2018 13:44:36 +0000 (07:44 -0600)] 
changelog: update for 1.0.2

7 years agosetup.py: check for Python 2.7 or newer.
Jason Ish [Tue, 18 Dec 2018 15:21:00 +0000 (09:21 -0600)] 
setup.py: check for Python 2.7 or newer.

Display message and exit if Python is less than 2.7.

7 years agoFix the broken sys import of distutils
Shivani Bhardwaj [Tue, 18 Dec 2018 10:31:40 +0000 (16:01 +0530)] 
Fix the broken sys import of distutils

Newer distutils versions allow to list and work with `sys` as it is
imported in the `__init__.py` however, the older versions of disutils
does not contain anything other than the version and revision strings.
The current installation procedure relied on the former method which is
only adapted in the new versions so make it compatible to the older
versions by importing `sys` from `distutils.core`.

Closes redmine ticket #2747

7 years agochangelog: update for 1.0.1 release
Jason Ish [Mon, 17 Dec 2018 02:37:23 +0000 (20:37 -0600)] 
changelog: update for 1.0.1 release

7 years agochangelog: fix typos
Jason Ish [Fri, 14 Dec 2018 18:08:58 +0000 (12:08 -0600)] 
changelog: fix typos

7 years agochangelog: update 77/head
Jason Ish [Fri, 14 Dec 2018 17:35:14 +0000 (11:35 -0600)] 
changelog: update

7 years agodoc: document add-source --http-header
Jason Ish [Fri, 14 Dec 2018 17:55:32 +0000 (11:55 -0600)] 
doc: document add-source --http-header

7 years agoUse header in the request for sources
Shivani Bhardwaj [Wed, 5 Dec 2018 19:04:26 +0000 (00:34 +0530)] 
Use header in the request for sources

Allows the use of header while requesting for a source.

Alongwith 75f6c327, closes redmine ticket #2577

7 years agoAdd header option to add source command
Shivani Bhardwaj [Wed, 5 Dec 2018 17:37:22 +0000 (23:07 +0530)] 
Add header option to add source command

Facilitates addition of a header per source while adding the source.
Usage:
```
$ ./bin/suricata-update add-source --header "Auth: Basic"
```

7 years agoSupress progress meter when not on a tty.
Jason Ish [Fri, 14 Dec 2018 15:33:04 +0000 (09:33 -0600)] 
Supress progress meter when not on a tty.

Fixes Redmine issue:
https://redmine.openinfosecfoundation.org/issues/2743

7 years agoUpdate list of engine rules to include.
Jason Ish [Thu, 13 Dec 2018 16:36:03 +0000 (10:36 -0600)] 
Update list of engine rules to include.

7 years agoversion: hide git revision if unknown 74/head
Jason Ish [Thu, 13 Dec 2018 14:45:14 +0000 (08:45 -0600)] 
version: hide git revision if unknown

This happens when suricata-update is installed bundled with
Suricata.  This is more a relic from the earlier days
of Suricata-Update when more users were likely to install
it directly from git anyways.

7 years agochangelog: issue 2676 fixed
Jason Ish [Tue, 4 Dec 2018 20:17:05 +0000 (14:17 -0600)] 
changelog: issue 2676 fixed

7 years agoFix missing null check
Shivani Bhardwaj [Wed, 28 Nov 2018 15:07:25 +0000 (20:37 +0530)] 
Fix missing null check

Coverity discovered a missing null check for the variable `val`. Fix
 that by adding the appropriate checks for it.

Closes redmine ticket #2676

7 years agochangelog: update with recent fixes
Jason Ish [Tue, 4 Dec 2018 20:06:32 +0000 (14:06 -0600)] 
changelog: update with recent fixes

7 years agoInstall requirements if using pip 66/head
Shivani Bhardwaj [Fri, 23 Nov 2018 14:55:29 +0000 (20:25 +0530)] 
Install requirements if using pip

Current setup was using distutils which does not allow to define the
requirements of a package. Check if the installation of
`suricata-update` is being done with `pip` and if it is, install the
requirements while installing the package.
This way distutils will not throw a warning of the `install_requires`
option being unrecognized, however, it would still not install the
requirements.
Now, with the installation of `suricata-update` package, all the
requirements are installed as well if it is installed with `pip`.

Closes redmine ticket #2667

7 years agoAdd the required data for sample confs to setup 63/head
Shivani Bhardwaj [Thu, 22 Nov 2018 16:12:40 +0000 (21:42 +0530)] 
Add the required data for sample confs to setup

setup.py missed the required configuration files for running the
`dump-sample-configs` option. Add all the files under
suricata/update/configs.

Closes redmine ticket #2683

7 years agoversion: 1.1.0dev0
Jason Ish [Tue, 20 Nov 2018 16:19:57 +0000 (10:19 -0600)] 
version: 1.1.0dev0

7 years agochangelog: issue 2665
Jason Ish [Tue, 20 Nov 2018 16:18:11 +0000 (10:18 -0600)] 
changelog: issue 2665

7 years agochangelog: issue 2641 addressed
Jason Ish [Tue, 20 Nov 2018 16:02:15 +0000 (10:02 -0600)] 
changelog: issue 2641 addressed

7 years agoAdd --free argument to list-sources command
Shivani Bhardwaj [Wed, 31 Oct 2018 15:38:02 +0000 (21:08 +0530)] 
Add --free argument to list-sources command

Add the functionality of being able to list only the free sources with
the `list-sources` command. This patch differentiates a free source from
a non-free source based on the availability of "subscription-url" for a
particular source.

This argument is also available in the help section of `list-sources`
command.

```
$./suricata-update list-sources -h
usage: suricata-update list-sources [-h] [-v] [-q] [-D <directory>]
                                    [-c <filename>]
                                    [--suricata-conf <filename>]
                                    [--suricata <path>]
                                    [--suricata-version <version>]
                                    [--user-agent <user-agent>]
                                    [--no-check-certificate] [-V] [--free]

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         Be more verbose
  -q, --quiet           Be quiet, warning and error messages only
  -D <directory>, --data-dir <directory>
                        Data directory (default: /var/lib/suricata)
  -c <filename>, --config <filename>
                        configuration file (default:
                        /etc/suricata/update.yaml)
  --suricata-conf <filename>
                        configuration file (default:
                        /etc/suricata/suricata.yaml)
  --suricata <path>     Path to Suricata program
  --suricata-version <version>
                        Override Suricata version
  --user-agent <user-agent>
                        Set custom user-agent string
  --no-check-certificate
                        Disable server SSL/TLS certificate verification
  -V, --version         Display version
  --free                List all freely available sources
```

Closes Redmine ticket #2641.

7 years agoclassification.conf: update test to match new strings
Jason Ish [Tue, 23 Oct 2018 20:13:28 +0000 (14:13 -0600)] 
classification.conf: update test to match new strings

7 years agoclassification.conf: Changed to Suricata 4.1 style
Travis Green [Tue, 23 Oct 2018 19:31:17 +0000 (13:31 -0600)] 
classification.conf: Changed to Suricata 4.1 style

should remain backwards compatible

7 years agoRemove User-Agent header if set to empty 59/head
Shivani Bhardwaj [Tue, 6 Nov 2018 16:06:24 +0000 (21:36 +0530)] 
Remove User-Agent header if set to empty

`suricata-update` sends a User Agent as a part of the request header to
get some basic information about the user system like the suricata-update
version, python version, etc. However, some users do not like this
behavior and are facililated with a `--user-agent` option whereby they
can modify the `User-Agent` header to a custom string. Although, in some
cases, it has been observed that the `User-Agent` header can be set to
nothing. In some other cases, users wish to set it to an empty string.

Example:

```
$ ./bin/suricata-update update-sources --user-agent "  "
```

generates request headers like,

```
Accept-Encoding: identity
Host: XXX
User-Agent:
Connection: close
```

which makes `User-Agent` header quite redundant.

Remove the header if it is set to a string that evaluates to nothing.

Closes Redmine ticket #2665.

7 years agoCheck default conf before command line options
Shivani Bhardwaj [Tue, 6 Nov 2018 15:59:10 +0000 (21:29 +0530)] 
Check default conf before command line options

The default configuration file must be checked for the availability of
`user-agent` option even if it is None.

This behavior has been implemented by Jason Ish.

7 years agoquickstart: update for 1.0
Jason Ish [Tue, 6 Nov 2018 15:36:25 +0000 (09:36 -0600)] 
quickstart: update for 1.0

Also add note that if using Suricata 4.1 the command may already
be installed.

7 years agoreadme: update for 1.0.0 1.0.0
Jason Ish [Mon, 5 Nov 2018 15:38:06 +0000 (09:38 -0600)] 
readme: update for 1.0.0

7 years ago1.0.0 - update changelog, set version
Jason Ish [Mon, 5 Nov 2018 15:10:53 +0000 (09:10 -0600)] 
1.0.0 - update changelog, set version

7 years agologging: better log message when a new file is identified 56/head
Jason Ish [Tue, 30 Oct 2018 19:54:36 +0000 (13:54 -0600)] 
logging: better log message when a new file is identified

instead of saying "recording <file> with hash ''" where the
hash is empty, log that a new file is being recorded

No functional change outside of the log message.

7 years agoShow error on failure to create output directory.
Jason Ish [Tue, 30 Oct 2018 19:35:16 +0000 (13:35 -0600)] 
Show error on failure to create output directory.

Previously:
  Output directory does not exist and could not be created:
      /var/lib/suricata/rules
Now:
  Failed to create directory /var/lib/suricata/rules:
      [Errno 13] Permission denied: '/var/lib/suricata

7 years ago--test-command: fix call to get output directory
Jason Ish [Tue, 30 Oct 2018 17:33:44 +0000 (11:33 -0600)] 
--test-command: fix call to get output directory

A custom --test-command was failing due to the wrong usage
of getting the output directory, resulting in the call
to open failing.

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/2652

7 years ago1.0.0rc2 47/head 1.0.0rc2
Jason Ish [Fri, 12 Oct 2018 16:54:38 +0000 (10:54 -0600)] 
1.0.0rc2

7 years agoindex: update bundled rule source index
Jason Ish [Fri, 12 Oct 2018 16:44:31 +0000 (10:44 -0600)] 
index: update bundled rule source index

- Includes Etnetera.

7 years agoUse assertEqual instead of deprecated assertEquals
Shivani Bhardwaj [Wed, 3 Oct 2018 16:47:00 +0000 (22:17 +0530)] 
Use assertEqual instead of deprecated assertEquals

Replace the use of assertEquals in all places with assertEqual as the
former was deprecated in https://bugs.python.org/issue9424
assertEquals goes well with Python 2.7 alongwith Python 3.x so this does
not break any existing test cases.

7 years agoAdd Python 3.7 to tox configurations
Shivani Bhardwaj [Wed, 3 Oct 2018 17:32:58 +0000 (23:02 +0530)] 
Add Python 3.7 to tox configurations

Current tox configuration was missing Python 3.7 because of which tests were
never run for a Python 3.7 environment. Fix that by adding py37 to the configurations.

7 years agotravis: test on python 3.7 43/head
Jason Ish [Wed, 3 Oct 2018 16:35:46 +0000 (10:35 -0600)] 
travis: test on python 3.7

7 years agoQuote reload command 42/head
Anh Le [Fri, 27 Jul 2018 06:21:32 +0000 (23:21 -0700)] 
Quote reload command

suricata-update throws error if the command is not quoted.
```
suricata-update: error: unrecognized arguments: kill -USR2
```

7 years agoissue 2551: python3 issue loading disable.conf 41/head
Jason Ish [Mon, 23 Jul 2018 22:02:19 +0000 (16:02 -0600)] 
issue 2551: python3 issue loading disable.conf

... and likely other related files.

The failing disable.conf has been added to the integration
tests.

Issue:
https://redmine.openinfosecfoundation.org/issues/2551

7 years agoadd-source: fix prompt for required fields
Jason Ish [Mon, 23 Jul 2018 21:31:52 +0000 (15:31 -0600)] 
add-source: fix prompt for required fields

The command had the code to prompt the user for the required
fields but the argument parser was forcing them to be set
on the command line. Make the name and url optional for
the argument parser, and prompt if not provided.

Also, handle user input on Python 2 and 3.

Fixes issue:
https://redmine.openinfosecfoundation.org/issues/2550

7 years agoissue 2549: python3 fix enable-source
Jason Ish [Mon, 23 Jul 2018 21:26:56 +0000 (15:26 -0600)] 
issue 2549: python3 fix enable-source

In Python 3, raw_input was renamed to input. This is now Python 2
and Python 3 compatible.

7 years agoversion: 1.0.0rc1 40/head 1.0.0rc1
Jason Ish [Tue, 17 Jul 2018 17:32:21 +0000 (11:32 -0600)] 
version: 1.0.0rc1

7 years agochangelog: update
Jason Ish [Thu, 12 Jul 2018 13:42:43 +0000 (07:42 -0600)] 
changelog: update

7 years agoconfig: save the filename that was used for the config 39/head
Jason Ish [Mon, 9 Jul 2018 16:57:26 +0000 (10:57 -0600)] 
config: save the filename that was used for the config

So it can be presented to the user in log messages, specifically
when listing enabled sources that are in the main configuration
file.

Fixes issue:
https://redmine.openinfosecfoundation.org/issues/2526

7 years agosid matchers: allow command separated sids 38/head
Jason Ish [Thu, 21 Jun 2018 16:18:18 +0000 (10:18 -0600)] 
sid matchers: allow command separated sids

Inspired by patch from Russel Fulton.

7 years agotests: move matcher tests to test_matchers
Jason Ish [Thu, 21 Jun 2018 16:04:30 +0000 (10:04 -0600)] 
tests: move matcher tests to test_matchers

7 years agoallow trailing commands in .conf files
Jason Ish [Thu, 21 Jun 2018 15:28:03 +0000 (09:28 -0600)] 
allow trailing commands in .conf files

Based on patch from Russel Fulton.

7 years agoarg handling: fix broken argument handling
Jason Ish [Wed, 20 Jun 2018 21:01:53 +0000 (15:01 -0600)] 
arg handling: fix broken argument handling

Broke in 74bf64e706162de9bb1731e801609e0a667a27d8.

7 years agoFixed wording in update documentation
Mateusz Mrozewski [Sun, 15 Apr 2018 08:37:29 +0000 (12:37 +0400)] 
Fixed wording in update documentation

7 years agodisplay help, or version before parsing config file 36/head
Jason Ish [Wed, 25 Apr 2018 21:07:59 +0000 (15:07 -0600)] 
display help, or version before parsing config file

Handle the display of version info and help before parsing any
configuration data.

7 years agoattempt to load defaults from a defaults module
Jason Ish [Wed, 25 Apr 2018 20:48:16 +0000 (14:48 -0600)] 
attempt to load defaults from a defaults module

The defaults module is installed by suricata into the
and contains compile time values such as sysconfdir,
and the directory where distribution provided rules
are found.

7 years agodon't try to iterate local if None
Jason Ish [Thu, 29 Mar 2018 13:38:12 +0000 (07:38 -0600)] 
don't try to iterate local if None

7 years agofail safe if ssl.create_default_context doesn't exist 34/head
Jason Ish [Sun, 25 Mar 2018 14:34:30 +0000 (08:34 -0600)] 
fail safe if ssl.create_default_context doesn't exist

fall back to the default SSL handler when create_default_context
doesn't exist as on Python versions prior to 2.7.9 where it hasn't
been backported (Ubuntu Trusty).

The downside is no certificate verification is done.

7 years agodon't see if suricata.yaml if value is None
Jason Ish [Sun, 25 Mar 2018 14:27:26 +0000 (08:27 -0600)] 
don't see if suricata.yaml if value is None

7 years agoadd smb-events.rules as a known dist provided rule file 33/head
Jason Ish [Thu, 22 Mar 2018 21:40:57 +0000 (15:40 -0600)] 
add smb-events.rules as a known dist provided rule file

7 years agobundle the index; for when it can't be downloaded
Jason Ish [Thu, 22 Mar 2018 21:35:21 +0000 (15:35 -0600)] 
bundle the index; for when it can't be downloaded

Bundle a copy of the index and fall back to it when the
index can't be downloaded.

7 years agopython3 fix: don't use itervalues
Jason Ish [Wed, 21 Mar 2018 22:41:58 +0000 (16:41 -0600)] 
python3 fix: don't use itervalues

7 years agoengine: check_output returns encoded byts with python3 32/head
Andreas Herz [Wed, 21 Mar 2018 21:44:22 +0000 (22:44 +0100)] 
engine: check_output returns encoded byts with python3

7 years agoreadme: fix minor grammar issue
Andi [Fri, 16 Mar 2018 23:58:16 +0000 (00:58 +0100)] 
readme: fix minor grammar issue