diff --git a/src/main/java/hudson/plugins/active_directory/ActiveDirectoryDomain.java b/src/main/java/hudson/plugins/active_directory/ActiveDirectoryDomain.java index c788a7d2..413620b6 100644 --- a/src/main/java/hudson/plugins/active_directory/ActiveDirectoryDomain.java +++ b/src/main/java/hudson/plugins/active_directory/ActiveDirectoryDomain.java @@ -32,6 +32,7 @@ import hudson.util.ListBoxModel; import hudson.util.Secret; import jenkins.model.Jenkins; +import jenkins.security.FIPS140; import org.acegisecurity.BadCredentialsException; import org.apache.commons.lang.StringUtils; import org.kohsuke.accmod.Restricted; @@ -41,14 +42,11 @@ import org.kohsuke.stapler.interceptor.RequirePOST; import javax.naming.CommunicationException; -import javax.naming.Context; import javax.naming.NamingException; import javax.naming.ServiceUnavailableException; import javax.naming.directory.Attribute; import javax.naming.directory.Attributes; import javax.naming.directory.DirContext; -import javax.naming.directory.InitialDirContext; -import javax.servlet.ServletException; import java.io.IOException; import java.io.Serializable; import java.util.ArrayList; @@ -149,6 +147,11 @@ public ActiveDirectoryDomain(String name, String servers, String site, String bi @DataBoundConstructor public ActiveDirectoryDomain(String name, String servers, String site, String bindName, String bindPassword, TlsConfiguration tlsConfiguration) { this.name = name; + // Gives exception if Password is set lees than 14 chars long in FIPS mode. + if(FIPS140.useCompliantAlgorithms() && StringUtils.length(bindPassword) < 14) { + throw new IllegalArgumentException(Messages.passwordTooShortFIPS()); + } + // Append default port if not specified servers = fixEmpty(servers); if (servers != null) { @@ -266,6 +269,18 @@ public ListBoxModel doFillTlsConfigurationItems() { return model; } + /** + * Displays an error message if the provided password is less than 14 characters + * while in FIPS mode. This message is triggered when the bindPassword field loses focus. + */ + @RequirePOST + public FormValidation doCheckBindPassword(@QueryParameter String bindPassword) { + if(FIPS140.useCompliantAlgorithms() && StringUtils.length(bindPassword) < 14) { + return FormValidation.error(Messages.passwordTooShortFIPS()); + } + return FormValidation.ok(); + } + @RequirePOST public FormValidation doValidateTest(@QueryParameter(fixEmpty = true) String name, @QueryParameter(fixEmpty = true) String servers, @QueryParameter(fixEmpty = true) String site, @QueryParameter(fixEmpty = true) String bindName, @QueryParameter(fixEmpty = true) String bindPassword, @QueryParameter(fixEmpty = true) TlsConfiguration tlsConfiguration, @QueryParameter GroupLookupStrategy groupLookupStrategy, diff --git a/src/main/java/hudson/plugins/active_directory/ActiveDirectorySecurityRealm.java b/src/main/java/hudson/plugins/active_directory/ActiveDirectorySecurityRealm.java index 50cd953b..2cd54a17 100644 --- a/src/main/java/hudson/plugins/active_directory/ActiveDirectorySecurityRealm.java +++ b/src/main/java/hudson/plugins/active_directory/ActiveDirectorySecurityRealm.java @@ -25,7 +25,6 @@ import com4j.typelibs.ado20.ClassFactory; - import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import hudson.Extension; diff --git a/src/main/resources/hudson/plugins/active_directory/Messages.properties b/src/main/resources/hudson/plugins/active_directory/Messages.properties index 13a01143..49cb16df 100644 --- a/src/main/resources/hudson/plugins/active_directory/Messages.properties +++ b/src/main/resources/hudson/plugins/active_directory/Messages.properties @@ -14,5 +14,4 @@ TlsConfiguration.JdkTrustStore = JDK TrustStore TlsConfiguration.AdministrativeMonitor.DisplayName = Active Directory TLS Configuration Monitor TlsConfiguration.ErrorMessage = Disabling TLS in FIPS mode is not allowed. Either enable StartTls or Require TLS. - passwordTooShortFIPS = Password is too short (< 14 characters) \ No newline at end of file diff --git a/src/test/java/hudson/plugins/active_directory/ActiveDirectoryDomainIntegrationTest.java b/src/test/java/hudson/plugins/active_directory/ActiveDirectoryDomainIntegrationTest.java new file mode 100644 index 00000000..1b72abc4 --- /dev/null +++ b/src/test/java/hudson/plugins/active_directory/ActiveDirectoryDomainIntegrationTest.java @@ -0,0 +1,164 @@ +package hudson.plugins.active_directory; + +import org.htmlunit.FailingHttpStatusCodeException; +import org.htmlunit.html.HtmlButton; +import org.htmlunit.html.HtmlElement; +import org.htmlunit.html.HtmlForm; +import org.htmlunit.html.HtmlInput; +import org.htmlunit.html.HtmlPage; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; +import org.jvnet.hudson.test.FlagRule; +import org.jvnet.hudson.test.JenkinsRule; +import org.jvnet.hudson.test.recipes.LocalData; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.assertEquals; + +public class ActiveDirectoryDomainIntegrationTest { + @Rule + public JenkinsRule jenkins = new JenkinsRule(); + + @Rule + public ExpectedException thrown = ExpectedException.none(); + + @ClassRule + public static FlagRule fipsSystemPropertyRule = + FlagRule.systemProperty("jenkins.security.FIPS140.COMPLIANCE", "true"); + + + /** + * Tests the behavior of the "Save" button when a short password is configured. + * + *

For the preconfigured value, the password is "small" in the local data. + * When the "Save" button is clicked, an exception is expected because the password + * does not meet the minimum length requirement.

+ * + */ + @LocalData + @Test + public void testActiveDirectoryDomainSaveButtonClick() throws Exception { + JenkinsRule.WebClient webClient = jenkins.createWebClient(); + // Navigate to the configuration page + HtmlPage configPage = webClient.goTo("configureSecurity"); + HtmlForm form = configPage.getFormByName("config"); + + //Check that the password is too short message is present + assertTrue(form.asNormalizedText().contains(Messages.passwordTooShortFIPS())); + + // Expect FailingHttpStatusCodeException + thrown.expect(FailingHttpStatusCodeException.class); + + // Find the "Submit" button and click it + getButtonByText(form, "Save").click(); + } + + /** + * Tests the behavior of the "Save" button when a short password is configured. + * + *

For the preconfigured value, the password is "small" in the local data. + * When the "Apply" button is clicked, an exception is expected because the password + * does not meet the minimum length requirement.

+ * + */ + @LocalData + @Test + public void testActiveDirectoryDomainApplyButtonClick() throws Exception { + JenkinsRule.WebClient webClient = jenkins.createWebClient(); + // Navigate to the configuration page + HtmlPage configPage = webClient.goTo("configureSecurity"); + HtmlForm form = configPage.getFormByName("config"); + + //Check that the password is too short message is present + assertTrue(form.asNormalizedText().contains(Messages.passwordTooShortFIPS())); + + // Expect FailingHttpStatusCodeException + thrown.expect(FailingHttpStatusCodeException.class); + + // Find the "Apply" button and click it + getButtonByText(form, "Apply").click(); + } + + /** + * Tests the behavior of the "Apply" button when a valid password is initially configured. then updated to a + * short password + * + *

For the preconfigured value, the password is "samell" in the local data. + * When the "Apply" button is clicked, an exception is expected because the password + * does not meet the minimum length requirement.

+ * + */ + @LocalData + @Test + public void testActiveDirectoryDomainSettingShortPassword() throws Exception { + JenkinsRule.WebClient webClient = jenkins.createWebClient(); + // Navigate to the configuration page + HtmlPage configPage = webClient.goTo("configureSecurity"); + HtmlForm form = configPage.getFormByName("config"); + + //Since password is valid is should not contain password too short message + assertFalse(form.asNormalizedText().contains(Messages.passwordTooShortFIPS())); + //Since password is valid, it should not throw exception oon clicking apply + assertEquals(200, getButtonByText(form, "Apply").click().getWebResponse().getStatusCode()); + + // Find the binf password filed and set an invalid password + HtmlInput bindPasswordField = form.getInputByName("_.bindPassword"); + bindPasswordField.setValueAttribute("small"); // Replace with your password value + + // Expect FailingHttpStatusCodeException + thrown.expect(FailingHttpStatusCodeException.class); + + // Find the "Submit" button and click it + getButtonByText(form, "Apply").click(); + } + + /** + * Tests the behavior of the "Test Domain" button when a short password is configured. + * + *

For the preconfigured value, the password is "small" in the local data. + * When the "Test Domain" button is clicked, the page should display an error message + * indicating that the password is too short, along with an "angry Jenkins" error message.

+ * + */ + @LocalData + @Test + public void testActiveDirectoryDomainTestDomainButtonClickWithShortPassword() throws Exception { + JenkinsRule.WebClient webClient = jenkins.createWebClient(); + // Navigate to the configuration page + HtmlPage configPage = webClient.goTo("configureSecurity"); + + // Wait for JavaScript to finish loading the page + webClient.waitForBackgroundJavaScript(5000); + HtmlForm form = configPage.getFormByName("config"); + + // Wait for JavaScript to finish loading the page + webClient.waitForBackgroundJavaScript(5000); + //Check that the password is too short message is present + assertTrue(form.asNormalizedText().contains(Messages.passwordTooShortFIPS())); + + // Click the "Test Domain" button + HtmlPage resultPage = getButtonByText(form, "Test Domain").click(); + + webClient.waitForBackgroundJavaScript(2000); // Wait for up to 5 seconds + + String responseContent = resultPage.asNormalizedText(); + // Assert that the error message is present in the page content + assertTrue(responseContent.contains("A problem occurred while processing the request")); + + //Check that the password is too short message is present + assertTrue(responseContent.contains(Messages.passwordTooShortFIPS())); + } + + private HtmlButton getButtonByText(HtmlForm form, String text) throws Exception { + for (HtmlElement e : form.getElementsByTagName("button")) { + if (e.getTextContent().contains(text)) { + return ((HtmlButton) e); + } + } + throw new AssertionError(String.format("Button [%s] not found", text)); + } + +} diff --git a/src/test/java/hudson/plugins/active_directory/ActiveDirectoryDomainTest.java b/src/test/java/hudson/plugins/active_directory/ActiveDirectoryDomainTest.java new file mode 100644 index 00000000..0561d2b4 --- /dev/null +++ b/src/test/java/hudson/plugins/active_directory/ActiveDirectoryDomainTest.java @@ -0,0 +1,66 @@ +package hudson.plugins.active_directory; + +import org.junit.ClassRule; +import org.junit.Test; +import org.jvnet.hudson.test.FlagRule; + +import hudson.util.FormValidation; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThrows; + +public class ActiveDirectoryDomainTest { + + + private ActiveDirectorySecurityRealm securityRealm; + private AbstractActiveDirectoryAuthenticationProvider authenticationProvider; + + @ClassRule + public static FlagRule fipsSystemPropertyRule = + FlagRule.systemProperty("jenkins.security.FIPS140.COMPLIANCE", "true"); + + + @Test + public void testPasswordTooShortInFIPSMode() { + // Create an instance of ActiveDirectoryDomain with a short password and assert exception + IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> { + new ActiveDirectoryDomain("example.com", "server", "site", "bindName", "short", TlsConfiguration.JDK_TRUSTSTORE); + }); + + // Verify the exception message + assertEquals(Messages.passwordTooShortFIPS(), exception.getMessage()); + } + + @Test + public void testPasswordValidInFIPSMode() { + // Create an instance of ActiveDirectoryDomain with a valid password + ActiveDirectoryDomain domain = new ActiveDirectoryDomain("example.com", "server", "site", "bindName", "validPassword123", TlsConfiguration.JDK_TRUSTSTORE); + + // Verify the domain object is created successfully + assertEquals("example.com", domain.getName()); + assertEquals("server:3268", domain.getServers()); + assertEquals("site", domain.getSite()); + assertEquals("bindName", domain.getBindName()); + assertEquals("validPassword123", domain.getBindPassword().getPlainText()); + } + + @Test + public void testDoCheckBindPasswordFIPSModeShortPassword() { + // Create an instance of the DescriptorImpl class + ActiveDirectoryDomain.DescriptorImpl descriptor = new ActiveDirectoryDomain.DescriptorImpl(); + + // Test with a password less than 14 characters + FormValidation result = descriptor.doCheckBindPassword("shortPass"); + assertEquals(FormValidation.error(Messages.passwordTooShortFIPS()).getMessage(), result.getMessage()); + } + + @Test + public void testDoCheckBindPasswordFIPSModeValidPassword() { + // Create an instance of the DescriptorImpl class + ActiveDirectoryDomain.DescriptorImpl descriptor = new ActiveDirectoryDomain.DescriptorImpl(); + + // Test with a password of 14 characters or more + FormValidation result = descriptor.doCheckBindPassword("validPassword123"); + assertEquals(FormValidation.ok().getMessage(), result.getMessage()); + } +} \ No newline at end of file diff --git a/src/test/java/hudson/plugins/active_directory/ActiveDirectoryJCasCCompatibilityFIPSModeShortPasswordTest.java b/src/test/java/hudson/plugins/active_directory/ActiveDirectoryJCasCCompatibilityFIPSModeShortPasswordTest.java new file mode 100644 index 00000000..b4fa11f0 --- /dev/null +++ b/src/test/java/hudson/plugins/active_directory/ActiveDirectoryJCasCCompatibilityFIPSModeShortPasswordTest.java @@ -0,0 +1,52 @@ +package hudson.plugins.active_directory; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.Objects; + +import org.apache.commons.io.IOUtils; +import org.junit.Assert; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; +import org.junit.rules.TestRule; +import org.jvnet.hudson.test.FlagRule; +import org.jvnet.hudson.test.RestartableJenkinsRule; +import io.jenkins.plugins.casc.ConfigurationAsCode; +import io.jenkins.plugins.casc.ConfiguratorException; + +public class ActiveDirectoryJCasCCompatibilityFIPSModeShortPasswordTest { + + @Rule + public RestartableJenkinsRule r = new RestartableJenkinsRule(); + + @ClassRule + public static TestRule fip140Prop = FlagRule.systemProperty("jenkins.security.FIPS140.COMPLIANCE", "true"); + + @Rule + public ExpectedException thrown = ExpectedException.none(); + + @Test + public void checkOfIncorrectConfigurationsWithShortPasswordInFIPSMode() throws IOException { + thrown.expect(IllegalStateException.class); + + String resourcePath = "configuration-as-code-fips-short-password.yaml"; + String resourceContent = this.getResourceContent(resourcePath); + Assert.assertNotNull(resourcePath); + Assert.assertNotNull(resourceContent); + this.r.then((step) -> { + this.configureWithResource(resourcePath); + }); + } + + private String getResourceContent(String resourcePath) throws IOException { + return IOUtils.toString(Objects.requireNonNull(this.getClass().getResourceAsStream(resourcePath)) + , StandardCharsets.UTF_8); + } + + private void configureWithResource(String config) throws ConfiguratorException { + ConfigurationAsCode.get().configure(new String[]{ this.getClass().getResource(config).toExternalForm()}); + } + +} diff --git a/src/test/java/hudson/plugins/active_directory/ActiveDirectoryJCasCCompatibilityFIPSModeValidPasswordTest.java b/src/test/java/hudson/plugins/active_directory/ActiveDirectoryJCasCCompatibilityFIPSModeValidPasswordTest.java new file mode 100644 index 00000000..4e28cacd --- /dev/null +++ b/src/test/java/hudson/plugins/active_directory/ActiveDirectoryJCasCCompatibilityFIPSModeValidPasswordTest.java @@ -0,0 +1,61 @@ +package hudson.plugins.active_directory; + +import org.junit.ClassRule; +import org.junit.rules.TestRule; +import org.jvnet.hudson.test.FlagRule; +import org.jvnet.hudson.test.RestartableJenkinsRule; +import io.jenkins.plugins.casc.misc.RoundTripAbstractTest; + +import jenkins.model.Jenkins; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +public class ActiveDirectoryJCasCCompatibilityFIPSModeValidPasswordTest extends RoundTripAbstractTest { + + @ClassRule + public static TestRule fip140Prop = FlagRule.systemProperty("jenkins.security.FIPS140.COMPLIANCE", "true"); + + @Override + protected void assertConfiguredAsExpected(RestartableJenkinsRule restartableJenkinsRule, String s) { + final Jenkins jenkins = Jenkins.getInstance(); + final ActiveDirectorySecurityRealm realm = (ActiveDirectorySecurityRealm) jenkins.getSecurityRealm(); + + assertEquals(1, realm.domains.size()); + ActiveDirectoryDomain domain = realm.domains.get(0); + assertEquals("acme", domain.name); + assertEquals("admin", domain.bindName); + assertEquals("ad1.acme.com:123,ad2.acme.com:456", domain.servers); + assertEquals("site", domain.getSite()); + assertEquals("veryLargePassword", domain.getBindPassword().getPlainText()); // check for valid password + assertEquals(TlsConfiguration.JDK_TRUSTSTORE, domain.getTlsConfiguration()); + + assertEquals(2, realm.getEnvironmentProperties().size()); + ActiveDirectorySecurityRealm.EnvironmentProperty prop = realm.getEnvironmentProperties().get(0); + assertEquals("prop1", prop.getName()); + assertEquals("value1", prop.getValue()); + prop = realm.getEnvironmentProperties().get(1); + assertEquals("prop2", prop.getName()); + assertEquals("value2", prop.getValue()); + + assertTrue(realm.removeIrrelevantGroups); + assertTrue(realm.startTls); + assertEquals("jenkins", realm.getJenkinsInternalUser()); + assertEquals(GroupLookupStrategy.RECURSIVE, realm.getGroupLookupStrategy()); + assertNotNull(realm.getCache()); + assertEquals(500, realm.getCache().getSize()); + assertEquals(600, realm.getCache().getTtl()); + } + + @Override + protected String configResource(){ + return "configuration-as-code-fips-valid-password.yaml"; + } + + + @Override + protected String stringInLogExpected() { + return "Setting class hudson.plugins.active_directory.ActiveDirectorySecurityRealm.groupLookupStrategy = RECURSIVE"; + } +} diff --git a/src/test/java/hudson/plugins/active_directory/ActiveDirectoryLoginInFIPSModeIntegrationTest.java b/src/test/java/hudson/plugins/active_directory/ActiveDirectoryLoginInFIPSModeIntegrationTest.java index 5ef2124b..c41fdc49 100644 --- a/src/test/java/hudson/plugins/active_directory/ActiveDirectoryLoginInFIPSModeIntegrationTest.java +++ b/src/test/java/hudson/plugins/active_directory/ActiveDirectoryLoginInFIPSModeIntegrationTest.java @@ -4,18 +4,24 @@ import java.util.List; import org.htmlunit.FailingHttpStatusCodeException; +import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; +import org.jvnet.hudson.test.FlagRule; import org.jvnet.hudson.test.JenkinsRule; public class ActiveDirectoryLoginInFIPSModeIntegrationTest { @Rule public JenkinsRule j = new JenkinsRule(); + @ClassRule + public static FlagRule fipsSystemPropertyRule = + FlagRule.systemProperty("jenkins.security.FIPS140.COMPLIANCE", "true"); + @Test(expected = FailingHttpStatusCodeException.class) public void testLoginFailureWithShortPasswordInFIPSmode() throws Exception { ActiveDirectoryDomain activeDirectoryDomain = new ActiveDirectoryDomain("samdom.example.com", "localhost:3268" - , "site", "Administrator", "ia4uV1EeKait"); + , "site", "Administrator", "verlargebindpassword"); List domains = new ArrayList<>(1); domains.add(activeDirectoryDomain); ActiveDirectorySecurityRealm activeDirectorySecurityRealm = new ActiveDirectorySecurityRealm(null, domains, null, null, null diff --git a/src/test/java/hudson/plugins/active_directory/ActiveDirectoryLoginInFIPSModeTest.java b/src/test/java/hudson/plugins/active_directory/ActiveDirectoryLoginInFIPSModeTest.java index c076c856..04925f6e 100644 --- a/src/test/java/hudson/plugins/active_directory/ActiveDirectoryLoginInFIPSModeTest.java +++ b/src/test/java/hudson/plugins/active_directory/ActiveDirectoryLoginInFIPSModeTest.java @@ -1,18 +1,13 @@ package hudson.plugins.active_directory; import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.List; import org.acegisecurity.providers.UsernamePasswordAuthenticationToken; import org.acegisecurity.userdetails.UserDetails; -import org.htmlunit.FailingHttpStatusCodeException; import org.junit.Before; import org.junit.ClassRule; -import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.FlagRule; -import org.jvnet.hudson.test.JenkinsRule; import org.mockito.Mockito; import org.springframework.security.authentication.AuthenticationServiceException; diff --git a/src/test/resources/hudson/plugins/active_directory/ActiveDirectoryDomainIntegrationTest/testActiveDirectoryDomainApplyButtonClick/config.xml b/src/test/resources/hudson/plugins/active_directory/ActiveDirectoryDomainIntegrationTest/testActiveDirectoryDomainApplyButtonClick/config.xml new file mode 100644 index 00000000..56403a15 --- /dev/null +++ b/src/test/resources/hudson/plugins/active_directory/ActiveDirectoryDomainIntegrationTest/testActiveDirectoryDomainApplyButtonClick/config.xml @@ -0,0 +1,50 @@ + + + + 1.0 + 2 + NORMAL + true + + + + + samdom.example.com + CN=Administrator,CN=Users,DC=samdom,DC=example,DC=com + small + TRUST_ALL_CERTIFICATES + admin + + + true + RECURSIVE + false + + admin + + + false + + ${ITEM_ROOTDIR}/workspace + ${ITEM_ROOTDIR}/builds + + + + + + 0 + + + + All + false + false + + + + All + -1 + + + + \ No newline at end of file diff --git a/src/test/resources/hudson/plugins/active_directory/ActiveDirectoryDomainIntegrationTest/testActiveDirectoryDomainSaveButtonClick/config.xml b/src/test/resources/hudson/plugins/active_directory/ActiveDirectoryDomainIntegrationTest/testActiveDirectoryDomainSaveButtonClick/config.xml new file mode 100644 index 00000000..56403a15 --- /dev/null +++ b/src/test/resources/hudson/plugins/active_directory/ActiveDirectoryDomainIntegrationTest/testActiveDirectoryDomainSaveButtonClick/config.xml @@ -0,0 +1,50 @@ + + + + 1.0 + 2 + NORMAL + true + + + + + samdom.example.com + CN=Administrator,CN=Users,DC=samdom,DC=example,DC=com + small + TRUST_ALL_CERTIFICATES + admin + + + true + RECURSIVE + false + + admin + + + false + + ${ITEM_ROOTDIR}/workspace + ${ITEM_ROOTDIR}/builds + + + + + + 0 + + + + All + false + false + + + + All + -1 + + + + \ No newline at end of file diff --git a/src/test/resources/hudson/plugins/active_directory/ActiveDirectoryDomainIntegrationTest/testActiveDirectoryDomainSettingShortPassword/config.xml b/src/test/resources/hudson/plugins/active_directory/ActiveDirectoryDomainIntegrationTest/testActiveDirectoryDomainSettingShortPassword/config.xml new file mode 100644 index 00000000..0263de3a --- /dev/null +++ b/src/test/resources/hudson/plugins/active_directory/ActiveDirectoryDomainIntegrationTest/testActiveDirectoryDomainSettingShortPassword/config.xml @@ -0,0 +1,50 @@ + + + + 1.0 + 2 + NORMAL + true + + + + + samdom.example.com + CN=Administrator,CN=Users,DC=samdom,DC=example,DC=com + verylargepassword12345 + TRUST_ALL_CERTIFICATES + admin + + + true + RECURSIVE + false + + admin + + + false + + ${ITEM_ROOTDIR}/workspace + ${ITEM_ROOTDIR}/builds + + + + + + 0 + + + + All + false + false + + + + All + -1 + + + + \ No newline at end of file diff --git a/src/test/resources/hudson/plugins/active_directory/ActiveDirectoryDomainIntegrationTest/testActiveDirectoryDomainTestDomainButtonClickWithShortPassword/config.xml b/src/test/resources/hudson/plugins/active_directory/ActiveDirectoryDomainIntegrationTest/testActiveDirectoryDomainTestDomainButtonClickWithShortPassword/config.xml new file mode 100644 index 00000000..5a3f5332 --- /dev/null +++ b/src/test/resources/hudson/plugins/active_directory/ActiveDirectoryDomainIntegrationTest/testActiveDirectoryDomainTestDomainButtonClickWithShortPassword/config.xml @@ -0,0 +1,46 @@ + + + + 1.0 + 2 + NORMAL + true + + + + + samdom.example.com + CN=Administrator,CN=Users,DC=samdom,DC=example,DC=com + small + TRUST_ALL_CERTIFICATES + + + true + RECURSIVE + false + + false + + ${ITEM_ROOTDIR}/workspace + ${ITEM_ROOTDIR}/builds + + + + + + 0 + + + + All + false + false + + + + All + -1 + + + + \ No newline at end of file diff --git a/src/test/resources/hudson/plugins/active_directory/configuration-as-code-fips-short-password.yaml b/src/test/resources/hudson/plugins/active_directory/configuration-as-code-fips-short-password.yaml new file mode 100644 index 00000000..4607096c --- /dev/null +++ b/src/test/resources/hudson/plugins/active_directory/configuration-as-code-fips-short-password.yaml @@ -0,0 +1,24 @@ +jenkins: + securityRealm: + activeDirectory: + cache: + size: 500 + ttl: 600 + customDomain: true + domains: + - bindName: "admin" + bindPassword: "shortpass" + name: "acme" + servers: "ad1.acme.com:123,ad2.acme.com:456" + site: "site" + tlsConfiguration: JDK_TRUSTSTORE + environmentProperties: + - name: "prop1" + value: "value1" + - name: "prop2" + value: "value2" + groupLookupStrategy: RECURSIVE + internalUsersDatabase: + jenkinsInternalUser: "jenkins" + removeIrrelevantGroups: true + startTls: true diff --git a/src/test/resources/hudson/plugins/active_directory/configuration-as-code-fips-valid-password.yaml b/src/test/resources/hudson/plugins/active_directory/configuration-as-code-fips-valid-password.yaml new file mode 100644 index 00000000..a4eb8a92 --- /dev/null +++ b/src/test/resources/hudson/plugins/active_directory/configuration-as-code-fips-valid-password.yaml @@ -0,0 +1,24 @@ +jenkins: + securityRealm: + activeDirectory: + cache: + size: 500 + ttl: 600 + customDomain: true + domains: + - bindName: "admin" + bindPassword: "veryLargePassword" + name: "acme" + servers: "ad1.acme.com:123,ad2.acme.com:456" + site: "site" + tlsConfiguration: JDK_TRUSTSTORE + environmentProperties: + - name: "prop1" + value: "value1" + - name: "prop2" + value: "value2" + groupLookupStrategy: RECURSIVE + internalUsersDatabase: + jenkinsInternalUser: "jenkins" + removeIrrelevantGroups: true + startTls: true