Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Warden
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
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pavel Valach
Warden
Commits
16eed2c2
Commit
16eed2c2
authored
6 years ago
by
Václav Bartoš
Committed by
Pavel Kácha
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
warden_apply.sh: URL of warden_ra must be passed as parameter
+ possibility to specify cacert
parent
947e23d6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
warden3/contrib/warden_ra/README
+2
-2
2 additions, 2 deletions
warden3/contrib/warden_ra/README
warden3/contrib/warden_ra/warden_apply.sh
+15
-8
15 additions, 8 deletions
warden3/contrib/warden_ra/warden_apply.sh
with
17 additions
and
10 deletions
warden3/contrib/warden_ra/README
+
2
−
2
View file @
16eed2c2
...
...
@@ -57,7 +57,7 @@ to the new client administrator along with other setup information.
The client administrator runs the application script with application
password:
warden_apply.sh org.example.warden.client P4SSW0RD
warden_apply.sh
https://warden.example.org/warden-ra/
org.example.warden.client P4SSW0RD
The script creates new X509 key, CSR certificate request and makes call to
the Warden RA web service, where it obtains the new complete certificate.
...
...
@@ -69,7 +69,7 @@ Prolonging existing client credentials
The client administrator runs the application script with his existing valid
Warden credentials, which he needs to prolong:
warden_apply.sh org.example.warden.client cert.pem key.pem
warden_apply.sh
https://warden.example.org/warden-ra/
org.example.warden.client cert.pem key.pem
The script creates new X509 key, CSR certificate request and makes call to
the Warden RA web service, where it obtains the new complete certificate.
...
...
This diff is collapsed.
Click to expand it.
warden3/contrib/warden_ra/warden_apply.sh
+
15
−
8
View file @
16eed2c2
#!/bin/bash
url
=
'https://warden-hub.cesnet.cz/warden-ra/getCert'
key
=
key.pem
csr
=
csr.pem
cert
=
cert.pem
result
=
${
TMPDIR
:-${
TMP
:-
/tmp
}}
/cert.
$$
.
$RANDOM
config
=
${
TMPDIR
:-${
TMP
:-
/tmp
}}
/conf.
$$
.
$RANDOM
client
=
"
$1
"
password
=
"
$2
"
incert
=
"
$2
"
inkey
=
"
$3
"
if
[
"
$1
"
==
"--cacert"
]
;
then
cacert
=
"--cacert
$2
"
shift
shift
fi
url
=
"
$1
"
client
=
"
$2
"
password
=
"
$3
"
incert
=
"
$4
"
inkey
=
"
$5
"
trap
'rm -f "$config $result"'
INT TERM HUP EXIT
function
flee
{
echo
-e
"
$1
"
;
exit
$2
;
}
[
-z
"
$client
"
-o
-z
"
$password
"
]
&&
flee
"Usage:
${
0
%.*
}
client.name password
\n
${
0
%.*
}
client.name cert_file key_file"
255
[
-z
"
$client
"
-o
-z
"
$password
"
]
&&
flee
"Usage:
${
0
%.*
}
[--cacert CERT] url client.name password
\n
${
0
%.*
}
[--cacert CERT] url client.name cert_file key_file"
255
url
=
"
${
url
%/
}
/getCert"
for
n
in
openssl curl
;
do
command
-v
"
$n
"
2>&1
>
/dev/null
||
flee
"Haven't found
$n
binary."
251
...
...
@@ -32,9 +39,9 @@ echo -e "default_bits=2048\ndistinguished_name=rdn\nprompt=no\n[rdn]\ncommonName
openssl req
-new
-nodes
-batch
-keyout
"
$key
"
-out
"
$csr
"
-config
"
$config
"
||
flee
"Error generating key/certificate request."
252
if
[
-z
"
$inkey
"
]
;
then
curl
--progress-bar
--request
POST
--data-binary
'@-'
"
$url
?name=
$client
&password=
$password
"
<
"
$csr
"
>
"
$result
"
curl
--progress-bar
$cacert
--request
POST
--data-binary
'@-'
"
$url
?name=
$client
&password=
$password
"
<
"
$csr
"
>
"
$result
"
else
curl
--progress-bar
--request
POST
--data-binary
'@-'
--cert
"
$incert
"
--key
"
$inkey
"
"
$url
?name=
$client
"
<
"
$csr
"
>
"
$result
"
curl
--progress-bar
$cacert
--request
POST
--data-binary
'@-'
--cert
"
$incert
"
--key
"
$inkey
"
"
$url
?name=
$client
"
<
"
$csr
"
>
"
$result
"
fi
case
$(
<
$result
)
in
'-----BEGIN CERTIFICATE-----'
*
)
...
...
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