Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fedramp issues #10092

Merged
merged 9 commits into from Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -126,10 +126,13 @@ public class KsqlRestConfig extends AbstractConfig {

public static final String SSL_STORE_TYPE_JKS = "JKS";
public static final String SSL_STORE_TYPE_PKCS12 = "PKCS12";
public static final String SSL_STORE_TYPE_BCFKS = "BCFKS";

public static final ConfigDef.ValidString SSL_STORE_TYPE_VALIDATOR =
ConfigDef.ValidString.in(
SSL_STORE_TYPE_JKS,
SSL_STORE_TYPE_PKCS12
SSL_STORE_TYPE_PKCS12,
SSL_STORE_TYPE_BCFKS
Comment on lines 131 to +135
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't there a unit test you need to adapt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't there a unit test you need to adapt?

For the other two we don't have any.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

I think you need to adapt SSL_KEYSTORE_TYPE_DOC and SSL_TRUSTSTORE_TYPE_DOC, though.

);

public static final String SSL_CLIENT_AUTH_CONFIG = "ssl.client.auth";
Expand Down
Expand Up @@ -220,15 +220,9 @@ private static void validateCipherSuites(
final FipsValidator fipsValidator, final KsqlRestConfig restConfig) {
final Map<String, List<String>> fipsTlsMap = new HashMap<>();
final List<String> cipherSuites = restConfig.getList(KsqlRestConfig.SSL_CIPHER_SUITES_CONFIG);
if (cipherSuites.isEmpty()) {
final String errorMsg = "No cipher suites "
+ "('"
+ KsqlRestConfig.SSL_CIPHER_SUITES_CONFIG
+ "') is specified.";
log.error(errorMsg);
throw new SecurityException(errorMsg);
Comment on lines -223 to -229
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove this?

Based on info form CP team, ssl.cipher.suites must be an optional parameter.

if (!cipherSuites.isEmpty()) {
fipsTlsMap.put(KsqlRestConfig.SSL_CIPHER_SUITES_CONFIG, cipherSuites);
}
fipsTlsMap.put(KsqlRestConfig.SSL_CIPHER_SUITES_CONFIG, cipherSuites);
fipsTlsMap.put(KsqlRestConfig.SSL_ENABLED_PROTOCOLS_CONFIG,
restConfig.getList(KsqlRestConfig.SSL_ENABLED_PROTOCOLS_CONFIG));

Expand Down
Expand Up @@ -266,30 +266,6 @@ public void shouldFailOnInvalidDefaultValueFormat() {
"Invalid value for config '" + KsqlConfig.KSQL_DEFAULT_VALUE_FORMAT_CONFIG + "': bad"));
}

@Test
public void shouldFailOnEmptyCipherSuitesList() {
// Given:
final KsqlConfig config = configWith(ImmutableMap.of(
ConfluentConfigs.ENABLE_FIPS_CONFIG, true
));
final KsqlRestConfig restConfig = new KsqlRestConfig(ImmutableMap.<String, Object>builder()
.build()
);

// When:
final Exception e = assertThrows(
SecurityException.class,
() -> KsqlServerMain.validateFips(config, restConfig)
);

// Then:
assertThat(e.getMessage(), containsString(
"No cipher suites "
+ "('"
+ KsqlRestConfig.SSL_CIPHER_SUITES_CONFIG
+ "') is specified."));
}

@Test
public void shouldFailOnInvalidCipherSuitesList() {
// Given:
Expand Down