Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
puppet-cfssl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Adullact
puppet-cfssl
Commits
130febb3
Commit
130febb3
authored
2 years ago
by
Fabien Combernous
Browse files
Options
Downloads
Patches
Plain Diff
add crl_url for intermediate CA
parent
a4adc389
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!17
Resolve "add crl_url for intermediate CA"
Pipeline
#35934
canceled
2 years ago
Stage: syntax
Stage: unit
Stage: acceptance
Changes
3
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
REFERENCE.md
+21
-3
21 additions, 3 deletions
REFERENCE.md
manifests/ca/intermediate.pp
+12
-6
12 additions, 6 deletions
manifests/ca/intermediate.pp
spec/acceptance/cfssl_spec.rb
+18
-2
18 additions, 2 deletions
spec/acceptance/cfssl_spec.rb
with
51 additions
and
11 deletions
REFERENCE.md
+
21
−
3
View file @
130febb3
...
...
@@ -444,9 +444,9 @@ Creates an intermediate authority signed by root authority
```
puppet
cfssl::ca::intermediate
{
'MYEXEMPLE INTERMDIATE CA'
:
subject
=>
{
'C'
=>
'FR'
,
'L'
=>
'MONTPELLIER'
,
'O'
=>
'MYEXEMPLE ORG'
,
'C'
=>
'FR'
,
'L'
=>
'MONTPELLIER'
,
'O'
=>
'MYEXEMPLE ORG'
,
},
}
```
...
...
@@ -458,6 +458,8 @@ The following parameters are available in the `cfssl::ca::intermediate` defined
*
[
`subject`
](
#subject
)
*
[
`expiry`
](
#expiry
)
*
[
`key`
](
#key
)
*
[
`crl_url`
](
#crl_url
)
*
[
`ocsp_url`
](
#ocsp_url
)
##### <a name="subject"></a>`subject`
...
...
@@ -483,6 +485,22 @@ Cryptographic algorithm used for creating key pairs.
Default value:
`{ algo => 'rsa', size => 2048 }`
##### <a name="crl_url"></a>`crl_url`
Data type:
`Optional[Stdlib::HTTPUrl]`
The CRL url of the Root CA that issued intermediate CA.
Default value:
``undef``
##### <a name="ocsp_url"></a>`ocsp_url`
Data type:
`Optional[Stdlib::HTTPUrl]`
The OCSP responder of the Root CA that issued intermediate CA.
Default value:
``undef``
## Data types
### <a name="cfsslauthkey"></a>`Cfssl::Authkey`
...
...
This diff is collapsed.
Click to expand it.
manifests/ca/intermediate.pp
+
12
−
6
View file @
130febb3
...
...
@@ -5,20 +5,24 @@
# @example
# cfssl::ca::intermediate { 'MYEXEMPLE INTERMDIATE CA':
# subject => {
# 'C' => 'FR',
# 'L' => 'MONTPELLIER',
# 'O' => 'MYEXEMPLE ORG',
# 'C'
=> 'FR',
# 'L'
=> 'MONTPELLIER',
# 'O'
=> 'MYEXEMPLE ORG',
# },
# }
#
# @param subject Hash like Subject in X509 that identifies the entity associated
# @param expiry Duration of authority
# @param key Cryptographic algorithm used for creating key pairs.
# @param crl_url The CRL url of the Root CA that issued intermediate CA.
# @param ocsp_url The OCSP responder of the Root CA that issued intermediate CA.
#
define
cfssl::ca::intermediate
(
Hash
$subject
=
{
'C'
=>
'FR'
,
'L'
=>
'MONTPELLIER'
,
'O'
=>
'EXEMPLE ORG'
,
},
String
[
1
]
$expiry
=
'26280h'
,
Cfssl
::
Ca
::
Key
$key
=
{
algo
=>
'rsa'
,
size
=>
2048
},
Optional
[
Stdlib
::
HTTPUrl
]
$crl_url
=
undef
,
Optional
[
Stdlib
::
HTTPUrl
]
$ocsp_url
=
undef
,
)
{
require
cfssl::ca::root
...
...
@@ -29,9 +33,9 @@ define cfssl::ca::intermediate (
$_intermediatecn
=
$name
$_intermediateca_name
=
regsubst
(
$name
,
'\s'
,
''
,
'G'
)
$_intermediateca_csr
=
{
cn
=>
$_intermediatecn
,
names
=>
[
$subject
],
key
=>
$key
,
cn
=>
$_intermediatecn
,
names
=>
[
$subject
],
key
=>
$key
,
}
$_intermediateca_csr_json
=
to_json
(
$_intermediateca_csr
)
...
...
@@ -39,6 +43,8 @@ define cfssl::ca::intermediate (
signing
=>
{
'default'
=>
{
expiry
=>
$expiry
,
crl_url
=>
$crl_url
,
ocsp_url
=>
$ocsp_url
,
ca_constraint
=>
{
is_ca
=>
true
,
max_path_len
=>
1
,
...
...
This diff is collapsed.
Click to expand it.
spec/acceptance/cfssl_spec.rb
+
18
−
2
View file @
130febb3
...
...
@@ -89,6 +89,14 @@ describe 'cfssl' do
'O' => 'MYEXEMPLE ORG',
},
},
'MYEXEMPLE2 INTERMDIATE CA' => {
subject => {
'C' => 'FR',
'L' => 'MONTPELLIER',
'O' => 'MYEXEMPLE2 ORG',
},
crl_url => 'http://crl.exemple2.org/crl-MYEXEMPLE2INTERMDIATECA.crl',
},
},
serve_ca => 'MYEXEMPLE INTERMDIATE CA',
crl_manage => true,
...
...
@@ -110,12 +118,20 @@ describe 'cfssl' do
its
(
:stdout
)
{
is_expected
.
to
match
%r{BEGIN CERTIFICATE}
}
end
# rubocop:disable RSpec/RepeatedDescription
describe
command
(
'openssl x509 -in /etc/cfssl/ca/MYEXEMPLEINTERMDIATECA.pem -text -noout'
)
do
# rubocop:disable RSpec/RepeatedDescription
its
(
:stdout
)
{
is_expected
.
to
match
%r{Certificate:}
}
its
(
:stdout
)
{
is_expected
.
to
match
%r{Issuer: C = FR, L = MONTPELLIER, O = MYEXEMPLE ORG, CN = MYEXEMPLE ROOT CA}
}
its
(
:stdout
)
{
is_expected
.
to
match
%r{Subject: C = FR, L = MONTPELLIER, O = MYEXEMPLE ORG, CN = MYEXEMPLE INTERMDIATE CA}
}
its
(
:stdout
)
{
is_expected
.
to
match
%r{CA:TRUE, pathlen:1}
}
its
(
:stdout
)
{
is_expected
.
not_to
match
%r{X509v3 CRL Distribution Points:}
}
end
describe
command
(
'openssl x509 -in /etc/cfssl/ca/MYEXEMPLE2INTERMDIATECA.pem -text -noout'
)
do
its
(
:stdout
)
{
is_expected
.
to
match
%r{Certificate:}
}
its
(
:stdout
)
{
is_expected
.
to
match
%r{Issuer: C = FR, L = MONTPELLIER, O = MYEXEMPLE ORG, CN = MYEXEMPLE ROOT CA}
}
its
(
:stdout
)
{
is_expected
.
to
match
%r{Subject: C = FR, L = MONTPELLIER, O = MYEXEMPLE2 ORG, CN = MYEXEMPLE2 INTERMDIATE CA}
}
its
(
:stdout
)
{
is_expected
.
to
match
%r{CA:TRUE, pathlen:1}
}
its
(
:stdout
)
{
is_expected
.
to
match
%r{X509v3 CRL Distribution Points:}
}
end
describe
command
(
'openssl crl -in /var/cfssl/crl-MYEXEMPLEROOTCA.pem -text -noout'
)
do
...
...
@@ -127,7 +143,7 @@ describe 'cfssl' do
its
(
:stdout
)
{
is_expected
.
to
match
%r{Certificate Revocation List }
}
its
(
:stdout
)
{
is_expected
.
to
match
%r{Issuer: C = FR, L = MONTPELLIER, O = MYEXEMPLE ORG, CN = MYEXEMPLE INTERMDIATE CA}
}
its
(
:stdout
)
{
is_expected
.
to
match
%r{No Revoked Certificates}
}
# rubocop:enable RSpec/RepeatedDescription
end
# rubocop:enable RSpec/RepeatedDescription
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment