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

Improved agent Windows config. and secondary fixes #205

Merged
merged 27 commits into from
Jan 28, 2020

Conversation

rshad
Copy link
Contributor

@rshad rshad commented Jan 23, 2020

Hi all!

This PR adds new improvements for the agent configuration in Windows and some fixes to the templates.

Originally some of these changes were added by @JPLachance in #189. But as we do not have write access to his fork branch coveord:feature/improved-agent-configuration, then we ended up applying the merge with wazuh:devel branch in local and brought the source fork branch into a local branch in wazuh:wazuh-puppet called feature-improved-agent-windows-config.

Tasks

  • Merge wazuh:devel into the source branch of the user.

  • Discard the unnecessary changes. Improve the agent configurability and fix minor issues #189 (comment)

  • Push changes to the user branch locally and create a new upstream branch as a copy of it.

  • Adapt puppet manifests and templates to the default ossec.conf of wazuh 3.11.2.

  • Verify the changes on

    • Windows
    • Centos
    • Ubuntu

Thanks, @JPLachance for contributing.

Kr,

Rshad

JPLachance and others added 2 commits December 17, 2019 14:21
* Make the logging log_format configurable
* Remove some duplication between the Agent configuration on Linux and Windows
* Improve the Windows Agent configuration based on https://github.com/wazuh/wazuh/blob/v3.10.2/src/win32/ossec.conf
* Make the generated ossec.conf file a little bit more readable by fixing ident in fragments
* Remove the duplication in fragments/_sca.erb
* The SCA config now applies for Windows Agents too
* Improve the Windows agent syscheck configuration based on https://github.com/wazuh/wazuh/blob/v3.10.2/src/win32/ossec.conf
* Make the cis cat wodle use variable from params_agent.pp
* Make the open-scap wodle use variable from params_agent.pp
* Make the osquery wodle use variable from params_agent.pp
* Make the syscollector wodle use variable from params_agent.pp
@rshad rshad force-pushed the feature-improved-agent-windows-config branch from af91972 to eed538c Compare January 23, 2020 13:16
@rshad rshad requested a review from jm404 January 23, 2020 13:38
@rshad rshad self-assigned this Jan 23, 2020
@rshad rshad requested a review from manuasir January 23, 2020 13:57
@rshad rshad force-pushed the feature-improved-agent-windows-config branch 3 times, most recently from 62b7320 to 3ed0661 Compare January 23, 2020 15:04
@rshad rshad force-pushed the feature-improved-agent-windows-config branch from 3ed0661 to fbe0893 Compare January 23, 2020 15:52
@rshad rshad force-pushed the feature-improved-agent-windows-config branch 5 times, most recently from e66cc00 to 90773f3 Compare January 23, 2020 18:29
@rshad rshad force-pushed the feature-improved-agent-windows-config branch from 90773f3 to d7d230c Compare January 23, 2020 18:36
Copy link
Contributor

@jm404 jm404 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @rshad, changes look good. Please provide ossec.conf diffs so we can ensure it's rendering properly.

Best regards,

Jose

@rshad rshad force-pushed the feature-improved-agent-windows-config branch from 74f6ee1 to 3534320 Compare January 24, 2020 11:49
@rshad
Copy link
Contributor Author

rshad commented Jan 24, 2020

Hi all!

In this PR and as we mentioned before, we made the required changes to adapt the changes we picked up from the PR #189 and we also improved and parameterized almost all the configuration related to Wazuh agent for Windows OS. We also added some small improvements.

Tasks

  • Parameterize the following templates related to wazuh-agent installation on Windows.

    • activeresponse. new template
    • rootcheck.
  • Adapt the following templates to be equal to the default config wazuh 3.11.2.

    • os-query
    • cis-cat .
    • syscollector
    • sca
    • agent.conf
  • Secondary changes and fixes for syntax errors errors which were not detected before.

Kr,

Rshad

@rshad rshad requested review from jm404 and xr09 January 24, 2020 16:37
@rshad rshad changed the title Improved agent windows config Improved agent Windows agent config. and secondary fixes Jan 24, 2020
@rshad rshad changed the title Improved agent Windows agent config. and secondary fixes Improved agent Windows config. and secondary fixes Jan 24, 2020
@rshad
Copy link
Contributor Author

rshad commented Jan 24, 2020

Hi all!

Here I attach the default installation of wazuh 3.11.2 for each of CentOS, Ubuntu and Windows OSs.

Note: For some of the configuration files I reordered some config. parts so I could make the difference comparison correctly.

Kr,

Rshad

config_files.zip

@rshad
Copy link
Contributor Author

rshad commented Jan 27, 2020

ossec.conf result files after the last changes.

config_files.zip

@rshad rshad added this to the Sprint - 106 milestone Jan 27, 2020
@rshad rshad force-pushed the feature-improved-agent-windows-config branch from 9d77ef8 to 18a66fb Compare January 28, 2020 14:46
Copy link
Contributor

@jm404 jm404 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check requested changes

manifests/params_agent.pp Outdated Show resolved Hide resolved
manifests/manager.pp Outdated Show resolved Hide resolved
@rshad rshad requested a review from jm404 January 28, 2020 15:50
@rshad
Copy link
Contributor Author

rshad commented Jan 28, 2020

Hi all!

We also re-configured for both, the agent and the manager, the related configuration to the variables whodata and realtime, specifying a different variable of them for each of the default two lists of directories in syscheck. The template was changed so realtime and whodata will not appear in final ossec.conf if they got assigned the value no.

      $ossec_syscheck_whodata_directories_1 = 'no'
      $ossec_syscheck_realtime_directories_1 = 'no'
      $ossec_syscheck_whodata_directories_2 = 'no'
      $ossec_syscheck_realtime_directories_2 = 'no'

<%- if @ossec_syscheck_directories_1 -%>
<directories check_all="yes" <%- if @ossec_syscheck_whodata_directories_1 == 'yes' -%>whodata="<%=@ossec_syscheck_whodata_directories_1%>"<%- end -%> <%- if @ossec_syscheck_realtime_directories_1 == 'yes' -%> realtime="<%=@ossec_syscheck_realtime_directories_1%>"<%- end -%>><%=@ossec_syscheck_directories_1%></directories>
<%- end -%>
<%- if @ossec_syscheck_directories_2 -%>
<directories check_all="yes" <%- if @ossec_syscheck_whodata_directories_2 == 'yes' -%>whodata="<%=@ossec_syscheck_whodata_directories_2%>"<%- end -%> <%- if @ossec_syscheck_realtime_directories_2 == 'yes' -%> realtime="<%=@ossec_syscheck_realtime_directories_2%>"<%- end -%>><%=@ossec_syscheck_directories_2%></directories>
<%- end -%>

Kr,

Rshad

@rshad
Copy link
Contributor Author

rshad commented Jan 28, 2020

Fixed Puppet linting errors and warnings.

image

@rshad rshad force-pushed the feature-improved-agent-windows-config branch 2 times, most recently from d2a0ab8 to f362a36 Compare January 28, 2020 17:15
@rshad rshad force-pushed the feature-improved-agent-windows-config branch from f362a36 to 616cf3a Compare January 28, 2020 17:20
Copy link
Contributor

@jm404 jm404 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jm404 jm404 merged commit afb4d63 into devel Jan 28, 2020
@jm404 jm404 deleted the feature-improved-agent-windows-config branch January 28, 2020 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants