Skip to content
This repository was archived by the owner on Jul 10, 2021. It is now read-only.

Commit 6f668fb

Browse files
kirillbilchenkoezimanyidorbin
authored
Update x509 instruction with roles definition section (#2061)
* Update x509 instruction with roles defenition section * Fix failure in test * Update explanation about roles definition * Spelling fix * Rephrase role defenition section * Update spelling Co-authored-by: Eric Zimanyi <[email protected]> Co-authored-by: Eric Zimanyi <[email protected]> Co-authored-by: Dave Dorbin <[email protected]>
1 parent d4d1bd0 commit 6f668fb

File tree

1 file changed

+15
-6
lines changed
  • setup/security/authentication/x509

1 file changed

+15
-6
lines changed

setup/security/authentication/x509/index.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,23 @@ Encoding with any other OID can be done by editing the `openssl.conf`.
9090
9191
>**Note:** If providing multiple groups, as in this example, separate them with a new line (`\n`). The new line `\n` shows as a `%0A` in the certificate.
9292
93-
1. Generate a CSR for a new x509 certificate and the given `openssl.conf`:
93+
1. Generate a CSR for a new x509 certificate and the given `openssl.conf`:
9494
```
9595
openssl req -nodes -newkey rsa:2048 -keyout key.out -out client.csr \
9696
-subj "/C=US/ST=CA/L=Oakland/O=Spinnaker/[email protected]" -config openssl.conf
9797
```
98+
99+
1. Create extention config file `extension.conf` to apply roles when signing the server requests.
100+
```
101+
[ v3_req ]
102+
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
103+
1.2.840.10070.8.1 = ASN1:UTF8String:spinnaker-example0\nspinnaker-example1
104+
```
105+
The same rule for the roles definition applied to this section, as it's explained in the first step of this section.
106+
98107
1. Use the CA to sign the server's request. (If using an external CA, they do this for you.)
99108
```
100-
openssl x509 -req -days 365 -in client.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out client.crt
109+
openssl x509 -req -days 365 -in client.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out client.crt -extensions v3_req -extfile ./extension.conf
101110
```
102111
103112
![Example x509 certificate generated](two_roles_x509.png)
@@ -110,17 +119,17 @@ hal config security authn x509 edit --role-oid 1.2.840.10070.8.1
110119
111120
### Configure SSL to require certs
112121
113-
If you have SSL enabled, you need to set the Apache Tomcat SSL stack to require a valid certificate
114-
chain as required by the Spring Security integration.
122+
If you have SSL enabled, you need to set the Apache Tomcat SSL stack to require a valid certificate
123+
chain as required by the Spring Security integration.
115124
116125
```
117126
hal config security api ssl edit --client-auth # Set to WANT or NEED
118127
```
119128
120129
There are three states for `client-auth` - `WANT`, `NEED`, and when it is unset.
121130
122-
Set `client-auth` to `WANT` to use a certificate if available. SSL connections will succeed even if
123-
the client doesn’t provide a certificate. This is useful if you enable x509 with another
131+
Set `client-auth` to `WANT` to use a certificate if available. SSL connections will succeed even if
132+
the client doesn’t provide a certificate. This is useful if you enable x509 with another
124133
authentication method like OAuth, LDAP, SAML - when a certificate is not provided, users can still
125134
authenticate with one of these methods.
126135

0 commit comments

Comments
 (0)