Turn on DNSSEC for new Cloud DNS TLDs

we set the "denial of existence" to NSEC (rather than NSEC3), because preventing "walking the zone" isn't an issue for TLDs.

It uses the default security configuration for everything else, which at the time of this writing is:

Key signing: RSASHA256, key length of 2048
Zone signing: RSASHA256, key length of 1024

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=179045575
This commit is contained in:
guyben 2017-12-14 08:06:13 -08:00 committed by Ben McIlwain
parent 0d3ec66259
commit d5d29959b4
2 changed files with 25 additions and 15 deletions

View file

@ -20,6 +20,7 @@ import static org.mockito.Mockito.when;
import com.google.api.services.dns.Dns;
import com.google.api.services.dns.model.ManagedZone;
import com.google.api.services.dns.model.ManagedZoneDnsSecConfig;
import java.io.IOException;
import java.security.GeneralSecurityException;
import org.junit.Before;
@ -55,23 +56,29 @@ public class CreateCdnsTldTest extends CommandTestCase<CreateCdnsTld> {
}
}
private ManagedZone createZone(
String nameServerSet, String description, String dnsName, String name) {
return new ManagedZone()
.setNameServerSet(nameServerSet)
.setDnsName(dnsName)
.setDescription(description)
.setName(name)
.setDnssecConfig(new ManagedZoneDnsSecConfig().setState("ON").setNonExistence("NSEC"));
}
@Test
public void testBasicFunctionality() throws Exception {
runCommand("--dns_name=tld.", "--name=tld", "--description=test run", "--force");
verify(request).execute();
assertThat(projectId.getValue()).isEqualTo("test-project");
ManagedZone zone = requestBody.getValue();
assertThat(zone.getNameServerSet()).isEqualTo("cloud-dns-registry-test");
assertThat(zone.getDnsName()).isEqualTo("tld.");
assertThat(zone.getName()).isEqualTo("tld");
assertThat(zone).isEqualTo(createZone("cloud-dns-registry-test", "test run", "tld.", "tld"));
}
@Test
public void testNameDefault() throws Exception {
runCommand("--dns_name=tld.", "--description=test run", "--force");
ManagedZone zone = requestBody.getValue();
assertThat(zone.getNameServerSet()).isEqualTo("cloud-dns-registry-test");
assertThat(zone.getDnsName()).isEqualTo("tld.");
assertThat(zone.getName()).isEqualTo("tld.");
assertThat(zone).isEqualTo(createZone("cloud-dns-registry-test", "test run", "tld.", "tld."));
}
}