Skip to content

Commit 13e83a4

Browse files
author
Steve Salas
committed
Add extra SAML config instructions
1 parent a2dd86b commit 13e83a4

File tree

8 files changed

+1551
-1451
lines changed

8 files changed

+1551
-1451
lines changed

guided-setup.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ $s = @{}
9090
[IngressKind],[NginxIngressNamespace],[NginxIngressAddress],
9191
[LetsEncryptNamespace],[LetsEncryptClusterIssuer],[LetsEncryptEmail],[IngressCertificateArn],
9292
[DnsName],
93-
[AuthenticationType],[LdapInstructions],[SamlAuthenticationDnsName],[SamlIdpMetadata],[SamlAppName],[SamlKeystorePwd],[SamlPrivateKeyPwd],
93+
[AuthenticationType],[LdapInstructions],[SamlAuthenticationDnsName],[SamlIdpMetadata],[SamlAppName],[SamlKeystorePwd],[SamlPrivateKeyPwd],[SamlExtraConfig],
9494
[DefaultCPU],[NginxCPU],[CodeDxCPU],[MasterDatabaseCPU],[SubordinateDatabaseCPU],[ToolServiceCPU],[MinIOCPU],[WorkflowCPU],
9595
[DefaultMemory],[NginxMemory],[CodeDxMemory],[MasterDatabaseMemory],[SubordinateDatabaseMemory],[ToolServiceMemory],[MinIOMemory],[WorkflowMemory],
9696
[DefaultEphemeralStorage],[NginxEphemeralStorage],[CodeDxEphemeralStorage],[MasterDatabaseEphemeralStorage],[SubordinateDatabaseEphemeralStorage],[ToolServiceEphemeralStorage],[MinIOEphemeralStorage],[WorkflowEphemeralStorage],
@@ -154,7 +154,7 @@ Add-StepTransitions $graph $s[[LetsEncryptEmail]] $s[[DnsName]],$s[[Authenticati
154154
Add-StepTransitions $graph $s[[IngressCertificateArn]] $s[[AuthenticationType]]
155155

156156
Add-StepTransitions $graph $s[[AuthenticationType]] $s[[LdapInstructions]],$s[[DefaultCPU]]
157-
Add-StepTransitions $graph $s[[AuthenticationType]] $s[[SamlAuthenticationDnsName]],$s[[SamlIdpMetadata]],$s[[SamlAppName]],$s[[SamlKeystorePwd]],$s[[SamlPrivateKeyPwd]],$s[[DefaultCPU]]
157+
Add-StepTransitions $graph $s[[AuthenticationType]] $s[[SamlAuthenticationDnsName]],$s[[SamlIdpMetadata]],$s[[SamlAppName]],$s[[SamlKeystorePwd]],$s[[SamlPrivateKeyPwd]],$s[[SamlExtraConfig]],$s[[DefaultCPU]]
158158
Add-StepTransitions $graph $s[[AuthenticationType]] $s[[SamlIdpMetadata]]
159159
Add-StepTransitions $graph $s[[AuthenticationType]] $s[[DefaultCPU]]
160160

images/guided-setup.svg

Lines changed: 1459 additions & 1447 deletions
Loading

setup/core/docs/auth/use-ldap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Here are the deployment steps required to use [Code Dx with LDAP](https://codedx.com/Documentation/InstallGuide.html#ActiveDirectoryLDAPConfiguration):
44

5-
1) Complete the guided setup to determine the setup command(s) for Deploying Code Dx on your Kubernetes cluster.
5+
1) Complete the guided setup to determine the setup command(s) for deploying Code Dx on your Kubernetes cluster. End the guided setup by using one of the options to save your setup command to a file.
66

77
>Note: If you're planning to use LDAPS and your LDAP server uses either a self-signed certificate or a certificate issued by a CA other than a well-known one, you must select a custom cacerts file and add the certificate for your LDAP server.
88

setup/core/docs/auth/use-saml.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Specify Extra SAML Configuration
2+
3+
Here are the steps required to specify extra SAML properties:
4+
5+
>Note: The guided setup will set these Code Dx SAML parameters:
6+
- auth.saml2.identityProviderMetadataPath
7+
- auth.saml2.entityId
8+
- auth.saml2.keystorePassword
9+
- auth.saml2.privateKeyPassword
10+
- auth.hostBasePath
11+
12+
1) Complete the guided setup to determine the setup command(s) for deploying Code Dx on your Kubernetes cluster. End the guided setup by using one of the options to save your setup command to a file.
13+
14+
2) Create a file named `codedx-extra-props.yaml` and add your SAML properties and values:
15+
16+
```
17+
codedxProps:
18+
extra:
19+
- type: values
20+
key: codedx-extra-saml-props
21+
values:
22+
- "ui.auth.samlLabel = Keycloak"
23+
- "auth.autoExternalRedirect = false"
24+
```
25+
26+
>Note: Use spaces for the indents shown above. Indenting with tab characters will cause a failure at install-time.
27+
28+
3) Locate the run-setup.ps1 file generated by guided-setup.ps1 and make a copy named run-setup-custom.ps1. Edit run-setup-custom.ps1 by appending the following parameter to the setup.ps1 command line, specifying the path to your codedx-extra-props.yaml file:
29+
30+
```
31+
-extraCodeDxValuesPaths '/path/to/codedx-extra-props.yaml'
32+
```
33+
34+
4) Follow the instructions provided at the end of guided-setup.ps1, but replace the run-setup.ps1 reference with run-setup-custom.ps1:
35+
36+
```
37+
pwsh "/path/to/run-prereqs.ps1"
38+
pwsh "/path/to/run-setup-custom.ps1"
39+
```
40+
41+
>Note: You will have a run-prereqs.ps1 file if you selected the Save command with Kubernetes secret(s) option when saving your setup command.

setup/steps/authentication.ps1

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,3 +247,43 @@ will use to connect to your SAML identify provider.
247247
$this.config.samlPrivateKeyPwd = ''
248248
}
249249
}
250+
251+
class SamlExtraConfig : Step {
252+
static [string] hidden $description = @'
253+
The setup script will configure the following Code Dx SAML properties based on
254+
the information you have provided thus far:
255+
256+
- auth.saml2.identityProviderMetadataPath
257+
- auth.saml2.entityId
258+
- auth.saml2.keystorePassword
259+
- auth.saml2.privateKeyPassword
260+
- auth.hostBasePath
261+
262+
You can find the entire list of Code Dx SAML properties at
263+
https://codedx.com/Documentation/InstallGuide.html#SAMLConfiguration
264+
265+
To configure additional SAML properties, follow these instructions:
266+
https://github.com/codedx/codedx-kubernetes/blob/master/setup/core/docs/auth/use-saml.md
267+
'@
268+
269+
SamlExtraConfig([ConfigInput] $config) : base(
270+
[SamlExtraConfig].Name,
271+
$config,
272+
'SAML Extra Config',
273+
[SamlExtraConfig]::description,
274+
'Do you want to continue?') {}
275+
276+
[IQuestion]MakeQuestion([string] $prompt) {
277+
return new-object MultipleChoiceQuestion($prompt,
278+
[tuple]::create('&Yes', 'Yes, continue to the next step'),
279+
-1)
280+
}
281+
282+
[bool]HandleResponse([IQuestion] $question) {
283+
return $true
284+
}
285+
286+
[bool]CanRun() {
287+
return $this.config.useSaml
288+
}
289+
}

test/guided-setup.tests.ps1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11

2+
3+
Import-Module 'pester' -ErrorAction SilentlyContinue
4+
if (-not $?) {
5+
Write-Host 'Pester is not installed, so this test cannot run. Run pwsh, install the Pester module (Install-Module Pester), and re-run this script.'
6+
exit 1
7+
}
8+
29
$location = join-path $PSScriptRoot '..'
310
push-location ($location)
411

test/mock.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
Import-Module 'pester'
21

32
function New-Mocks() {
43

test/pass.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,7 @@ function Set-UseSamlPass([int] $saveOption) {
558558
$global:inputs.enqueue((New-Password 'my-keystore-password')) # specify keystore pwd confirm
559559
$global:inputs.enqueue((New-Password 'my-private-key-password')) # specify private key pwd
560560
$global:inputs.enqueue((New-Password 'my-private-key-password')) # specify private key pwd confirm
561+
$global:inputs.enqueue(0) # continue past instructions
561562
$global:inputs.enqueue(1) # skip cpu reservation
562563
$global:inputs.enqueue(1) # skip memory reservation
563564
$global:inputs.enqueue(1) # skip storage reservation

0 commit comments

Comments
 (0)