-
Notifications
You must be signed in to change notification settings - Fork 683
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
- Loading branch information
1 parent
25a086f
commit 9dcc3a1
Showing
4 changed files
with
41 additions
and
0 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 |
---|---|---|
|
@@ -12,3 +12,4 @@ | |
depends 'httpd', '~> 0.2' | ||
depends 'windows' | ||
depends 'ssh-hardening' | ||
depends 'openssl' |
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,15 @@ | ||
if node['platform_family'] != 'windows' | ||
|
||
openssl_x509 '/tmp/mycert.pem' do | ||
common_name 'www.f00bar.com' | ||
org 'Foo Bar' | ||
org_unit 'Lab' | ||
country 'US' | ||
expire 360 | ||
end | ||
|
||
openssl_rsa_key '/tmp/server.key' do | ||
key_length 2048 | ||
end | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# encoding: utf-8 | ||
|
||
if os.windows? | ||
STDERR.puts "\033[1;33mTODO: Not running #{__FILE__} because we are not on Linux.\033[0m" | ||
return | ||
end | ||
|
||
describe x509_certificate('/tmp/mycert.pem') do | ||
it { should be_certificate } | ||
it { should be_valid } | ||
its('signature_algorithm') { should eq 'sha256WithRSAEncryption' } | ||
its('validity_in_days') { should_not be < 100 } | ||
its('validity_in_days') { should be >= 100 } | ||
its('subject_dn') { should eq '/C=US/O=Foo Bar/OU=Lab/CN=www.f00bar.com' } | ||
its('subject.C') { should eq 'US' } | ||
its('issuer_dn') { should eq '/C=US/O=Foo Bar/OU=Lab/CN=www.f00bar.com' } | ||
its('key_length') { should be >= 2048 } | ||
end | ||
|
||
describe key_rsa('/tmp/server.key') do | ||
it { should be_private } | ||
it { should be_public } | ||
its('key_length') { should eq 2048 } | ||
end |