Skip to content

Commit

Permalink
Merge pull request #338 from wazuh/release-4.0.4
Browse files Browse the repository at this point in the history
Release 4.0.4
  • Loading branch information
Zenidd authored Jan 15, 2021
2 parents eb3328b + 6291ae4 commit 51fe0e9
Show file tree
Hide file tree
Showing 43 changed files with 539 additions and 292 deletions.
6 changes: 6 additions & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
fixtures:
forge_modules:
stdlib:
repo: "puppetlabs/stdlib"
ref: "4.13.0"
13 changes: 10 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@ name: Kitchen tests for Wazuh Puppet

on: [push, workflow_dispatch]

# - name: Build and launch Linting test
# uses: './.github/actions/validate_module'

jobs:

pdk-validate:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Run PDK validation tests
uses: './.github/actions/validate_module'

amazonlinux:
runs-on: ubuntu-latest
steps:
Expand Down
42 changes: 42 additions & 0 deletions .pdkignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.git/
.*.sw[op]
.metadata
.yardoc
.yardwarns
*.iml
/.bundle/
/.idea/
/.vagrant/
/coverage/
/bin/
/doc/
/Gemfile.local
/Gemfile.lock
/junit/
/log/
/pkg/
/spec/fixtures/manifests/
/spec/fixtures/modules/
/tmp/
/vendor/
/convert_report.txt
/update_report.txt
.DS_Store
.project
.envrc
/inventory.yaml
/appveyor.yml
/.fixtures.yml
/Gemfile
/.gitattributes
/.gitignore
/.gitlab-ci.yml
/.pdkignore
/Rakefile
/rakelib/
/.rspec
/.rubocop.yml
/.travis.yml
/.yardopts
/spec/
/.vscode/
137 changes: 137 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
---
require:
- rubocop-rspec
- rubocop-i18n
AllCops:
DisplayCopNames: true
TargetRubyVersion: '2.1'
Include:
- "./**/*.rb"
Exclude:
- bin/*
- ".vendor/**/*"
- "**/Gemfile"
- "**/Rakefile"
- pkg/**/*
- spec/fixtures/**/*
- vendor/**/*
- "**/Puppetfile"
- "**/Vagrantfile"
- "**/Guardfile"
Metrics/LineLength:
Description: People have wide screens, use them.
Max: 200
GetText:
Enabled: false
GetText/DecorateString:
Description: We don't want to decorate test output.
Exclude:
- spec/**/*
Enabled: false
RSpec/BeforeAfterAll:
Description: Beware of using after(:all) as it may cause state to leak between tests.
A necessary evil in acceptance testing.
Exclude:
- spec/acceptance/**/*.rb
RSpec/HookArgument:
Description: Prefer explicit :each argument, matching existing module's style
EnforcedStyle: each
Style/BlockDelimiters:
Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to
be consistent then.
EnforcedStyle: braces_for_chaining
Style/BracesAroundHashParameters:
Description: Braces are required by Ruby 2.7. Cop removed from RuboCop v0.80.0.
See https://github.com/rubocop-hq/rubocop/pull/7643
Enabled: true
Style/ClassAndModuleChildren:
Description: Compact style reduces the required amount of indentation.
EnforcedStyle: compact
Style/EmptyElse:
Description: Enforce against empty else clauses, but allow `nil` for clarity.
EnforcedStyle: empty
Style/FormatString:
Description: Following the main puppet project's style, prefer the % format format.
EnforcedStyle: percent
Style/FormatStringToken:
Description: Following the main puppet project's style, prefer the simpler template
tokens over annotated ones.
EnforcedStyle: template
Style/Lambda:
Description: Prefer the keyword for easier discoverability.
EnforcedStyle: literal
Style/RegexpLiteral:
Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168
EnforcedStyle: percent_r
Style/TernaryParentheses:
Description: Checks for use of parentheses around ternary conditions. Enforce parentheses
on complex expressions for better readability, but seriously consider breaking
it up.
EnforcedStyle: require_parentheses_when_complex
Style/TrailingCommaInArguments:
Description: Prefer always trailing comma on multiline argument lists. This makes
diffs, and re-ordering nicer.
EnforcedStyleForMultiline: comma
Style/TrailingCommaInLiteral:
Description: Prefer always trailing comma on multiline literals. This makes diffs,
and re-ordering nicer.
EnforcedStyleForMultiline: comma
Style/SymbolArray:
Description: Using percent style obscures symbolic intent of array's contents.
EnforcedStyle: brackets
RSpec/MessageSpies:
EnforcedStyle: receive
Style/Documentation:
Exclude:
- lib/puppet/parser/functions/**/*
- spec/**/*
Style/WordArray:
EnforcedStyle: brackets
Style/CollectionMethods:
Enabled: true
Style/MethodCalledOnDoEndBlock:
Enabled: true
Style/StringMethods:
Enabled: true
GetText/DecorateFunctionMessage:
Enabled: false
GetText/DecorateStringFormattingUsingInterpolation:
Enabled: false
GetText/DecorateStringFormattingUsingPercent:
Enabled: false
Layout/EndOfLine:
Enabled: false
Layout/IndentHeredoc:
Enabled: false
Metrics/AbcSize:
Enabled: false
Metrics/BlockLength:
Enabled: false
Metrics/ClassLength:
Enabled: false
Metrics/CyclomaticComplexity:
Enabled: false
Metrics/MethodLength:
Enabled: false
Metrics/ModuleLength:
Enabled: false
Metrics/ParameterLists:
Enabled: false
Metrics/PerceivedComplexity:
Enabled: false
RSpec/DescribeClass:
Enabled: false
RSpec/ExampleLength:
Enabled: false
RSpec/MessageExpectation:
Enabled: false
RSpec/MultipleExpectations:
Enabled: false
RSpec/NestedGroups:
Enabled: false
Style/AsciiComments:
Enabled: false
Style/IfUnlessModifier:
Enabled: false
Style/SymbolProc:
Enabled: false
26 changes: 23 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
# Change Log
All notable changes to this project will be documented in this file.

## Wazuh Puppet v4.0.4

### Added

- Update to Wazuh [v4.0.4](https://github.com/wazuh/wazuh-ansible/blob/v4.0.4/CHANGELOG.md)
- Add support for Elasticsearch cluster in Kibana manifests ([@neonmei](https://github.com/neonmei)) [PR#317](https://github.com/wazuh/wazuh-puppet/pull/317)
- Add support for Ubuntu 20.04 (Focal Fossa) ([@Zenidd](https://github.com/Zenidd), [@neonmei](https://github.com/neonmei)) [PR#321](https://github.com/wazuh/wazuh-puppet/pull/321)
### Fixed

- Idempotency improvements in Elasticsearch manifests ([@neonmei](https://github.com/neonmei)) [PR#313](https://github.com/wazuh/wazuh-puppet/pull/313)
- Linting improvements work for Puppet Forge publishing ([@Zenidd](https://github.com/Zenidd)) [PR#314](https://github.com/wazuh/wazuh-puppet/pull/314)
- Idempotency improvements in Kibana manifests ([@neonmei](https://github.com/neonmei)) [PR#315](https://github.com/wazuh/wazuh-puppet/pull/315)
- PDK validate improvements ([@neonmei](https://github.com/neonmei)) [PR#319](https://github.com/wazuh/wazuh-puppet/pull/319)
- Fix warnings due to undefined variables ([@Hexta](https://github.com/Hexta)) [PR#331](https://github.com/wazuh/wazuh-puppet/pull/331)
- Use `manager_ossec.conf` as render target for Integrations ([@Zenidd](https://github.com/Zenidd)) [PR#327](https://github.com/wazuh/wazuh-puppet/pull/327)
- Use `manager_ossec.conf` as render target for Reports ([@Zenidd](https://github.com/Zenidd)) [PR#328](https://github.com/wazuh/wazuh-puppet/pull/328)
- Remove manager-specific options for active response in agent manifest ([@Zenidd](https://github.com/Zenidd)) [PR#332](https://github.com/wazuh/wazuh-puppet/pull/332)
- Fix stdlib deprecation warnings related to `validate_*` functions ([@Hexta](https://github.com/Hexta)) [PR#334](https://github.com/wazuh/wazuh-puppet/pull/334)
- Update target name in concat resources for `manager_ossec.conf` ([@g3rhard](https://github.com/g3rhard )) [PR#341](https://github.com/wazuh/wazuh-puppet/pull/341)

## Wazuh Puppet v4.0.3

### Added
Expand All @@ -17,7 +37,7 @@ All notable changes to this project will be documented in this file.

### Added

- Update to Wazuh version 4.0.2
- Update to Wazuh version 4.0.2

### Fixed

Expand All @@ -28,8 +48,8 @@ All notable changes to this project will be documented in this file.

### Added

- Update to Wazuh version 4.0.1
- Support for Wazuh v4 new features ([@Zenidd](https://github.com/Zenidd)) [PR#300](https://github.com/wazuh/wazuh-puppet/pull/300):
- Update to Wazuh version 4.0.1
- Support for Wazuh v4 new features ([@Zenidd](https://github.com/Zenidd)) [PR#300](https://github.com/wazuh/wazuh-puppet/pull/300):
- Agent autoenrollment
- API RBAC

Expand Down
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,5 @@ gem "test-kitchen"
gem "kitchen-puppet"
gem "kitchen-vagrant"
gem 'kitchen-docker', '~> 2.3'
gem "puppet"
gem "librarian-puppet"
# vim: syntax=ruby
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Email](https://img.shields.io/badge/email-join-blue.svg)](https://groups.google.com/forum/#!forum/wazuh)
[![Documentation](https://img.shields.io/badge/docs-view-green.svg)](https://documentation.wazuh.com)
[![Web](https://img.shields.io/badge/web-view-green.svg)](https://wazuh.com)
![Kitchen tests](https://github.com/wazuh/wazuh-puppet/workflows/Kitchen%20tests/badge.svg)
![Kitchen tests for Wazuh Puppet](https://github.com/wazuh/wazuh-puppet/workflows/Kitchen%20tests%20for%20Wazuh%20Puppet/badge.svg)

This module installs and configure Wazuh agent and manager.

Expand Down Expand Up @@ -67,7 +67,6 @@ This module installs and configure Wazuh agent and manager.
│ ├── params_opendistro.pp
│ ├── repo_elastic_oss.pp
│ ├── repo_elastic.pp
│ ├── repo_elasticsearch-oss.pp
│ ├── repo_opendistro.pp
│ ├── repo.pp
│ ├── reports.pp
Expand Down Expand Up @@ -138,7 +137,7 @@ This Puppet module has been authored by Nicolas Zin, and updated by Jonathan Gaz
## License and copyright

WAZUH
Copyright (C) 2020 Wazuh Inc. (License GPLv2)
Copyright (C) 2021 Wazuh Inc. (License GPLv2)

## Web References

Expand Down
4 changes: 2 additions & 2 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
WAZUH-PUPPET_VERSION="v4.0.3"
REVISION="40003"
WAZUH-PUPPET_VERSION="v4.0.4"
REVISION="40004"
2 changes: 1 addition & 1 deletion data/common.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
---
--- {}
42 changes: 23 additions & 19 deletions kitchen/test/integration/agent/agent_spec.rb
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
describe package('wazuh-agent') do
it { is_expected.to be_installed }
its('version') { is_expected.to eq '4.0.3-1' }
end
control 'wazuh-agent' do
title 'Wazuh agent tests'
describe 'Checks Wazuh agent correct version, services and daemon ownership'

describe service('wazuh-agent') do
it { is_expected.to be_installed }
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end
describe package('wazuh-agent') do
it { is_expected.to be_installed }
its('version') { is_expected.to eq '4.0.4-1' }
end

# Verifying daemons
describe service('wazuh-agent') do
it { is_expected.to be_installed }
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end

wazuh_daemons = {
# 'ossec-agentd' => 'ossec',
'ossec-execd' => 'root',
# 'ossec-syscheckd' => 'root',
# 'wazuh-modulesd' => 'root',
}
# Verifying daemons
wazuh_daemons = {
# 'ossec-agentd' => 'ossec',
'ossec-execd' => 'root',
# 'ossec-syscheckd' => 'root',
# 'wazuh-modulesd' => 'root',
}

wazuh_daemons.each do |key, value|
describe processes(key) do
its('users') { is_expected.to eq [value] }
wazuh_daemons.each do |key, value|
describe processes(key) do
its('users') { is_expected.to eq [value] }
end
end
end
Loading

0 comments on commit 51fe0e9

Please sign in to comment.