]> git.ipfire.org Git - thirdparty/suricata-update.git/log
thirdparty/suricata-update.git
8 years agoreadme: fixup paths 27/head
Jason Ish [Mon, 22 Jan 2018 18:51:07 +0000 (12:51 -0600)] 
readme: fixup paths

8 years agoVersion 1.0.0b1 26/head 1.0.0b1
Jason Ish [Fri, 19 Jan 2018 20:42:10 +0000 (14:42 -0600)] 
Version 1.0.0b1

8 years agochangelog: typo
Jason Ish [Wed, 17 Jan 2018 12:54:01 +0000 (06:54 -0600)] 
changelog: typo

8 years agolist-sources: print subscribe URL 25/head
Jason Ish [Tue, 16 Jan 2018 22:46:13 +0000 (16:46 -0600)] 
list-sources: print subscribe URL

The subscribe URL may be a sentence with a URL in it which may
contain useful information.

8 years agoon download failure, return cached version (if exists) 24/head
Jason Ish [Thu, 14 Dec 2017 21:42:23 +0000 (15:42 -0600)] 
on download failure, return cached version (if exists)

Previously if a download failed, an error would be logged and
the rules that were downloaded were processed. This could lead
to an output that was no expected (missing rules).

Now if the download fails, check if we have the previous download.
If we do, log a warning and return the cached files.

If we don't have the previous download, log an error and process
what rules we do have.

8 years ago--no-check-certificate options
Jason Ish [Thu, 14 Dec 2017 21:14:59 +0000 (15:14 -0600)] 
--no-check-certificate options

Allows the disabling of server TLS certificate checks.

8 years agoconfig: more debug on initialization
Jason Ish [Thu, 14 Dec 2017 21:12:30 +0000 (15:12 -0600)] 
config: more debug on initialization

8 years agoupdate-sources: catch network errors and error out
Jason Ish [Thu, 14 Dec 2017 20:35:45 +0000 (14:35 -0600)] 
update-sources: catch network errors and error out

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

8 years ago(Remote)Code-Execution while loading yaml-file 23/head
Wolfgang Hotwagner [Wed, 13 Dec 2017 20:53:34 +0000 (20:53 +0000)] 
(Remote)Code-Execution while loading yaml-file

The list of possible sources for suricata-update is downloaded from "https://www.openinfosecfoundation.org/rules/index.yaml" per default. Suricata-Update uses the insecure yaml.load()-function. Code will be executed if the yaml-file contains lines like:

hello: !!python/object/apply:os.system ['ls -l > /tmp/output']

The vulnerable function can be triggered by "suricata-update list-sources". The locally stored index.yaml will be loaded in this function and the malicious code gets executed.

This commit fixes Bug #2359

8 years agochangelog: update 22/head
Jason Ish [Tue, 12 Dec 2017 20:49:56 +0000 (14:49 -0600)] 
changelog: update

8 years agolook in config file for "suricata" option
Jason Ish [Tue, 12 Dec 2017 20:45:27 +0000 (14:45 -0600)] 
look in config file for "suricata" option

Previously the suricata binary could only be changed from
the command line. Now it can be set in the config file.

8 years agowhen testing suricata, use provided suricata-conf
Jason Ish [Tue, 12 Dec 2017 20:38:11 +0000 (14:38 -0600)] 
when testing suricata, use provided suricata-conf

Previously no suricata.yaml was specified for the test,
so the default was picked up.

8 years agoconfig: configurable suricata-conf-parameter
Wolfgang Hotwagner [Sun, 10 Dec 2017 15:03:16 +0000 (15:03 +0000)] 
config: configurable suricata-conf-parameter

This commit adds the command-line-parameter "suricata-conf" and replaces the hard-coded "/etc/suricata/suricata.yaml".

Ticket: Feature #2350

implemented support for multiple default suricata.yaml-files

8 years agodocker live test for Ubuntu 16.04. 20/head
Jason Ish [Fri, 8 Dec 2017 17:30:24 +0000 (11:30 -0600)] 
docker live test for Ubuntu 16.04.

8 years agoMakefile: docker-test target to run docker tests.
Jason Ish [Fri, 8 Dec 2017 22:46:34 +0000 (16:46 -0600)] 
Makefile: docker-test target to run docker tests.

8 years agouser agent: moving suricata version check up
Jason Ish [Fri, 8 Dec 2017 22:37:51 +0000 (16:37 -0600)] 
user agent: moving suricata version check up

before sub-commands, so the Suricata version can be provided
in "update-sources".

Also make --suricata and --suricata-path global options, so
sub-commands can depend on them.

8 years agointegration test: fix command line option (typo)
Jason Ish [Fri, 8 Dec 2017 22:37:26 +0000 (16:37 -0600)] 
integration test: fix command line option (typo)

8 years agofix verbose logging
Jason Ish [Fri, 8 Dec 2017 22:15:04 +0000 (16:15 -0600)] 
fix verbose logging

Commit c0789ccf2b64ddc93d20ea2afb0585b4cece50e1 broke
--verbose by never setting the log level to debug.

8 years agodoc: add --user-agent to common options
Jason Ish [Fri, 8 Dec 2017 22:17:13 +0000 (16:17 -0600)] 
doc: add --user-agent to common options

8 years ago--user-agent: make a global option
Jason Ish [Fri, 8 Dec 2017 22:13:11 +0000 (16:13 -0600)] 
--user-agent: make a global option

This allows it to apply to update-sources as well.

8 years agoconfig: configure a custom user-agent-string
Wolfgang Hotwagner [Fri, 8 Dec 2017 16:39:52 +0000 (16:39 +0000)] 
config: configure a custom user-agent-string

Includes an command-line/config-file-option for a custom user-agent string.

8 years agosetup: don't try to write revision of .git doesn't exist 18/head
Jason Ish [Fri, 8 Dec 2017 13:08:48 +0000 (07:08 -0600)] 
setup: don't try to write revision of .git doesn't exist

8 years agotypos: udpate -> update
Jason Ish [Fri, 8 Dec 2017 13:15:34 +0000 (07:15 -0600)] 
typos: udpate -> update

8 years agochangelog: update 17/head
Jason Ish [Fri, 8 Dec 2017 12:38:14 +0000 (06:38 -0600)] 
changelog: update

8 years agodoc: include common options with all commands
Jason Ish [Fri, 8 Dec 2017 12:33:27 +0000 (06:33 -0600)] 
doc: include common options with all commands

8 years agointegration test - executes suricata-update
Jason Ish [Thu, 7 Dec 2017 22:26:01 +0000 (16:26 -0600)] 
integration test - executes suricata-update

And checks exit codes and outputs. Can be run
as a script, or as a tox setup where it will
be run under multiple Python versions.

remove integration test from unit tests.

8 years agoallow default et/open url to be set from env
Jason Ish [Thu, 7 Dec 2017 21:58:56 +0000 (15:58 -0600)] 
allow default et/open url to be set from env

Allows the default et/open URL to be set with the
environment variable ETOPEN_URL. Mainly useful with tests
to avoid hitting the network.

8 years agolist-sources: update-sources if no index found
Jason Ish [Thu, 7 Dec 2017 20:49:43 +0000 (14:49 -0600)] 
list-sources: update-sources if no index found

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

8 years agorework parser to support global options before subcommand
Jason Ish [Thu, 7 Dec 2017 20:46:33 +0000 (14:46 -0600)] 
rework parser to support global options before subcommand

Allows to do something like:
suricata-update --verbose update-sources
OR
suricata-update update-sources --verbose
having the same result.

8 years agotests: remove specific python2 and python3 tests
Jason Ish [Thu, 7 Dec 2017 13:40:21 +0000 (07:40 -0600)] 
tests: remove specific python2 and python3 tests

With tox, the tests are run under multiple versions of Python.
Just use the interpreter running the tests to hit all versions
instead of relying whats installed on the host system.

8 years ago-D, --data-dir to change the data directory
Jason Ish [Thu, 7 Dec 2017 13:18:06 +0000 (07:18 -0600)] 
-D, --data-dir to change the data directory

By default /var/lib/suricata is used. But for various reasons
including permissions and testing it can be useful to change
this.

The data directory serves as the prefix for suricata-update
work directories, including rules/ and update/sources, and
update/cache.

Addresses issue:
https://redmine.openinfosecfoundation.org/issues/2334

8 years agotravis: switch to pytest for tests
Jason Ish [Wed, 6 Dec 2017 20:11:48 +0000 (14:11 -0600)] 
travis: switch to pytest for tests

To be consistent with tox.

8 years agotesting: use tox for unit tests
Jason Ish [Wed, 6 Dec 2017 20:36:23 +0000 (14:36 -0600)] 
testing: use tox for unit tests

Tox can test against multiple versions of Python using
virtualenvs.

8 years agotest: centos 7 based docker live test
Jason Ish [Wed, 6 Dec 2017 20:09:40 +0000 (14:09 -0600)] 
test: centos 7 based docker live test

This is a test that runs in a Docker image. It installs
suricata-update and executes a sequence of commands looking for
failures.

The test sequence is done with Python 2 and Python 3 as provided
in CentOS 7.

8 years agoconfig: use the module singleton for config
Jason Ish [Wed, 6 Dec 2017 18:50:37 +0000 (12:50 -0600)] 
config: use the module singleton for config

This is a common Python pattern giving us a global singleton
config. Making it a bit easier than passing a config object
around everywhere.

8 years agopython 3 fixups
Jason Ish [Wed, 6 Dec 2017 18:59:37 +0000 (12:59 -0600)] 
python 3 fixups

- enable-source
- update-sources
- setup.py

8 years agomore specific exception handling when downloading
Jason Ish [Wed, 6 Dec 2017 01:28:55 +0000 (19:28 -0600)] 
more specific exception handling when downloading

Only catch and log errors related to downloading such as bad
URLs, or 404 type errors.

Let actual coding error exeptions ripple up, as a catch all
handler here can catch actual code errors causing them to only be
logged and not crash the program during testing.

8 years agofix getting cpu on certain platforms
Jason Ish [Tue, 5 Dec 2017 23:18:11 +0000 (17:18 -0600)] 
fix getting cpu on certain platforms

use platform.machine() instead of platform.processor() as its
more reliable

8 years agousage: clarify -c is for the update configuration
Jason Ish [Tue, 5 Dec 2017 22:57:37 +0000 (16:57 -0600)] 
usage: clarify -c is for the update configuration

And not the Suricata config. This is more clear in the docs
just not in the command line help usage.

8 years agoVersion 1.0.0a. 16/head 1.0.0a1
Jason Ish [Tue, 5 Dec 2017 13:20:46 +0000 (07:20 -0600)] 
Version 1.0.0a.

8 years agoUpdate source index URL to one hosted by OISF.
Jason Ish [Tue, 5 Dec 2017 14:11:21 +0000 (08:11 -0600)] 
Update source index URL to one hosted by OISF.

8 years agodoc: point pip commands at the PyPI index
Jason Ish [Tue, 5 Dec 2017 13:19:55 +0000 (07:19 -0600)] 
doc: point pip commands at the PyPI index

In prep for a release of 1.0.0a, suricata-update will be
available on PyPI.

8 years agomanifest: add sample update.yaml
Jason Ish [Tue, 5 Dec 2017 13:24:12 +0000 (07:24 -0600)] 
manifest: add sample update.yaml

8 years agoadd-source: don't use flags for options 14/head
Jason Ish [Mon, 4 Dec 2017 22:15:01 +0000 (16:15 -0600)] 
add-source: don't use flags for options

Instead making name and url positional args.

We can add a flag to change the meaning of the URL
later.

8 years agoremove sources that an enabled one replaces 13/head
Jason Ish [Mon, 4 Dec 2017 20:01:29 +0000 (14:01 -0600)] 
remove sources that an enabled one replaces

For example, when enabling et/pro, if et/open is enabled,
remove it, as its replaced by et/pro

8 years agodoc: reorg index
Jason Ish [Mon, 4 Dec 2017 19:50:52 +0000 (13:50 -0600)] 
doc: reorg index

8 years agodoc: remove-source
Jason Ish [Mon, 4 Dec 2017 19:48:54 +0000 (13:48 -0600)] 
doc: remove-source

8 years agodoc: disable-source
Jason Ish [Mon, 4 Dec 2017 19:44:41 +0000 (13:44 -0600)] 
doc: disable-source

8 years agoremove-source - move code to its own file
Jason Ish [Mon, 4 Dec 2017 19:40:34 +0000 (13:40 -0600)] 
remove-source - move code to its own file

8 years agodisable-source: move command to own source file
Jason Ish [Mon, 4 Dec 2017 19:35:00 +0000 (13:35 -0600)] 
disable-source: move command to own source file

8 years agodoc: add page for enable-source
Jason Ish [Mon, 4 Dec 2017 19:28:31 +0000 (13:28 -0600)] 
doc: add page for enable-source

8 years agoquickstart: remove bit about re-enabling et/open
Jason Ish [Mon, 4 Dec 2017 19:22:52 +0000 (13:22 -0600)] 
quickstart: remove bit about re-enabling et/open

8 years agolist-sources: show parameters (if any)
Jason Ish [Mon, 4 Dec 2017 19:20:55 +0000 (13:20 -0600)] 
list-sources: show parameters (if any)

8 years agoWhen enabling source, also enable et/open...
Jason Ish [Mon, 4 Dec 2017 19:18:01 +0000 (13:18 -0600)] 
When enabling source, also enable et/open...

But only if the source being enabled is not et/open, or the
source being enabled does not replace et/open.

This is also only done on creation of the directory:
  /var/lib/suricata/update/sources

8 years agoenable-source: move to own source files
Jason Ish [Mon, 4 Dec 2017 13:40:09 +0000 (07:40 -0600)] 
enable-source: move to own source files

8 years agolist-sources: show replaces info
Jason Ish [Mon, 4 Dec 2017 13:10:15 +0000 (07:10 -0600)] 
list-sources: show replaces info

8 years agodoc: add doc for update-sources
Jason Ish [Mon, 4 Dec 2017 02:40:59 +0000 (20:40 -0600)] 
doc: add doc for update-sources

Also introduce a common-options file for options that are
common to all commands.

8 years agoupdate-sources: move to own source file
Jason Ish [Sun, 3 Dec 2017 20:57:20 +0000 (14:57 -0600)] 
update-sources: move to own source file

Also make the verbose logging info.

8 years agodoc: re-org into commands
Jason Ish [Sun, 3 Dec 2017 17:12:18 +0000 (11:12 -0600)] 
doc: re-org into commands

8 years agopython 3 fix for parsing suricata config output 12/head
Jason Ish [Sat, 2 Dec 2017 16:39:35 +0000 (10:39 -0600)] 
python 3 fix for parsing suricata config output

8 years agoinclude suricata version in user agent
Jason Ish [Fri, 1 Dec 2017 21:18:51 +0000 (15:18 -0600)] 
include suricata version in user agent

8 years agodoc: add quickstart
Jason Ish [Fri, 1 Dec 2017 20:31:18 +0000 (14:31 -0600)] 
doc: add quickstart

8 years agodoc: fix pulling in version
Jason Ish [Fri, 1 Dec 2017 20:31:01 +0000 (14:31 -0600)] 
doc: fix pulling in version

8 years agouse a custom user agent
Jason Ish [Fri, 1 Dec 2017 19:52:32 +0000 (13:52 -0600)] 
use a custom user agent

Includes Suricata-Update version, Suricata version, OS name
and processor architecture.

8 years agochangelog: update 11/head
Jason Ish [Fri, 1 Dec 2017 18:10:41 +0000 (12:10 -0600)] 
changelog: update

8 years agolist-sources: colourize
Jason Ish [Fri, 1 Dec 2017 13:25:02 +0000 (07:25 -0600)] 
list-sources: colourize

8 years agodisable rules with proto's not enabled in suricata config
Jason Ish [Thu, 30 Nov 2017 23:07:20 +0000 (17:07 -0600)] 
disable rules with proto's not enabled in suricata config

8 years agoinclude git revision in version output
Jason Ish [Thu, 30 Nov 2017 21:57:22 +0000 (15:57 -0600)] 
include git revision in version output

8 years agoenv var SOURCE_DIRECTORY to override default...
Jason Ish [Thu, 30 Nov 2017 19:27:12 +0000 (13:27 -0600)] 
env var SOURCE_DIRECTORY to override default...

So tests won't pick up enabled sources...

8 years agoadd --now to skip the timebased check.
Jason Ish [Thu, 30 Nov 2017 18:51:51 +0000 (12:51 -0600)] 
add --now to skip the timebased check.

8 years agodoc: rework heading levels
Jason Ish [Thu, 30 Nov 2017 17:25:47 +0000 (11:25 -0600)] 
doc: rework heading levels

8 years agoreadme: update files and directories
Jason Ish [Wed, 29 Nov 2017 22:40:53 +0000 (16:40 -0600)] 
readme: update files and directories

8 years agodon't require index for url sources
Jason Ish [Thu, 30 Nov 2017 17:26:32 +0000 (11:26 -0600)] 
don't require index for url sources

Also logs some exceptions in a more friendly way.

8 years agoupdate.yaml: sources is now just a URL list
Jason Ish [Wed, 29 Nov 2017 22:38:24 +0000 (16:38 -0600)] 
update.yaml: sources is now just a URL list

8 years agonew commands: add-source, list-sources, list-enabled-sources
Jason Ish [Wed, 29 Nov 2017 12:33:55 +0000 (06:33 -0600)] 
new commands: add-source, list-sources, list-enabled-sources

8 years agosources: resolve urls from index
Jason Ish [Tue, 28 Nov 2017 22:45:27 +0000 (16:45 -0600)] 
sources: resolve urls from index

8 years agoupdate-sources: new command to download source index
Jason Ish [Tue, 28 Nov 2017 04:21:52 +0000 (22:21 -0600)] 
update-sources: new command to download source index

8 years agoet pro: mask the secret code 10/head
Jason Ish [Tue, 28 Nov 2017 22:50:17 +0000 (16:50 -0600)] 
et pro: mask the secret code

8 years agologging: add secret masking
Jason Ish [Tue, 28 Nov 2017 22:44:47 +0000 (16:44 -0600)] 
logging: add secret masking

Allows strings to be registered that will be masked
in the log output.

8 years agorule parsing: fix infinite loop on missing ; 9/head
Jason Ish [Mon, 20 Nov 2017 21:15:54 +0000 (15:15 -0600)] 
rule parsing: fix infinite loop on missing ;

If the last rule option was missing a ";" the parser would
enter an infinite loop. Instead error out with an exception
that can be logged.

Test case added.

From an reported on the idstools rule parser.

8 years agotests: remove BSD license.
Jason Ish [Mon, 20 Nov 2017 21:11:20 +0000 (15:11 -0600)] 
tests: remove BSD license.

All code has been assigned to the OISF under the GPLv2.

8 years agochange --post-hook to --reload-command
Breaker [Fri, 3 Nov 2017 03:29:14 +0000 (11:29 +0800)] 
change --post-hook to --reload-command

8 years agodoc: --cache-dir command line argument removed 8/head
Jason Ish [Tue, 14 Nov 2017 11:04:51 +0000 (12:04 +0100)] 
doc: --cache-dir command line argument removed

8 years agoIngore cache directory when backing up rules.
Jason Ish [Tue, 14 Nov 2017 10:57:29 +0000 (11:57 +0100)] 
Ingore cache directory when backing up rules.

8 years agoPut cache directory under the rules directory.
Jason Ish [Tue, 14 Nov 2017 10:42:21 +0000 (11:42 +0100)] 
Put cache directory under the rules directory.

One less directory to manage permissions on.

8 years agofix restoration permission issue after update fail
Jason Ish [Mon, 13 Nov 2017 08:57:23 +0000 (09:57 +0100)] 
fix restoration permission issue after update fail

First attempt to just copy back the data of the files. Then
attempt to copy the mode, as the mode may fail if the user
running suricata-update doesn't own the files, but has permissions
to write to them with group permissions.

8 years agofix ET Open by default logic... 7/head
Jason Ish [Mon, 6 Nov 2017 04:27:01 +0000 (22:27 -0600)] 
fix ET Open by default logic...

Somewhere along the line the behaviour of loading ET Open
if no other URLs were present was lost. Re-add this default
behaviour.

Loading ET-Open by default will happen if:
- no --urls passed on the command line
- no sources provided in the configuration
- no etpro code given

8 years agogithub/codeowners: add OISF/core-team
Victor Julien [Fri, 3 Nov 2017 14:19:11 +0000 (15:19 +0100)] 
github/codeowners: add OISF/core-team

Add core team so all PRs get a reviewer assigned. When it's @jasonish
it will be just OISF/core-team, otherwise it'll be both. Then
@jasonish can approve in name of core-team as well.

8 years agorule parsing: don't warn if no msg present 5/head
Jason Ish [Fri, 3 Nov 2017 13:36:14 +0000 (07:36 -0600)] 
rule parsing: don't warn if no msg present

8 years agoissue 2261: don't fail on empty "local"
Jason Ish [Fri, 3 Nov 2017 13:34:51 +0000 (07:34 -0600)] 
issue 2261: don't fail on empty "local"

If local existed, but was empty, YAML would make it a None
value instead of the default empty list.

For local and sources, make sure they are an empty list after
loading instead of None.

8 years agorule testing: don't fail because of ASAN leak warnings
Victor Julien [Thu, 2 Nov 2017 14:20:26 +0000 (15:20 +0100)] 
rule testing: don't fail because of ASAN leak warnings

8 years agoFix Oinkmaster modifysid with group name.
Jason Ish [Thu, 2 Nov 2017 13:46:07 +0000 (07:46 -0600)] 
Fix Oinkmaster modifysid with group name.

Make the group name matcher the last matcher to be parsed,
and accept the match spec if it ends with .rules and not
prefixed with group.

This was broken while fixing up other issues in group name
parsing to make it more predictable.

8 years agoInitial import of Suricata-Update.
Jason Ish [Thu, 2 Nov 2017 13:03:16 +0000 (07:03 -0600)] 
Initial import of Suricata-Update.

Suricata-Update is a tool for updating Suricata rules. Based
on idstools-rulecat, but relicensed under the GPL and contributed
to the OISF.