Skip to content

Commit

Permalink
Update tested platforms and add unified_mode
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Webb <[email protected]>
  • Loading branch information
damacus committed Feb 17, 2022
1 parent 5124247 commit ba9b79f
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 84 deletions.
51 changes: 16 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,30 @@ name: ci
"on":
pull_request:
push:
branches:
- main
branches: [main]

jobs:
delivery:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Run Chef Delivery
uses: actionshub/chef-delivery@main
env:
CHEF_LICENSE: accept-no-persist

yamllint:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Run yaml Lint
uses: actionshub/yamllint@main

mdl:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Run Markdown Lint
uses: actionshub/markdownlint@main
lint-unit:
uses: sous-chefs/.github/.github/workflows/[email protected]

integration:
needs: [mdl, yamllint, delivery]
needs: lint-unit
runs-on: ubuntu-latest
strategy:
matrix:
os:
- 'debian-8'
- 'debian-9'
- 'centos-7'
- 'ubuntu-1604'
- 'ubuntu-1804'
suite:
- 'default'
- almalinux-8
- amazonlinux-2
- centos-7
- centos-stream-8
- debian-10
- debian-11
- fedora-latest
- opensuse-leap-15
- rockylinux-8
- ubuntu-1804
- ubuntu-2004
suite: [default]
fail-fast: false

steps:
Expand Down
4 changes: 0 additions & 4 deletions .overcommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ PreCommit:
enabled: true
required_executable: 'cookstyle'
command: ["cookstyle"]
Delivery:
enabled: true
required_executable: 'delivery'
flags: ['local', 'all']
CommitMsg:
HardTabs:
enabled: true
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ This file is used to list changes made in each version of the snort cookbook.
- resolved cookstyle error: resources/service.rb:44:77 refactor: `Chef/Modernize/UseChefLanguageSystemdHelper`
- resolved cookstyle error: resources/service.rb:48:1 refactor: `Chef/Modernize/ClassEvalActionClass`
- resolved cookstyle error: resources/service.rb:50:8 refactor: `Chef/Modernize/UseChefLanguageSystemdHelper`
- Update tested platforms
- Enable unified_mode

## 5.0.3 - *2022-02-08*

Expand Down
55 changes: 37 additions & 18 deletions kitchen.dokken.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,65 @@
driver:
name: dokken
privileged: true
chef_version: <%= ENV['CHEF_VERSION'] || 'current' %>
env: [CHEF_LICENSE=accept]

transport:
name: dokken

provisioner:
name: dokken
deprecations_as_errors: true

platforms:
- name: debian-8
- name: almalinux-8
driver:
image: dokken/debian-8
image: dokken/almalinux-8
pid_one_command: /usr/lib/systemd/systemd

- name: amazonlinux-2
driver:
image: dokken/amazonlinux-2
pid_one_command: /usr/lib/systemd/systemd

- name: debian-10
driver:
image: dokken/debian-10
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update

- name: debian-9
- name: debian-11
driver:
image: dokken/debian-9
image: dokken/debian-11
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update

- name: centos-7
driver:
image: dokken/centos-7
pid_one_command: /usr/lib/systemd/systemd

- name: ubuntu-16.04
- name: centos-stream-8
driver:
image: dokken/ubuntu-16.04
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
image: dokken/centos-stream-8
pid_one_command: /usr/lib/systemd/systemd

- name: fedora-latest
driver:
image: dokken/fedora-latest
pid_one_command: /usr/lib/systemd/systemd

- name: ubuntu-18.04
driver:
image: dokken/ubuntu-18.04
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update

- name: ubuntu-20.04
driver:
image: dokken/ubuntu-20.04
pid_one_command: /bin/systemd

- name: opensuse-leap-15
driver:
image: dokken/opensuse-leap-15
pid_one_command: /usr/lib/systemd/systemd

- name: rockylinux-8
driver:
image: dokken/rockylinux-8
pid_one_command: /usr/lib/systemd/systemd
23 changes: 15 additions & 8 deletions kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,29 @@ driver:
name: vagrant

provisioner:
name: chef_zero
name: chef_infra
deprecations_as_errors: true
chef_license: accept
product_name: chef
product_version: <%= ENV['CHEF_VERSION'] || 'latest' %>
install_strategy: once
deprecations_as_errors: true
install_strategy: always
chef_log_level: <%= ENV['CHEF_LOG_LEVEL'] || 'auto' %>

verifier:
name: inspec

platforms:
- name: almalinux-8
- name: amazonlinux-2
- name: centos-7
- name: debian-8
- name: debian-9
- name: fedora-27
- name: ubuntu-14.04
- name: ubuntu-16.04
- name: centos-stream-8
- name: debian-10
- name: debian-11
- name: fedora-latest
- name: opensuse-leap-15
- name: rockylinux-8
- name: ubuntu-18.04
- name: ubuntu-20.04

suites:
- name: default
Expand Down
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
license 'Apache-2.0'
description 'Installs Snort IDS packages'
version '5.0.3'
chef_version '>= 15.0'
chef_version '>= 15.5'
source_url 'https://github.com/sous-chefs/snort'
issues_url 'https://github.com/sous-chefs/snort/issues'

Expand Down
2 changes: 2 additions & 0 deletions resources/compile.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
unified_mode true

property :daq_tar, String, required: true
property :snort_tar, String, required: true
property :snort_version, String, required: true
Expand Down
2 changes: 2 additions & 0 deletions resources/config.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
unified_mode true

property :home_net, String, default: 'any'
property :external_net, String, default: 'any'
property :http_ports, String, default: '80,81,311,383,591,593,901,1220,1414,1741,1830,2301,2381,2809,3037,3128,3702,4343,4848,5250,6988,7000,7001,7144,7145,7510,7777,7779,8000,8008,8014,8028,8080,8085,8088,8090,8118,8123,8180,8181,8243,8280,8300,8800,8888,8899,9000,9060,9080,9090,9091,9443,9999,11371,34443,34444,41080,50002,55555'
Expand Down
20 changes: 2 additions & 18 deletions resources/install.rb
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
#
# Cookbook:: snort
# Resource:: install
#
# Copyright:: 2010-2017, Chef Software, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
unified_mode true

property :database, String, equal_to: %w(none snort-mysql postgresql pgsql postgres), name_property: true
property :home_net, [String, nil], default: lazy {
case node['platform_family']
Expand Down
2 changes: 2 additions & 0 deletions resources/rules.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
unified_mode true

property :oinkcode, [String, nil] # Supply this to download registered/subscriber rules
property :tar_name, String, default: 'community-rules.tar.gz' # Override this if you have an Oink code and know the tar you want to download
property :conf_dir, String, default: '/etc/snort'
Expand Down
2 changes: 2 additions & 0 deletions resources/service.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
unified_mode true

property :options, Array, default: ['-q']

action :start do
Expand Down

0 comments on commit ba9b79f

Please sign in to comment.