diff --git a/.gitignore b/.gitignore index d0a8f90..096975e 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,7 @@ /log/ /pkg/ /spec/fixtures/manifests/ -/spec/fixtures/modules/ +/spec/fixtures/modules/* /tmp/ /vendor/ /convert_report.txt diff --git a/.pdkignore b/.pdkignore index 7eacaac..9ce1c7d 100644 --- a/.pdkignore +++ b/.pdkignore @@ -16,7 +16,7 @@ /log/ /pkg/ /spec/fixtures/manifests/ -/spec/fixtures/modules/ +/spec/fixtures/modules/* /tmp/ /vendor/ /convert_report.txt @@ -26,20 +26,16 @@ .envrc /inventory.yaml /spec/fixtures/litmus_inventory.yaml -/appveyor.yml -/.editorconfig /.fixtures.yml /Gemfile /.gitattributes /.gitignore -/.gitlab-ci.yml /.pdkignore /.puppet-lint.rc /Rakefile /rakelib/ /.rspec -/.rubocop.yml -/.travis.yml +/..yml /.yardopts /spec/ /.vscode/ diff --git a/.rubocop.yml b/.rubocop.yml index 31e8248..5be1f9f 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,7 +4,7 @@ require: - rubocop-rspec AllCops: DisplayCopNames: true - TargetRubyVersion: '2.5' + TargetRubyVersion: '2.6' Include: - "**/*.rb" Exclude: @@ -111,8 +111,14 @@ Style/MethodCalledOnDoEndBlock: Enabled: true Style/StringMethods: Enabled: true +Bundler/GemFilename: + Enabled: false Bundler/InsecureProtocolSource: Enabled: false +Capybara/CurrentPathExpectation: + Enabled: false +Capybara/VisibilityMatcher: + Enabled: false Gemspec/DuplicatedAssignment: Enabled: false Gemspec/OrderedDependencies: @@ -287,11 +293,9 @@ Performance/UriDefaultParser: Enabled: false RSpec/Be: Enabled: false -RSpec/Capybara/CurrentPathExpectation: - Enabled: false RSpec/Capybara/FeatureMethods: Enabled: false -RSpec/Capybara/VisibilityMatcher: +RSpec/ContainExactly: Enabled: false RSpec/ContextMethod: Enabled: false @@ -331,6 +335,8 @@ RSpec/LeakyConstantDeclaration: Enabled: false RSpec/LetBeforeExamples: Enabled: false +RSpec/MatchArray: + Enabled: false RSpec/MissingExampleGroupArgument: Enabled: false RSpec/MultipleExpectations: @@ -373,8 +379,6 @@ Style/AccessModifierDeclarations: Enabled: false Style/AccessorGrouping: Enabled: false -Style/AsciiComments: - Enabled: false Style/BisectedAttrAccessor: Enabled: false Style/CaseLikeIf: @@ -485,35 +489,235 @@ Style/TrailingMethodEndStatement: Enabled: false Style/UnpackFirst: Enabled: false +Capybara/MatchStyle: + Enabled: false +Capybara/NegationMatcher: + Enabled: false +Capybara/SpecificActions: + Enabled: false +Capybara/SpecificFinders: + Enabled: false +Capybara/SpecificMatcher: + Enabled: false +Gemspec/DeprecatedAttributeAssignment: + Enabled: false +Gemspec/DevelopmentDependencies: + Enabled: false +Gemspec/RequireMFA: + Enabled: false +Layout/LineContinuationLeadingSpace: + Enabled: false +Layout/LineContinuationSpacing: + Enabled: false +Layout/LineEndStringConcatenationIndentation: + Enabled: false +Layout/SpaceBeforeBrackets: + Enabled: false +Lint/AmbiguousAssignment: + Enabled: false +Lint/AmbiguousOperatorPrecedence: + Enabled: false +Lint/AmbiguousRange: + Enabled: false +Lint/ConstantOverwrittenInRescue: + Enabled: false +Lint/DeprecatedConstants: + Enabled: false Lint/DuplicateBranch: Enabled: false +Lint/DuplicateMagicComment: + Enabled: false Lint/DuplicateRegexpCharacterClassElement: Enabled: false Lint/EmptyBlock: Enabled: false Lint/EmptyClass: Enabled: false +Lint/EmptyInPattern: + Enabled: false +Lint/IncompatibleIoSelectWithFiberScheduler: + Enabled: false +Lint/LambdaWithoutLiteralBlock: + Enabled: false Lint/NoReturnInBeginEndBlocks: Enabled: false +Lint/NonAtomicFileOperation: + Enabled: false +Lint/NumberedParameterAssignment: + Enabled: false +Lint/OrAssignmentToConstant: + Enabled: false +Lint/RedundantDirGlobSort: + Enabled: false +Lint/RefinementImportMethods: + Enabled: false +Lint/RequireRangeParentheses: + Enabled: false +Lint/RequireRelativeSelfPath: + Enabled: false +Lint/SymbolConversion: + Enabled: false Lint/ToEnumArguments: Enabled: false +Lint/TripleQuotes: + Enabled: false Lint/UnexpectedBlockArity: Enabled: false Lint/UnmodifiedReduceAccumulator: Enabled: false +Lint/UselessRescue: + Enabled: false +Lint/UselessRuby2Keywords: + Enabled: false +Metrics/CollectionLiteralLength: + Enabled: false +Naming/BlockForwarding: + Enabled: false Performance/CollectionLiteralInLoop: Enabled: false +Performance/ConcurrentMonotonicTime: + Enabled: false +Performance/MapCompact: + Enabled: false +Performance/RedundantEqualityComparisonBlock: + Enabled: false +Performance/RedundantSplitRegexpArgument: + Enabled: false +Performance/StringIdentifierArgument: + Enabled: false +RSpec/BeEq: + Enabled: false +RSpec/BeNil: + Enabled: false +RSpec/ChangeByZero: + Enabled: false +RSpec/ClassCheck: + Enabled: false +RSpec/DuplicatedMetadata: + Enabled: false +RSpec/ExcessiveDocstringSpacing: + Enabled: false +RSpec/FactoryBot/ConsistentParenthesesStyle: + Enabled: false +RSpec/FactoryBot/FactoryNameStyle: + Enabled: false +RSpec/FactoryBot/SyntaxMethods: + Enabled: false +RSpec/IdenticalEqualityAssertion: + Enabled: false +RSpec/NoExpectationExample: + Enabled: false +RSpec/PendingWithoutReason: + Enabled: false +RSpec/Rails/AvoidSetupHook: + Enabled: false +RSpec/Rails/HaveHttpStatus: + Enabled: false +RSpec/Rails/InferredSpecType: + Enabled: false +RSpec/Rails/MinitestAssertions: + Enabled: false +RSpec/Rails/TravelAround: + Enabled: false +RSpec/RedundantAround: + Enabled: false +RSpec/SkipBlockInsideExample: + Enabled: false +RSpec/SortMetadata: + Enabled: false +RSpec/SubjectDeclaration: + Enabled: false +RSpec/VerifiedDoubleReference: + Enabled: false +Security/CompoundHash: + Enabled: false +Security/IoMethods: + Enabled: false Style/ArgumentsForwarding: Enabled: false +Style/ArrayIntersect: + Enabled: false Style/CollectionCompact: Enabled: false +Style/ComparableClamp: + Enabled: false +Style/ConcatArrayLiterals: + Enabled: false +Style/DirEmpty: + Enabled: false Style/DocumentDynamicEvalDefinition: Enabled: false +Style/EmptyHeredoc: + Enabled: false +Style/EndlessMethod: + Enabled: false +Style/EnvHome: + Enabled: false +Style/FetchEnvVar: + Enabled: false +Style/FileEmpty: + Enabled: false +Style/FileRead: + Enabled: false +Style/FileWrite: + Enabled: false +Style/HashConversion: + Enabled: false +Style/HashExcept: + Enabled: false +Style/IfWithBooleanLiteralBranches: + Enabled: false +Style/InPatternThen: + Enabled: false +Style/MagicCommentFormat: + Enabled: false +Style/MapCompactWithConditionalBlock: + Enabled: false +Style/MapToHash: + Enabled: false +Style/MapToSet: + Enabled: false +Style/MinMaxComparison: + Enabled: false +Style/MultilineInPatternThen: + Enabled: false Style/NegatedIfElseCondition: Enabled: false +Style/NestedFileDirname: + Enabled: false Style/NilLambda: Enabled: false +Style/NumberedParameters: + Enabled: false +Style/NumberedParametersLimit: + Enabled: false +Style/ObjectThen: + Enabled: false +Style/OpenStructUse: + Enabled: false +Style/OperatorMethodCall: + Enabled: false +Style/QuotedSymbols: + Enabled: false Style/RedundantArgument: Enabled: false +Style/RedundantConstantBase: + Enabled: false +Style/RedundantDoubleSplatHashBraces: + Enabled: false +Style/RedundantEach: + Enabled: false +Style/RedundantHeredocDelimiterQuotes: + Enabled: false +Style/RedundantInitialize: + Enabled: false +Style/RedundantSelfAssignmentBranch: + Enabled: false +Style/RedundantStringEscape: + Enabled: false +Style/SelectByRegexp: + Enabled: false +Style/StringChars: + Enabled: false Style/SwapValues: Enabled: false diff --git a/Gemfile b/Gemfile index 1b8621b..2985807 100644 --- a/Gemfile +++ b/Gemfile @@ -14,31 +14,33 @@ def location_for(place_or_version, fake_version = nil) end group :development do - gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "voxpupuli-puppet-lint-plugins", '~> 3.1', require: false - gem "facterdb", '~> 1.18', require: false - gem "metadata-json-lint", '>= 2.0.2', '< 4.0.0', require: false - gem "puppetlabs_spec_helper", '>= 3.0.0', '< 5.0.0', require: false - gem "rspec-puppet-facts", '~> 2.0', require: false - gem "codecov", '~> 0.2', require: false - gem "dependency_checker", '~> 0.2', require: false - gem "parallel_tests", '~> 3.4', require: false - gem "pry", '~> 0.10', require: false - gem "simplecov-console", '~> 0.5', require: false - gem "puppet-debugger", '~> 1.0', require: false - gem "rubocop", '= 1.6.1', require: false - gem "rubocop-performance", '= 1.9.1', require: false - gem "rubocop-rspec", '= 2.0.1', require: false - gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] - gem "github_changelog_generator", '~> 1.15', require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0') + gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "racc", '~> 1.4.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false + gem "facterdb", '~> 1.18', require: false + gem "metadata-json-lint", '~> 3.0', require: false + gem "puppetlabs_spec_helper", '~> 6.0', require: false + gem "rspec-puppet-facts", '~> 2.0', require: false + gem "codecov", '~> 0.2', require: false + gem "dependency_checker", '~> 1.0.0', require: false + gem "parallel_tests", '= 3.12.1', require: false + gem "pry", '~> 0.10', require: false + gem "simplecov-console", '~> 0.5', require: false + gem "puppet-debugger", '~> 1.0', require: false + gem "rubocop", '= 1.48.1', require: false + gem "rubocop-performance", '= 1.16.0', require: false + gem "rubocop-rspec", '= 2.19.0', require: false + gem "puppet-strings", '~> 4.0', require: false + gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "github_changelog_generator", '~> 1.15', require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0') end group :system_tests do - gem "puppet_litmus", '< 1.0.0', require: false, platforms: [:ruby] - gem "serverspec", '~> 2.41', require: false + gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] + gem "serverspec", '~> 2.41', require: false end group :test do gem "puppet_metadata", '~> 1.9.0', require: false diff --git a/REFERENCE.md b/REFERENCE.md index 073f3d8..f1ba871 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -9,7 +9,7 @@ #### Public Classes * [`auditd`](#auditd): audit daemon -* [`auditd::audisp`](#auditdaudisp): audit event dispatcher +* [`auditd::audisp`](#auditd--audisp): audit event dispatcher #### Private Classes @@ -19,15 +19,15 @@ ### Defined types -* [`auditd::plugin`](#auditdplugin): Create plugin files -* [`auditd::rule`](#auditdrule): Creates auditd rules +* [`auditd::plugin`](#auditd--plugin): Create plugin files +* [`auditd::rule`](#auditd--rule): Creates auditd rules ### Data types -* [`Auditd::Audisp::Conf`](#auditdaudispconf): audispd.conf configuration file parameters -* [`Auditd::Conf`](#auditdconf): auditd.conf configuration file parameters -* [`Auditd::Plugins`](#auditdplugins): auditd plugin parameters -* [`Auditd::Rules`](#auditdrules): auditd rule parameters +* [`Auditd::Audisp::Conf`](#Auditd--Audisp--Conf): audispd.conf configuration file parameters +* [`Auditd::Conf`](#Auditd--Conf): auditd.conf configuration file parameters +* [`Auditd::Plugins`](#Auditd--Plugins): auditd plugin parameters +* [`Auditd::Rules`](#Auditd--Rules): auditd rule parameters ## Classes @@ -39,42 +39,42 @@ audit daemon The following parameters are available in the `auditd` class: -* [`buffer_size`](#buffer_size) -* [`failure_mode`](#failure_mode) -* [`immutable`](#immutable) -* [`dir`](#dir) -* [`mode`](#mode) -* [`owner`](#owner) -* [`group`](#group) -* [`config`](#config) -* [`config_path`](#config_path) -* [`config_mode`](#config_mode) -* [`config_owner`](#config_owner) -* [`config_group`](#config_group) -* [`package_name`](#package_name) -* [`package_ensure`](#package_ensure) -* [`package_manage`](#package_manage) -* [`service_enable`](#service_enable) -* [`service_name`](#service_name) -* [`service_ensure`](#service_ensure) -* [`service_manage`](#service_manage) -* [`service_override`](#service_override) -* [`plugin_dir`](#plugin_dir) -* [`plugin_dir_mode`](#plugin_dir_mode) -* [`plugin_dir_owner`](#plugin_dir_owner) -* [`plugin_dir_group`](#plugin_dir_group) -* [`plugins`](#plugins) -* [`rules_dir`](#rules_dir) -* [`rules_dir_mode`](#rules_dir_mode) -* [`rules_dir_owner`](#rules_dir_owner) -* [`rules_dir_group`](#rules_dir_group) -* [`rules_file`](#rules_file) -* [`rules_file_mode`](#rules_file_mode) -* [`rules_file_owner`](#rules_file_owner) -* [`rules_file_group`](#rules_file_group) -* [`rules`](#rules) - -##### `buffer_size` +* [`buffer_size`](#-auditd--buffer_size) +* [`failure_mode`](#-auditd--failure_mode) +* [`immutable`](#-auditd--immutable) +* [`dir`](#-auditd--dir) +* [`mode`](#-auditd--mode) +* [`owner`](#-auditd--owner) +* [`group`](#-auditd--group) +* [`config`](#-auditd--config) +* [`config_path`](#-auditd--config_path) +* [`config_mode`](#-auditd--config_mode) +* [`config_owner`](#-auditd--config_owner) +* [`config_group`](#-auditd--config_group) +* [`package_name`](#-auditd--package_name) +* [`package_ensure`](#-auditd--package_ensure) +* [`package_manage`](#-auditd--package_manage) +* [`service_enable`](#-auditd--service_enable) +* [`service_name`](#-auditd--service_name) +* [`service_ensure`](#-auditd--service_ensure) +* [`service_manage`](#-auditd--service_manage) +* [`service_override`](#-auditd--service_override) +* [`plugin_dir`](#-auditd--plugin_dir) +* [`plugin_dir_mode`](#-auditd--plugin_dir_mode) +* [`plugin_dir_owner`](#-auditd--plugin_dir_owner) +* [`plugin_dir_group`](#-auditd--plugin_dir_group) +* [`plugins`](#-auditd--plugins) +* [`rules_dir`](#-auditd--rules_dir) +* [`rules_dir_mode`](#-auditd--rules_dir_mode) +* [`rules_dir_owner`](#-auditd--rules_dir_owner) +* [`rules_dir_group`](#-auditd--rules_dir_group) +* [`rules_file`](#-auditd--rules_file) +* [`rules_file_mode`](#-auditd--rules_file_mode) +* [`rules_file_owner`](#-auditd--rules_file_owner) +* [`rules_file_group`](#-auditd--rules_file_group) +* [`rules`](#-auditd--rules) + +##### `buffer_size` Data type: `Integer` @@ -82,7 +82,7 @@ The buffer size to use Default value: `8192` -##### `failure_mode` +##### `failure_mode` Data type: `Integer` @@ -90,15 +90,15 @@ The failure mode (defaults to printing failure message) Default value: `1` -##### `immutable` +##### `immutable` Data type: `Boolean` Set if the configuration should be immutable -Default value: ``false`` +Default value: `false` -##### `dir` +##### `dir` Data type: `Stdlib::Absolutepath` @@ -106,7 +106,7 @@ The auditd configuration directory path (e.g. /etc/audit) Default value: `'/etc/audit'` -##### `mode` +##### `mode` Data type: `Stdlib::Filemode` @@ -114,7 +114,7 @@ The auditd configuration directory mode Default value: `'0750'` -##### `owner` +##### `owner` Data type: `Variant[String[1], Integer]` @@ -122,7 +122,7 @@ The auditd configuration directory owner Default value: `0` -##### `group` +##### `group` Data type: `Variant[String[1], Integer]` @@ -130,7 +130,7 @@ The auditd configuration directory group Default value: `0` -##### `config` +##### `config` Data type: `Auditd::Conf` @@ -138,7 +138,7 @@ auditd.conf configuration hash Default value: `{}` -##### `config_path` +##### `config_path` Data type: `Stdlib::Absolutepath` @@ -146,7 +146,7 @@ auditd.conf configuration filepath (e.g. /etc/audit/auditd.conf) Default value: `'/etc/audit/auditd.conf'` -##### `config_mode` +##### `config_mode` Data type: `Stdlib::Filemode` @@ -154,7 +154,7 @@ The configurtion file mode Default value: `'0600'` -##### `config_owner` +##### `config_owner` Data type: `Variant[String[1], Integer]` @@ -162,7 +162,7 @@ The configurtion file mode owner Default value: `0` -##### `config_group` +##### `config_group` Data type: `Variant[String[1], Integer]` @@ -170,7 +170,7 @@ The configurtion file mode group Default value: `0` -##### `package_name` +##### `package_name` Data type: `String[1]` @@ -178,7 +178,7 @@ The package name to use Default value: `'auditd'` -##### `package_ensure` +##### `package_ensure` Data type: `String` @@ -186,23 +186,23 @@ The package state to set Default value: `'installed'` -##### `package_manage` +##### `package_manage` Data type: `Boolean` If the auditd package should be managed -Default value: ``true`` +Default value: `true` -##### `service_enable` +##### `service_enable` Data type: `Boolean` The service enable state -Default value: ``true`` +Default value: `true` -##### `service_name` +##### `service_name` Data type: `String[1]` @@ -210,7 +210,7 @@ The service name to use Default value: `'auditd'` -##### `service_ensure` +##### `service_ensure` Data type: `Stdlib::Ensure::Service` @@ -218,23 +218,23 @@ The service ensure state Default value: `'running'` -##### `service_manage` +##### `service_manage` Data type: `Boolean` If the auditd service should be managed -Default value: ``true`` +Default value: `true` -##### `service_override` +##### `service_override` Data type: `Optional[String]` auditd service override content -Default value: ``undef`` +Default value: `undef` -##### `plugin_dir` +##### `plugin_dir` Data type: `Stdlib::Absolutepath` @@ -242,7 +242,7 @@ The plugin directory path to manage Default value: `'/etc/audit/plugins.d'` -##### `plugin_dir_mode` +##### `plugin_dir_mode` Data type: `Stdlib::Filemode` @@ -250,7 +250,7 @@ The plugin directory mode Default value: `'0750'` -##### `plugin_dir_owner` +##### `plugin_dir_owner` Data type: `Variant[String[1], Integer]` @@ -258,7 +258,7 @@ The plugin directory owner Default value: `0` -##### `plugin_dir_group` +##### `plugin_dir_group` Data type: `Variant[String[1], Integer]` @@ -266,15 +266,15 @@ The plugin directory group Default value: `0` -##### `plugins` +##### `plugins` -Data type: `Optional[Hash[String, Auditd::Plugins]]` +Data type: `Hash[String, Auditd::Plugins]` Hash of auditd plugin configuration files to create Default value: `{}` -##### `rules_dir` +##### `rules_dir` Data type: `Stdlib::Absolutepath` @@ -282,7 +282,7 @@ The rules directory path to manage Default value: `'/etc/audit/rules.d'` -##### `rules_dir_mode` +##### `rules_dir_mode` Data type: `Stdlib::Filemode` @@ -290,7 +290,7 @@ The rules directory mode Default value: `'0750'` -##### `rules_dir_owner` +##### `rules_dir_owner` Data type: `Variant[String[1], Integer]` @@ -298,7 +298,7 @@ The rules directory owner Default value: `0` -##### `rules_dir_group` +##### `rules_dir_group` Data type: `Variant[String[1], Integer]` @@ -306,7 +306,7 @@ The rules directory group Default value: `0` -##### `rules_file` +##### `rules_file` Data type: `Stdlib::Absolutepath` @@ -314,7 +314,7 @@ The rules filepath Default value: `'/etc/audit/rules.d/audit.rules'` -##### `rules_file_mode` +##### `rules_file_mode` Data type: `Stdlib::Filemode` @@ -322,7 +322,7 @@ The rules file mode Default value: `'0600'` -##### `rules_file_owner` +##### `rules_file_owner` Data type: `Variant[String[1], Integer]` @@ -330,7 +330,7 @@ The rules file owner Default value: `0` -##### `rules_file_group` +##### `rules_file_group` Data type: `Variant[String[1], Integer]` @@ -338,15 +338,15 @@ The rules file group Default value: `0` -##### `rules` +##### `rules` -Data type: `Optional[Hash[String, Auditd::Rules]]` +Data type: `Hash[String, Auditd::Rules]` Hash of auditd rules to set Default value: `{}` -### `auditd::audisp` +### `auditd::audisp` audit event dispatcher @@ -354,25 +354,25 @@ audit event dispatcher The following parameters are available in the `auditd::audisp` class: -* [`dir`](#dir) -* [`mode`](#mode) -* [`owner`](#owner) -* [`group`](#group) -* [`config`](#config) -* [`config_path`](#config_path) -* [`config_mode`](#config_mode) -* [`config_owner`](#config_owner) -* [`config_group`](#config_group) -* [`package_name`](#package_name) -* [`package_ensure`](#package_ensure) -* [`package_manage`](#package_manage) -* [`plugin_dir`](#plugin_dir) -* [`plugin_dir_mode`](#plugin_dir_mode) -* [`plugin_dir_owner`](#plugin_dir_owner) -* [`plugin_dir_group`](#plugin_dir_group) -* [`plugins`](#plugins) - -##### `dir` +* [`dir`](#-auditd--audisp--dir) +* [`mode`](#-auditd--audisp--mode) +* [`owner`](#-auditd--audisp--owner) +* [`group`](#-auditd--audisp--group) +* [`config`](#-auditd--audisp--config) +* [`config_path`](#-auditd--audisp--config_path) +* [`config_mode`](#-auditd--audisp--config_mode) +* [`config_owner`](#-auditd--audisp--config_owner) +* [`config_group`](#-auditd--audisp--config_group) +* [`package_name`](#-auditd--audisp--package_name) +* [`package_ensure`](#-auditd--audisp--package_ensure) +* [`package_manage`](#-auditd--audisp--package_manage) +* [`plugin_dir`](#-auditd--audisp--plugin_dir) +* [`plugin_dir_mode`](#-auditd--audisp--plugin_dir_mode) +* [`plugin_dir_owner`](#-auditd--audisp--plugin_dir_owner) +* [`plugin_dir_group`](#-auditd--audisp--plugin_dir_group) +* [`plugins`](#-auditd--audisp--plugins) + +##### `dir` Data type: `Stdlib::Absolutepath` @@ -380,7 +380,7 @@ The auditd configuration directory path Default value: `'/etc/audisp'` -##### `mode` +##### `mode` Data type: `Stdlib::Filemode` @@ -388,7 +388,7 @@ The auditd configuration directory mode Default value: `'0750'` -##### `owner` +##### `owner` Data type: `Variant[String[1], Integer]` @@ -396,7 +396,7 @@ The auditd configuration directory owner Default value: `0` -##### `group` +##### `group` Data type: `Variant[String[1], Integer]` @@ -404,7 +404,7 @@ The auditd configuration directory group Default value: `0` -##### `config` +##### `config` Data type: `Auditd::Audisp::Conf` @@ -412,7 +412,7 @@ audispd.conf configuration hash Default value: `{}` -##### `config_path` +##### `config_path` Data type: `Stdlib::Absolutepath` @@ -420,7 +420,7 @@ audispd.conf file path Default value: `'/etc/audisp/audispd.conf'` -##### `config_mode` +##### `config_mode` Data type: `Stdlib::Filemode` @@ -428,7 +428,7 @@ audispd.conf file mode Default value: `'0600'` -##### `config_owner` +##### `config_owner` Data type: `Variant[String[1], Integer]` @@ -436,7 +436,7 @@ audispd.conf file owner Default value: `0` -##### `config_group` +##### `config_group` Data type: `Variant[String[1], Integer]` @@ -444,7 +444,7 @@ audispd.conf file group Default value: `0` -##### `package_name` +##### `package_name` Data type: `String[1]` @@ -452,7 +452,7 @@ The audisp plugins package name Default value: `'audispd-plugins'` -##### `package_ensure` +##### `package_ensure` Data type: `String` @@ -460,15 +460,15 @@ The package state to set Default value: `'installed'` -##### `package_manage` +##### `package_manage` Data type: `Boolean` If the audisp plugin package should be managed -Default value: ``true`` +Default value: `true` -##### `plugin_dir` +##### `plugin_dir` Data type: `Stdlib::Absolutepath` @@ -476,7 +476,7 @@ The plugin directory path to manage Default value: `'/etc/audisp/plugins.d'` -##### `plugin_dir_mode` +##### `plugin_dir_mode` Data type: `Stdlib::Filemode` @@ -484,7 +484,7 @@ The plugin directory mode Default value: `'0750'` -##### `plugin_dir_owner` +##### `plugin_dir_owner` Data type: `Variant[String[1], Integer]` @@ -492,7 +492,7 @@ The plugin directory owner Default value: `0` -##### `plugin_dir_group` +##### `plugin_dir_group` Data type: `Variant[String[1], Integer]` @@ -500,9 +500,9 @@ The plugin directory group Default value: `0` -##### `plugins` +##### `plugins` -Data type: `Optional[Hash[String, Auditd::Plugins]]` +Data type: `Hash[String, Auditd::Plugins]` Hash of audisp plugin configuration files to create @@ -510,7 +510,7 @@ Default value: `{}` ## Defined types -### `auditd::plugin` +### `auditd::plugin` Create plugin files @@ -518,18 +518,18 @@ Create plugin files The following parameters are available in the `auditd::plugin` defined type: -* [`active`](#active) -* [`direction`](#direction) -* [`path`](#path) -* [`type`](#type) -* [`args`](#args) -* [`format`](#format) -* [`plugin_type`](#plugin_type) -* [`mode`](#mode) -* [`owner`](#owner) -* [`group`](#group) +* [`active`](#-auditd--plugin--active) +* [`direction`](#-auditd--plugin--direction) +* [`path`](#-auditd--plugin--path) +* [`type`](#-auditd--plugin--type) +* [`args`](#-auditd--plugin--args) +* [`format`](#-auditd--plugin--format) +* [`plugin_type`](#-auditd--plugin--plugin_type) +* [`mode`](#-auditd--plugin--mode) +* [`owner`](#-auditd--plugin--owner) +* [`group`](#-auditd--plugin--group) -##### `active` +##### `active` Data type: `Enum['yes', 'no']` @@ -537,7 +537,7 @@ Set the plugin active state. Default value: `'yes'` -##### `direction` +##### `direction` Data type: `Enum['in', 'out']` @@ -545,13 +545,13 @@ Give a clue to the event dispatcher about which direction events flow. Default value: `'out'` -##### `path` +##### `path` Data type: `Variant[Stdlib::Absolutepath, String]` The absolute path to the plugin executable. -##### `type` +##### `type` Data type: `Enum['builtin', 'always']` @@ -559,15 +559,15 @@ Tells the dispatcher how the plugin wants to be run. Default value: `'always'` -##### `args` +##### `args` Data type: `Optional[String]` Pass arguments to the child program. -Default value: ``undef`` +Default value: `undef` -##### `format` +##### `format` Data type: `Enum['binary', 'string']` @@ -575,7 +575,7 @@ Binary or string dispatcher options. Default value: `'string'` -##### `plugin_type` +##### `plugin_type` Data type: `Enum['auditd', 'audisp']` @@ -583,7 +583,7 @@ The plugin type Default value: `'auditd'` -##### `mode` +##### `mode` Data type: `Stdlib::Filemode` @@ -591,7 +591,7 @@ The file mode to apply Default value: `'0600'` -##### `owner` +##### `owner` Data type: `Variant[String, Integer]` @@ -599,7 +599,7 @@ The file owner to set Default value: `0` -##### `group` +##### `group` Data type: `Variant[String, Integer]` @@ -607,7 +607,7 @@ The file group to set Default value: `0` -### `auditd::rule` +### `auditd::rule` Creates auditd rules @@ -615,18 +615,18 @@ Creates auditd rules The following parameters are available in the `auditd::rule` defined type: -* [`content`](#content) -* [`order`](#order) +* [`content`](#-auditd--rule--content) +* [`order`](#-auditd--rule--order) -##### `content` +##### `content` -Data type: `String` +Data type: `Optional[String]` The rule content -Default value: `''` +Default value: `undef` -##### `order` +##### `order` Data type: `Integer[1, 1000]` @@ -636,7 +636,7 @@ Default value: `10` ## Data types -### `Auditd::Audisp::Conf` +### `Auditd::Audisp::Conf` audispd.conf configuration file parameters @@ -654,7 +654,7 @@ Struct[{ }] ``` -### `Auditd::Conf` +### `Auditd::Conf` auditd.conf configuration file parameters @@ -668,7 +668,18 @@ Struct[{ Optional['log_format'] => Enum['raw', 'RAW', 'enriched', 'ENRICHED'], Optional['log_group'] => Variant[Integer, String[1]], Optional['priority_boost'] => Integer[0], - Optional['flush'] => Enum['none', 'NONE', 'incremental', 'INCREMENTAL', 'incremental_async', 'INCREMENTAL_ASYNC', 'data', 'DATA', 'sync', 'SYNC'], + Optional['flush'] => Enum[ + 'none', + 'NONE', + 'incremental', + 'INCREMENTAL', + 'incremental_async', + 'INCREMENTAL_ASYNC', + 'data', + 'DATA', + 'sync', + 'SYNC', + ], Optional['freq'] => Integer[0], Optional['dispatcher'] => String, Optional['disp_qos'] => Enum['lossy', 'LOSSY', 'lossless', 'LOSSLESS'], @@ -676,15 +687,84 @@ Struct[{ Optional['name_format'] => Enum['none', 'NONE', 'hostname', 'HOSTNAME', 'fqd', 'FQD', 'numeric', 'NUMERIC', 'user', 'USER'], Optional['name'] => String, Optional['max_log_file'] => Integer, - Optional['max_log_file_action'] => Enum['ignore', 'IGNORE', 'syslog', 'SYSLOG', 'suspend', 'SUSPEND', 'rotate', 'ROTATE', 'keep_logs', 'KEEP_LOGS'], + Optional['max_log_file_action'] => Enum[ + 'ignore', + 'IGNORE', + 'syslog', + 'SYSLOG', + 'suspend', + 'SUSPEND', + 'rotate', + 'ROTATE', + 'keep_logs', + 'KEEP_LOGS'], Optional['verify_email'] => Enum['yes', 'no'], Optional['action_mail_acct'] => Variant[String, Stdlib::Email], Optional['space_left'] => Integer, - Optional['space_left_action'] => Enum['ignore', 'IGNORE', 'syslog', 'SYSLOG', 'rotate', 'ROTATE', 'email', 'EMAIL', 'exec', 'EXEC', 'suspend', 'SUSPEND', 'single', 'SINGLE', 'halt', 'HALT'], + Optional['space_left_action'] => Enum[ + 'ignore', + 'IGNORE', + 'syslog', + 'SYSLOG', + 'rotate', + 'ROTATE', + 'email', + 'EMAIL', + 'exec', + 'EXEC', + 'suspend', + 'SUSPEND', + 'single', + 'SINGLE', + 'halt', + 'HALT'], Optional['admin_space_left'] => Variant[Integer, String], - Optional['admin_space_left_action'] => Enum['ignore', 'IGNORE', 'syslog', 'SYSLOG', 'rotate', 'ROTATE', 'email', 'EMAIL', 'exec', 'EXEC', 'suspend', 'SUSPEND', 'single', 'SINGLE', 'halt', 'HALT'], - Optional['disk_full_action'] => Enum['ignore', 'IGNORE', 'syslog', 'SYSLOG', 'rotate', 'ROTATE', 'exec', 'EXEC', 'suspend', 'SUSPEND', 'single', 'SINGLE', 'halt', 'HALT'], - Optional['disk_error_action'] => Enum['ignore', 'IGNORE', 'syslog', 'SYSLOG', 'exec', 'EXEC', 'suspend', 'SUSPEND', 'single', 'SINGLE', 'halt', 'HALT'], + Optional['admin_space_left_action'] => Enum[ + 'ignore', + 'IGNORE', + 'syslog', + 'SYSLOG', + 'rotate', + 'ROTATE', + 'email', + 'EMAIL', + 'exec', + 'EXEC', + 'suspend', + 'SUSPEND', + 'single', + 'SINGLE', + 'halt', + 'HALT', + ], + Optional['disk_full_action'] => Enum['ignore', + 'IGNORE', + 'syslog', + 'SYSLOG', + 'rotate', + 'ROTATE', + 'exec', + 'EXEC', + 'suspend', + 'SUSPEND', + 'single', + 'SINGLE', + 'halt', + 'HALT', + ], + Optional['disk_error_action'] => Enum['ignore', + 'IGNORE', + 'syslog', + 'SYSLOG', + 'exec', + 'EXEC', + 'suspend', + 'SUSPEND', + 'single', + 'SINGLE', + 'halt', + 'HALT', + ], Optional['tcp_listen_port'] => Integer[1,65535], Optional['tcp_listen_queue'] => Integer, Optional['tcp_max_per_addr'] => Integer[1,1024], @@ -697,14 +777,24 @@ Struct[{ Optional['krb5_key_file'] => Stdlib::Absolutepath, Optional['distribute_network'] => Enum['yes', 'no'], Optional['q_depth'] => Integer, - Optional['overflow_action'] => Enum['ignore', 'IGNORE', 'syslog', 'SYSLOG', 'suspend', 'SUSPEND', 'single', 'SINGLE', 'halt', 'HALT'], + Optional['overflow_action'] => Enum['ignore', + 'IGNORE', + 'syslog', + 'SYSLOG', + 'suspend', + 'SUSPEND', + 'single', + 'SINGLE', + 'halt', + 'HALT', + ], Optional['max_restarts'] => Integer[0], Optional['plugin_dir'] => Stdlib::Absolutepath, Optional['end_of_event_timeout'] => Integer[0], }] ``` -### `Auditd::Plugins` +### `Auditd::Plugins` auditd plugin parameters @@ -725,7 +815,7 @@ Struct[{ }] ``` -### `Auditd::Rules` +### `Auditd::Rules` auditd rule parameters diff --git a/Rakefile b/Rakefile index 0f8754e..74415a9 100644 --- a/Rakefile +++ b/Rakefile @@ -1,12 +1,11 @@ # frozen_string_literal: true require 'bundler' -require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any? +require 'puppet_litmus/rake_tasks' if Gem.loaded_specs.key? 'puppet_litmus' require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-syntax/tasks/puppet-syntax' -require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any? -require 'github_changelog_generator/task' if Bundler.rubygems.find_name('github_changelog_generator').any? -require 'puppet-strings/tasks' if Bundler.rubygems.find_name('puppet-strings').any? +require 'github_changelog_generator/task' if Gem.loaded_specs.key? 'github_changelog_generator' +require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings' def changelog_user return unless Rake.application.top_level_tasks.include? "changelog" @@ -44,7 +43,7 @@ end PuppetLint.configuration.send('disable_relative') -if Bundler.rubygems.find_name('github_changelog_generator').any? +if Gem.loaded_specs.key? 'github_changelog_generator' GitHubChangelogGenerator::RakeTask.new :changelog do |config| raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil? config.user = "#{changelog_user}" diff --git a/metadata.json b/metadata.json index 27f688e..648e558 100644 --- a/metadata.json +++ b/metadata.json @@ -68,7 +68,7 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 6.21.0 < 8.0.0" + "version_requirement": ">= 7.0.0 < 8.0.0" } ], "tags": [ @@ -77,7 +77,7 @@ "audispd", "audisp" ], - "pdk-version": "2.6.1", - "template-url": "https://github.com/puppetlabs/pdk-templates#2.7.1", - "template-ref": "tags/2.7.1-0-g9a16c87" + "pdk-version": "3.0.0", + "template-url": "https://github.com/puppetlabs/pdk-templates#3.0.0", + "template-ref": "tags/3.0.0-0-g5bfc1c0" } diff --git a/spec/default_facts.yml b/spec/default_facts.yml index f777abf..3346c39 100644 --- a/spec/default_facts.yml +++ b/spec/default_facts.yml @@ -2,7 +2,8 @@ # # Facts specified here will override the values provided by rspec-puppet-facts. --- -ipaddress: "172.16.254.254" -ipaddress6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA" +networking: + ip: "172.16.254.254" + ip6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA" + mac: "AA:AA:AA:AA:AA:AA" is_pe: false -macaddress: "AA:AA:AA:AA:AA:AA" diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index b3038c7..514c554 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -25,8 +25,8 @@ next unless File.exist?(f) && File.readable?(f) && File.size?(f) begin - default_facts.merge!(YAML.safe_load(File.read(f), [], [], true)) - rescue => e + default_facts.merge!(YAML.safe_load(File.read(f), permitted_classes: [], permitted_symbols: [], aliases: true)) + rescue StandardError => e RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}" end end