use of com.hazelcast.config.SymmetricEncryptionConfig in project hazelcast by hazelcast.
the class DefaultNodeExtension method checkSecurityAllowed.
private void checkSecurityAllowed() {
SecurityConfig securityConfig = node.getConfig().getSecurityConfig();
if (securityConfig != null && securityConfig.isEnabled()) {
if (!BuildInfoProvider.getBuildInfo().isEnterprise()) {
throw new IllegalStateException("Security requires Hazelcast Enterprise Edition");
}
}
SymmetricEncryptionConfig symmetricEncryptionConfig = getActiveMemberNetworkConfig(node.getConfig()).getSymmetricEncryptionConfig();
if (symmetricEncryptionConfig != null && symmetricEncryptionConfig.isEnabled()) {
if (!BuildInfoProvider.getBuildInfo().isEnterprise()) {
throw new IllegalStateException("Symmetric Encryption requires Hazelcast Enterprise Edition");
}
}
AuditlogConfig auditlogConfig = node.getConfig().getAuditlogConfig();
if (auditlogConfig != null && auditlogConfig.isEnabled()) {
if (!BuildInfoProvider.getBuildInfo().isEnterprise()) {
throw new IllegalStateException("Auditlog requires Hazelcast Enterprise Edition");
}
}
}
use of com.hazelcast.config.SymmetricEncryptionConfig in project hazelcast by hazelcast.
the class SecurityWithoutEnterpriseTest method testSymmetricEncryption.
@Test
public void testSymmetricEncryption() {
SymmetricEncryptionConfig symmetricEncryptionConfig = new SymmetricEncryptionConfig().setEnabled(true);
Config config = new Config();
config.getNetworkConfig().setSymmetricEncryptionConfig(symmetricEncryptionConfig);
expected.expect(IllegalStateException.class);
createHazelcastInstance(config);
}
use of com.hazelcast.config.SymmetricEncryptionConfig in project hazelcast by hazelcast.
the class TestFullApplicationContext method testNetworkConfig.
@Test
public void testNetworkConfig() {
NetworkConfig networkConfig = config.getNetworkConfig();
assertNotNull(networkConfig);
assertEquals(5700, networkConfig.getPort());
assertTrue(networkConfig.isPortAutoIncrement());
Collection<String> allowedPorts = networkConfig.getOutboundPortDefinitions();
assertEquals(2, allowedPorts.size());
Iterator portIter = allowedPorts.iterator();
assertEquals("35000-35100", portIter.next());
assertEquals("36000,36100", portIter.next());
assertFalse(networkConfig.getJoin().getAutoDetectionConfig().isEnabled());
assertFalse(networkConfig.getJoin().getMulticastConfig().isEnabled());
assertEquals(networkConfig.getJoin().getMulticastConfig().getMulticastTimeoutSeconds(), 8);
assertEquals(networkConfig.getJoin().getMulticastConfig().getMulticastTimeToLive(), 16);
assertEquals(Boolean.FALSE, networkConfig.getJoin().getMulticastConfig().getLoopbackModeEnabled());
Set<String> tis = networkConfig.getJoin().getMulticastConfig().getTrustedInterfaces();
assertEquals(1, tis.size());
assertEquals("10.10.10.*", tis.iterator().next());
assertFalse(networkConfig.getInterfaces().isEnabled());
assertEquals(1, networkConfig.getInterfaces().getInterfaces().size());
assertEquals("10.10.1.*", networkConfig.getInterfaces().getInterfaces().iterator().next());
TcpIpConfig tcp = networkConfig.getJoin().getTcpIpConfig();
assertNotNull(tcp);
assertFalse(tcp.isEnabled());
SymmetricEncryptionConfig symmetricEncryptionConfig = networkConfig.getSymmetricEncryptionConfig();
assertFalse(symmetricEncryptionConfig.isEnabled());
assertEquals("PBEWithMD5AndDES", symmetricEncryptionConfig.getAlgorithm());
assertEquals("thesalt", symmetricEncryptionConfig.getSalt());
assertEquals("thepass", symmetricEncryptionConfig.getPassword());
assertEquals(19, symmetricEncryptionConfig.getIterationCount());
List<String> members = tcp.getMembers();
assertEquals(members.toString(), 2, members.size());
assertEquals("127.0.0.1:5700", members.get(0));
assertEquals("127.0.0.1:5701", members.get(1));
assertEquals("127.0.0.1:5700", tcp.getRequiredMember());
assertAwsConfig(networkConfig.getJoin().getAwsConfig());
assertGcpConfig(networkConfig.getJoin().getGcpConfig());
assertAzureConfig(networkConfig.getJoin().getAzureConfig());
assertKubernetesConfig(networkConfig.getJoin().getKubernetesConfig());
assertEurekaConfig(networkConfig.getJoin().getEurekaConfig());
assertTrue("reuse-address", networkConfig.isReuseAddress());
MemberAddressProviderConfig memberAddressProviderConfig = networkConfig.getMemberAddressProviderConfig();
assertFalse(memberAddressProviderConfig.isEnabled());
assertEquals("com.hazelcast.spring.DummyMemberAddressProvider", memberAddressProviderConfig.getClassName());
assertFalse(memberAddressProviderConfig.getProperties().isEmpty());
assertEquals("value", memberAddressProviderConfig.getProperties().getProperty("dummy.property"));
assertEquals("value2", memberAddressProviderConfig.getProperties().getProperty("dummy.property.2"));
IcmpFailureDetectorConfig icmpFailureDetectorConfig = networkConfig.getIcmpFailureDetectorConfig();
assertFalse(icmpFailureDetectorConfig.isEnabled());
assertTrue(icmpFailureDetectorConfig.isParallelMode());
assertTrue(icmpFailureDetectorConfig.isFailFastOnStartup());
assertEquals(500, icmpFailureDetectorConfig.getTimeoutMilliseconds());
assertEquals(1002, icmpFailureDetectorConfig.getIntervalMilliseconds());
assertEquals(2, icmpFailureDetectorConfig.getMaxAttempts());
assertEquals(1, icmpFailureDetectorConfig.getTtl());
}
Aggregations