Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add whitelist regex support #612

Merged
merged 24 commits into from
Sep 1, 2019
Merged

Add whitelist regex support #612

merged 24 commits into from
Sep 1, 2019

Commits on Jul 7, 2019

  1. Add support for regex filters for whitelisting.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 7, 2019
    Configuration menu
    Copy the full SHA
    fdff462 View commit details
    Browse the repository at this point in the history
  2. New table is called regex_whitelist (at least for now).

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 7, 2019
    Configuration menu
    Copy the full SHA
    d79891d View commit details
    Browse the repository at this point in the history
  3. Temporarily disable regex debugging as it generated hundreds of thous…

    …ands of messages during gravity import.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 7, 2019
    Configuration menu
    Copy the full SHA
    b0838aa View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2019

  1. Rename table regex to regex_blacklist.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 8, 2019
    Configuration menu
    Copy the full SHA
    c0eedd5 View commit details
    Browse the repository at this point in the history
  2. Be more specific about how many of which kind of regex filters we com…

    …piled.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 8, 2019
    Configuration menu
    Copy the full SHA
    fb46dcf View commit details
    Browse the repository at this point in the history

Commits on Jul 9, 2019

  1. Added 8 new tests ensuring both whitelist exact and regex unblock reg…

    …ex as well as gravity domains as expected.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 9, 2019
    Configuration menu
    Copy the full SHA
    ea6cddb View commit details
    Browse the repository at this point in the history
  2. Adjust expected statistics as we query additional domains now.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 9, 2019
    Configuration menu
    Copy the full SHA
    43a2c9f View commit details
    Browse the repository at this point in the history
  3. Add test "Regex blacklist match + whitelist regex match is not blocked".

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 9, 2019
    Configuration menu
    Copy the full SHA
    95be30d View commit details
    Browse the repository at this point in the history
  4. Rename in_whitelist() to whitelisted() as this routine does not only …

    …compare against the whitelist table but also evaluates possible whitelist regex filters.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 9, 2019
    Configuration menu
    Copy the full SHA
    f996753 View commit details
    Browse the repository at this point in the history
  5. Rename init_regex() to compile_regex() as this describes better what …

    …this routine is doing.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 9, 2019
    Configuration menu
    Copy the full SHA
    8294f75 View commit details
    Browse the repository at this point in the history
  6. Declare free_regex() and log_regex() static as we do not need to make…

    … them globally available.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 9, 2019
    Configuration menu
    Copy the full SHA
    cb29305 View commit details
    Browse the repository at this point in the history
  7. Declare free_regex() static as we do not need to make it globally ava…

    …ilable. Remove log_regex() as it can easily be inlined.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 9, 2019
    Configuration menu
    Copy the full SHA
    e14322b View commit details
    Browse the repository at this point in the history

Commits on Jul 14, 2019

  1. Merge branch 'development' into new/whitelist-regex-support

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 14, 2019
    Configuration menu
    Copy the full SHA
    d362a5e View commit details
    Browse the repository at this point in the history

Commits on Jul 16, 2019

  1. Rename regex blacklist trigger to tr_regex_blacklist_update.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 16, 2019
    Configuration menu
    Copy the full SHA
    be1b573 View commit details
    Browse the repository at this point in the history
  2. Improve difference between between REGEX and TABLE constants by renam…

    …ing the latter to always end in _TABLE. Also remove code duplication by using a lookup array for the table names instead of using multiple select labels.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 16, 2019
    Configuration menu
    Copy the full SHA
    caf18e1 View commit details
    Browse the repository at this point in the history
  3. Do not check regex whitelist filters when querying the domain_audit t…

    …able. Added documentation to in_whitelist() that explains the idea of the chosen implementation method.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 16, 2019
    Configuration menu
    Copy the full SHA
    a3f25f9 View commit details
    Browse the repository at this point in the history
  4. Print failed regex line instead of its ID when reporting an error.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 16, 2019
    Configuration menu
    Copy the full SHA
    eaf3d23 View commit details
    Browse the repository at this point in the history
  5. Add debugging output for gravity table if requested via DEBUG_DATABAS…

    …E option. We might want to separate this into DEBUG_GRAVITY_DATABASE in the future.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 16, 2019
    Configuration menu
    Copy the full SHA
    dd8af36 View commit details
    Browse the repository at this point in the history
  6. Clarify that the shown number is the error code.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 16, 2019
    Configuration menu
    Copy the full SHA
    e3fc3a7 View commit details
    Browse the repository at this point in the history
  7. regexec() can only return zero or NOMATCH according to its man page. …

    …This allows us to remove the error handler as it could never be executed.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 16, 2019
    Configuration menu
    Copy the full SHA
    fe23292 View commit details
    Browse the repository at this point in the history
  8. Fix minor typo.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 16, 2019
    Configuration menu
    Copy the full SHA
    8c6736a View commit details
    Browse the repository at this point in the history
  9. Simplify log_regex_error().

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 16, 2019
    Configuration menu
    Copy the full SHA
    369a056 View commit details
    Browse the repository at this point in the history

Commits on Aug 7, 2019

  1. Remove call to sqlite3_finalize(stmt) on error in gravityDB_getDomain…

    …(). We always finalize the statement afterwards - whether or not we encountered an error before.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Aug 7, 2019
    Configuration menu
    Copy the full SHA
    2a731f0 View commit details
    Browse the repository at this point in the history

Commits on Aug 17, 2019

  1. Merge branch 'development' into new/whitelist-regex-support

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Aug 17, 2019
    Configuration menu
    Copy the full SHA
    f3e8d23 View commit details
    Browse the repository at this point in the history