Skip to content

Commit

Permalink
Merge pull request #21 from wazuh/development
Browse files Browse the repository at this point in the history
v1.08
  • Loading branch information
jesuslinares committed May 5, 2016
2 parents 56b9966 + d9c0f98 commit dce0e14
Show file tree
Hide file tree
Showing 14 changed files with 993 additions and 7 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# Change Log
All notable changes to this project will be documented in this file.

## [v1.08] - 2016-05-05
### Added
- Redis decoders and rules.
- Rootchecks for RedHat 7.
- SUDO and SSH decoders.

### Changed
- SSH and OSSEC rules.
- Minor changes in ossec_ruleset.py.


## [v1.07] - 2016-04-05
### Added
- Decoders and rules:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.07
1.08
16 changes: 14 additions & 2 deletions ossec_ruleset.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# OSSEC Ruleset Update

# v2.3.1 2016/04/05
# v2.3.2 2016/05/05
# Created by Wazuh, Inc. <[email protected]>.
# [email protected]
# This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2
Expand Down Expand Up @@ -176,6 +176,12 @@ def get_previous_line(line_search, filepath):
return previous_line


def get_number_lines(filepath):
with open(filepath) as f:
n = sum(1 for _ in f)
return n


def remove_line(line_search, filepath):
for line in fileinput.input(filepath, inplace=True):
if line_search in line.strip():
Expand Down Expand Up @@ -448,6 +454,11 @@ def setup_wazuh_directory_structure():

# Check if decoders in wazuh structure
try:
# ossec.conf must be formatted
if get_number_lines(ossec_conf) < 2:
logger.log("\tError checking directory structure: Invalid ossec.conf.\n")
sys.exit(2)

# OSSEC Decoders
# If exists decoder.xml -> Move to /etc/ossec_decoders
old_decoder = "{0}/etc/decoder.xml".format(ossec_path)
Expand Down Expand Up @@ -1010,7 +1021,7 @@ def clean_directory():

def usage():
msg = """
OSSEC Wazuh Ruleset Update v2.3.1
OSSEC Wazuh Ruleset Update v2.3.2
Github repository: https://github.com/wazuh/ossec-rules
Full documentation: http://documentation.wazuh.com/en/latest/ossec_ruleset.html
Expand Down Expand Up @@ -1182,6 +1193,7 @@ def usage():
restore_backups(backup_name)
else:
restore_backups("0")
restart_ossec = True
logger.log("\t[Done]")
else:
# Setup Wazuh structure: /etc/ossec_decoders/, /etc/wazuh_decoders/, /etc/local_decoders.xml
Expand Down
Loading

0 comments on commit dce0e14

Please sign in to comment.