public Settings(UiSecurity uiSecurity) { setOverrideBaseUrl(uiSecurity.getOverrideBaseUrl()); if (uiSecurity.getSsl().isEnabled()) { scheme = "https"; } } }
public Settings(UiSecurity uiSecurity) { setOverrideBaseUrl(uiSecurity.getOverrideBaseUrl()); if (uiSecurity.getSsl().isEnabled()) { scheme = "https"; } } }
@Override public void validate(ConfigProblemSetBuilder p, Security n) { DeploymentConfiguration deploymentConfiguration = n.parentOfType(DeploymentConfiguration.class); boolean localhostAccess = StringUtils.isEmpty(n.getApiSecurity().getOverrideBaseUrl()) || StringUtils.isEmpty(n.getUiSecurity().getOverrideBaseUrl()) ; switch (deploymentConfiguration.getDeploymentEnvironment().getType()) { case Distributed: if (localhostAccess) { p.addProblem(Problem.Severity.WARNING, "Your UI or API domain does not have override base URLs set " + "even though your Spinnaker deployment is a Distributed deployment on a remote cloud provider. " + "As a result, you will need to open SSH tunnels against that deployment to access Spinnaker.") .setRemediation("We recommend that you instead configure an authentication mechanism (OAuth2, SAML2, or x509) " + "to make it easier to access Spinnaker securely, and then register the intended Domain and IP addresses " + "that your publicly facing services will be using."); // TODO(lwander) point to a guide here } break; case LocalDebian: break; } } }
@Override public void validate(ConfigProblemSetBuilder p, Security n) { DeploymentConfiguration deploymentConfiguration = n.parentOfType(DeploymentConfiguration.class); boolean localhostAccess = StringUtils.isEmpty(n.getApiSecurity().getOverrideBaseUrl()) || StringUtils.isEmpty(n.getUiSecurity().getOverrideBaseUrl()) ; switch (deploymentConfiguration.getDeploymentEnvironment().getType()) { case Distributed: if (localhostAccess) { p.addProblem(Problem.Severity.WARNING, "Your UI or API domain does not have override base URLs set " + "even though your Spinnaker deployment is a Distributed deployment on a remote cloud provider. " + "As a result, you will need to open SSH tunnels against that deployment to access Spinnaker.") .setRemediation("We recommend that you instead configure an authentication mechanism (OAuth2, SAML2, or x509) " + "to make it easier to access Spinnaker securely, and then register the intended Domain and IP addresses " + "that your publicly facing services will be using."); // TODO(lwander) point to a guide here } break; case LocalDebian: break; } } }
@Override protected void executeThis() { String currentDeployment = getCurrentDeployment(); UiSecurity uiSecurity = new OperationHandler<UiSecurity>() .setOperation(Daemon.getUiSecurity(currentDeployment, false)) .setFailureMesssage("Failed to load UI security settings.") .get(); int originalHash = uiSecurity.hashCode(); uiSecurity.setOverrideBaseUrl(isSet(overrideBaseUrl) ? overrideBaseUrl : uiSecurity.getOverrideBaseUrl()); if (originalHash == uiSecurity.hashCode()) { AnsiUi.failure("No changes supplied."); return; } new OperationHandler<Void>() .setOperation(Daemon.setUiSecurity(currentDeployment, !noValidate, uiSecurity)) .setFailureMesssage("Failed to edit UI security settings.") .setSuccessMessage("Successfully updated UI security settings.") .get(); } }
@Override protected void executeThis() { String currentDeployment = getCurrentDeployment(); UiSecurity uiSecurity = new OperationHandler<UiSecurity>() .setOperation(Daemon.getUiSecurity(currentDeployment, false)) .setFailureMesssage("Failed to load UI security settings.") .get(); int originalHash = uiSecurity.hashCode(); uiSecurity.setOverrideBaseUrl(isSet(overrideBaseUrl) ? overrideBaseUrl : uiSecurity.getOverrideBaseUrl()); if (originalHash == uiSecurity.hashCode()) { AnsiUi.failure("No changes supplied."); return; } new OperationHandler<Void>() .setOperation(Daemon.setUiSecurity(currentDeployment, !noValidate, uiSecurity)) .setFailureMesssage("Failed to edit UI security settings.") .setSuccessMessage("Successfully updated UI security settings.") .get(); } }