Skip to content

Commit

Permalink
Datanode: ensure password_secret meets length requirement (#17719)
Browse files Browse the repository at this point in the history
* ensure password_secret meets length requirement

* update CL

* update test

* adjusted wording so it references the data node

---------

Co-authored-by: Jan Heise <jan.heise@graylog.com>
  • Loading branch information
patrickmann and janheise committed Dec 15, 2023
1 parent be7df67 commit a247edc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/issue-17523.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type = "c"
message = "Ensure password secret meets the minimum length requirement if using/for the DataNode."

issues = ["17523"]
pulls = ["17719"]
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ public Duration getIndexerJwtAuthTokenExpirationDuration() {
@ValidatorMethod
@SuppressWarnings("unused")
public void validatePasswordSecret() throws ValidationException {
if (passwordSecret == null || passwordSecret.length() < 16) {
throw new ValidationException("The minimum length for \"password_secret\" is 16 characters.");
if (passwordSecret == null || passwordSecret.length() < 64) {
throw new ValidationException("The minimum length for \"password_secret\" is 64 characters.");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.apache.commons.lang3.StringUtils;
import org.graylog.testing.completebackend.ContainerizedGraylogBackendServicesProvider.Services;
import org.graylog.testing.containermatrix.MongodbServer;
import org.graylog.testing.containermatrix.annotations.ContainerMatrixTestsConfiguration;
import org.graylog.testing.elasticsearch.SearchServerInstance;
import org.graylog.testing.graylognode.MavenPackager;
import org.graylog.testing.graylognode.NodeContainerConfig;
Expand All @@ -37,12 +36,11 @@
import java.util.Map;
import java.util.Optional;
import java.util.ServiceLoader;
import java.util.Set;
import java.util.stream.Collectors;

public class ContainerizedGraylogBackend implements GraylogBackend, AutoCloseable {
private static final Logger LOG = LoggerFactory.getLogger(ContainerizedGraylogBackend.class);
public static final String PASSWORD_SECRET = "M4lteserKreuzHerrStrack?-warZuKurzDeshalbMussdaNochWasdran";
public static final String PASSWORD_SECRET = "M4lteserKreuzHerrStrack?-warZuKurzDeshalbMussdaNochWasdranHasToBeAtLeastSixtyFourCharactersInLength";
public static final String ROOT_PASSWORD_PLAINTEXT = "admin";
public static final String ROOT_PASSWORD_SHA_2 = DigestUtils.sha256Hex(ROOT_PASSWORD_PLAINTEXT);

Expand Down

0 comments on commit a247edc

Please sign in to comment.