This repository has been archived by the owner on Jul 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #115 from wazuh/feature-cookbooks
Deploy cookbooks
- Loading branch information
Showing
263 changed files
with
5,008 additions
and
3,919 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Kitchen tests for Wazuh Chef | ||
|
||
on: | ||
push: | ||
branches: | ||
- feature-cookbooks | ||
pull_request: | ||
branches: | ||
- feature-cookbooks | ||
|
||
jobs: | ||
kitchen-test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
os: [ | ||
centos-8, | ||
ubuntu-2004, | ||
] | ||
suite: [ | ||
wazuh-server, | ||
wazuh-server-oss, | ||
wazuh-agent, | ||
opendistro, | ||
elastic-stack | ||
] | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
- name: Install Chef | ||
uses: actionshub/chef-install@main | ||
- name: Test ${{ matrix.suite }} cookbook | ||
uses: actionshub/test-kitchen@main | ||
env: | ||
CHEF_LICENSE: accept-no-persist | ||
KITCHEN_LOCAL_YAML: kitchen.yml | ||
with: | ||
suite: ${{ matrix.suite }} | ||
os: ${{ matrix.os }} | ||
action: test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,50 @@ | ||
.kitchen/* | ||
./cookbooks/wazuh_agent/.kitchen | ||
./cookbooks/wazuh_agent/.kitchen/* | ||
./cookbooks/wazuh_manager/.kitchen | ||
./cookbooks/wazuh_manager/.kitchen/* | ||
./cookbooks/wazuh_elastic/.kitchen | ||
./cookbooks/wazuh_elastic/.kitchen/* | ||
./cookbooks/wazuh_filebeat/.kitchen | ||
./cookbooks/wazuh_filebeat/.kitchen/* | ||
*.rbc | ||
.config | ||
InstalledFiles | ||
lib/bundler/man | ||
pkg | ||
test/tmp | ||
test/version_tmp | ||
tmp | ||
_Store | ||
*~ | ||
*# | ||
.#* | ||
\#*# | ||
*.un~ | ||
*.tmp | ||
*.bk | ||
*.bkup | ||
|
||
# editor temp files | ||
.idea | ||
.*.sw[a-z] | ||
|
||
# ruby/bundler files | ||
.ruby-version | ||
.ruby-gemset | ||
.rvmrc | ||
Gemfile.lock | ||
.bundle | ||
*.gem | ||
coverage | ||
spec/reports | ||
|
||
# YARD / rdoc artifacts | ||
.yardoc | ||
_yardoc | ||
doc/ | ||
rdoc | ||
|
||
# chef infra stuff | ||
Berksfile.lock | ||
.kitchen | ||
kitchen.local.yml | ||
vendor/ | ||
.coverage/ | ||
.zero-knife.rb | ||
Policyfile.lock.json | ||
|
||
# vagrant stuff | ||
.vagrant/ | ||
.vagrant.d/ |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
source 'https://supermarket.chef.io' | ||
|
||
metadata | ||
|
||
group 'cookbooks' do | ||
cookbook 'elastic-stack', path: 'cookbooks/elastic-stack' | ||
cookbook 'opendistro', path: 'cookbooks/opendistro' | ||
cookbook 'filebeat', path: 'cookbooks/filebeat' | ||
cookbook 'filebeat-oss', path: 'cookbooks/filebeat-oss' | ||
cookbook 'wazuh_agent', path: 'cookbooks/wazuh_agent' | ||
cookbook 'wazuh_manager', path: 'cookbooks/wazuh_manager' | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
source 'https://rubygems.org' | ||
|
||
#group :lint do | ||
# gem 'rubocop' | ||
#end | ||
|
||
group :kitchen do | ||
gem 'test-kitchen' | ||
gem 'kitchen-inspec' | ||
end | ||
|
||
group :drivers do | ||
#gem 'kitchen-docker' | ||
gem 'kitchen-vagrant' | ||
gem 'kitchen-dokken' | ||
end |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
Test Wazuh Chef cookbooks | ||
========================= | ||
|
||
# Global prerequisistes | ||
- [Ruby](https://www.ruby-lang.org/es/documentation/installation/) | ||
- [Chef Workstation](https://downloads.chef.io/products/workstation) | ||
|
||
There are two ways of creating a chef environment and tests cookbooks depending on what driver to use: | ||
- [kitchen-vagrant](https://github.com/test-kitchen/kitchen-vagrant) | ||
- [kitchen-dokken](https://github.com/test-kitchen/kitchen-dokken) | ||
|
||
Kitchen-vagrant | ||
=============== | ||
|
||
## Prerequisites | ||
- Vagrant | ||
- Virtualbox | ||
|
||
## Hot to use? | ||
First install dependancies: | ||
``bundle install`` | ||
|
||
Then go to ``wazuh-chef/kitchen-vagrant`` folder and execute kitchen commands. | ||
|
||
Kitchen dokken | ||
============== | ||
|
||
## Prerequisites | ||
- Docker | ||
|
||
## How to use? | ||
First install dependancies: | ||
``bundle install`` | ||
|
||
Then execute kithcen commands. | ||
|
||
Kitchen command | ||
=============== | ||
|
||
Kitchen commands To create an environment with Wazuh Chef cookbooks: | ||
|
||
1. ``kitchen list``: list all kitchen instances | ||
2. ``kitchen create <suite_name>-<platform_name>``: create an instance just with a \<platform_name\> node initialized. | ||
3. ``kitchen create <suite_name>-<platform_name>``: create an instance with all cookbooks declared | ||
in \<suite_name\> inside a \<platform_name\> node | ||
4. ``kitchen verify <suite_name>-<platform_name>``: run tests in the instance specified | ||
5. ``kitchen destroy <suite_name>-<platform_name>``: destroy in the instance specified | ||
6. ``kitchen login <suite_name>-<platform_name>``: login in the instance specified | ||
|
||
|
Oops, something went wrong.