Skip to content

Commit 6625de7

Browse files
authored
Merge pull request #131 from dev-sec/ap/bump-version-2.4.1
Bump version to 2.4.1 and switch to inspec 3 for check
2 parents b543c17 + a0d5528 commit 6625de7

6 files changed

Lines changed: 35 additions & 26 deletions

File tree

.rubocop.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
AllCops:
33
Exclude:
44
- vendor/**/*
5-
- "*/puppet/Puppetfile"
6-
- "*/puppet/.tmp/**/*"
7-
TargetRubyVersion: 1.9
85
Documentation:
96
Enabled: false
107
AlignParameters:

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
**Merged pull requests:**
1313

14+
- 2.4.0 [\#124](https://github.com/dev-sec/ssh-baseline/pull/124) ([chris-rock](https://github.com/chris-rock))
1415
- Allow prohibit-password as PermitRootLogin value [\#123](https://github.com/dev-sec/ssh-baseline/pull/123) ([jeremy-clerc](https://github.com/jeremy-clerc))
1516
- UseRoaming is deprecated, only check on older versions [\#122](https://github.com/dev-sec/ssh-baseline/pull/122) ([rndmh3ro](https://github.com/rndmh3ro))
1617
- Fix os detection [\#120](https://github.com/dev-sec/ssh-baseline/pull/120) ([IceBear2k](https://github.com/IceBear2k))

Gemfile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
# frozen_string_literal: true
2+
13
source 'https://rubygems.org'
24

3-
gem 'highline', '~> 1.6.0'
4-
gem 'inspec', '~> 1'
5-
gem 'rack', '1.6.4'
6-
gem 'rake'
7-
gem 'rubocop', '~> 0.49.0'
5+
gem 'highline', '~> 2.0.2'
6+
gem 'inspec', '~> 3'
7+
gem 'rack', '~> 2.0.7'
8+
gem 'rake', '~> 12.3.2'
9+
gem 'rubocop', '~> 0.68.1'
810

911
group :tools do
10-
gem 'github_changelog_generator', '~> 1.12.0'
12+
gem 'github_changelog_generator', '~> 1.14.3'
13+
gem 'pry-coolline', '~> 0.2.5'
1114
end

Rakefile

100644100755
Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# encoding: utf-8
1+
#!/usr/bin/env rake
22

33
require 'rake/testtask'
44
require 'rubocop/rake_task'
@@ -19,23 +19,30 @@ task default: [:lint, 'test:check']
1919
namespace :test do
2020
# run inspec check to verify that the profile is properly configured
2121
task :check do
22-
dir = File.join(File.dirname(__FILE__))
23-
sh("bundle exec inspec check #{dir}")
22+
require 'inspec'
23+
puts "Checking profile with InSpec Version: #{Inspec::VERSION}"
24+
profile = Inspec::Profile.for_target('.', backend: Inspec::Backend.create(Inspec::Config.mock))
25+
pp profile.check
2426
end
2527
end
2628

27-
# Automatically generate a changelog for this project. Only loaded if
28-
# the necessary gem is installed. By default its picking up the version from
29-
# inspec.yml. You can override that behavior with `rake changelog to=1.2.0`
30-
begin
31-
require 'yaml'
32-
metadata = YAML.load_file('inspec.yml')
33-
v = ENV['to'] || metadata['version']
34-
puts "Generate changelog for version #{v}"
35-
require 'github_changelog_generator/task'
36-
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
37-
config.future_release = v
29+
task :changelog do
30+
# Automatically generate a changelog for this project. Only loaded if
31+
# the necessary gem is installed. By default its picking up the version from
32+
# inspec.yml. You can override that behavior with `rake changelog to=1.2.0`
33+
begin
34+
require 'yaml'
35+
metadata = YAML.load_file('inspec.yml')
36+
v = ENV['to'] || metadata['version']
37+
puts " * Generating changelog for version #{v}"
38+
require 'github_changelog_generator/task'
39+
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
40+
config.future_release = v
41+
config.user = 'dev-sec'
42+
config.project = 'ssh-baseline'
43+
end
44+
Rake::Task[:changelog].execute
45+
rescue LoadError
46+
puts '>>>>> GitHub Changelog Generator not loaded, omitting tasks'
3847
end
39-
rescue LoadError
40-
puts '>>>>> GitHub Changelog Generator not loaded, omitting tasks'
4148
end

inspec.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ copyright: DevSec Hardening Framework Team
55
copyright_email: hello@dev-sec.io
66
license: Apache-2.0
77
summary: Test-suite for best-practice SSH hardening
8-
version: 2.4.0
8+
version: 2.4.1
99
supports:
1010
- os-family: unix

libraries/ssh_crypto.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ def valid_hostkeys
271271
# we have to return a string if we have a single-element
272272
# https://github.com/chef/inspec/issues/1434
273273
return hostkeys[0] if hostkeys.length == 1
274+
274275
hostkeys
275276
end
276277
end

0 commit comments

Comments
 (0)