feat(network): add opt-in security group enforcement (#3681)

* feat(network): add opt-in security group enforcement

* fix(ec2): make security group tests order independent

* fix(network): emit valid ICMP nft rules and restart protected instances

Three review findings on the opt-in security-group enforcement foundation:

- SecurityGroupNftCompiler built "icmp type 8 code 0 accept" for an AWS
  ICMP rule carrying both FromPort (type) and ToPort (code). nftables
  header fields are separate expressions, so nft rejected the whole
  compiled policy and the manager then quarantined every endpoint. Each
  field now repeats the protocol keyword, and a protocol rule with no
  type or code becomes "meta l4proto icmp accept", which was equally
  invalid as a bare "icmp accept".
- StartInstances followed the legacy restart path for a protected
  workload and waited for a Docker bridge IP on a container that shares
  the helper's network namespace and so has no attachment of its own.
  The helper survives the workload's stop, so start now reuses its
  transport address exactly as launch does, and skips the reachable
  private address rewrite the same way.
- Replaced the newly introduced var declarations with explicit types and
  imported the inline java.util/model FQCNs, per AGENTS.md.

* fix(network): scope the firewall helper to CAP_NET_ADMIN

The helper only has to program nftables inside the namespace Docker already
gave it, so full --privileged granted far more than the feature needs.
ContainerLifecycleManager now adds CAP_NET_ADMIN for the container carrying
the floci.security-group-helper label, mirroring the capability drop already
applied to protected workloads at the same choke point, and the helper spec
no longer asks for privileged mode.

Also replaces the inline java.util FQCNs the previous commit missed in
Ec2Service with imports, per AGENTS.md.

---------

Co-authored-by: Alexy Grabov <Alexy.Grabov@cyberark.com>
This commit is contained in:
Alexy GrabovandAlexy Grabov authored and GitHub committed 2026-09-15 14:30:49 -04:00
1 parent a180c140a7
commit 7813d14ee4
27 files changed
+1621 -31

No files matched your search

@@ -9,6 +9,8 @@ import com.github.dockerjava.api.command.RemoveContainerCmd;
import com.github.dockerjava.api.command.StartContainerCmd;
import com.github.dockerjava.api.command.WaitContainerCmd;
import com.github.dockerjava.api.exception.NotFoundException;
import com.github.dockerjava.api.model.Capability;
import com.github.dockerjava.api.model.HostConfig;
import com.github.dockerjava.core.command.WaitContainerResultCallback;
import io.github.hectorvent.floci.config.EmulatorConfig;
import io.github.hectorvent.floci.services.lambda.launcher.ImageCacheService;
@@ -26,6 +28,8 @@ import java.util.Optional;
import java.util.OptionalInt;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.Mockito.RETURNS_SELF;
@@ -99,6 +103,31 @@ class ContainerLifecycleManagerLabelsTest {
capturedLabels(createCmd));
}
@Test
void protectedWorkloadCannotAdministerOrSpoofItsNetwork() {
CreateContainerCmd createCmd = stubCreateContainer();
manager().create(specWithLabels(Map.of("floci.security-group-workload", "true")));
ArgumentCaptor<HostConfig> hostConfig = ArgumentCaptor.forClass(HostConfig.class);
verify(createCmd).withHostConfig(hostConfig.capture());
List<Capability> dropped = List.of(hostConfig.getValue().getCapDrop());
assertTrue(dropped.contains(Capability.NET_ADMIN));
assertTrue(dropped.contains(Capability.NET_RAW));
}
@Test
void firewallHelperGetsNetAdminInsteadOfFullPrivilege() {
CreateContainerCmd createCmd = stubCreateContainer();
manager().create(specWithLabels(Map.of("floci.security-group-helper", "true")));
ArgumentCaptor<HostConfig> hostConfig = ArgumentCaptor.forClass(HostConfig.class);
verify(createCmd).withHostConfig(hostConfig.capture());
assertEquals(List.of(Capability.NET_ADMIN), List.of(hostConfig.getValue().getCapAdd()));
assertNotEquals(Boolean.TRUE, hostConfig.getValue().getPrivileged());
}
@Test
void specLabelWinsOverDefaultOnKeyConflict() {
CreateContainerCmd createCmd = stubCreateContainer();
@@ -113,7 +113,7 @@ class Ec2CapturedImageReclaimIntegrationTest {
/** The image reference the container manager was asked to launch for the given instance. */
private ResolvedAmiImage launchedImageOf(Instance instance) {
ArgumentCaptor<ResolvedAmiImage> resolved = ArgumentCaptor.forClass(ResolvedAmiImage.class);
verify(containerManager).launch(eq(instance), resolved.capture(), any(), anyString(), any());
verify(containerManager).launch(eq(instance), resolved.capture(), any(), anyString(), any(), any(), any());
return resolved.getValue();
}
@@ -14,8 +14,10 @@ import com.github.dockerjava.api.command.ListContainersCmd;
import com.github.dockerjava.api.command.StartContainerCmd;
import com.github.dockerjava.api.exception.DockerException;
import com.github.dockerjava.api.model.Container;
import com.github.dockerjava.api.model.ContainerConfig;
import com.github.dockerjava.api.model.ContainerNetwork;
import com.github.dockerjava.api.model.Frame;
import com.github.dockerjava.api.model.HostConfig;
import com.github.dockerjava.api.model.StreamType;
import java.nio.charset.StandardCharsets;
import com.github.dockerjava.api.model.NetworkSettings;
@@ -333,6 +335,74 @@ class Ec2ContainerManagerTest {
+ "from an address nothing knows about");
}
@Test
void startOfAProtectedInstanceReusesTheHelperTransportAddress() throws Exception {
ContainerLifecycleManager lifecycleManager = mock(ContainerLifecycleManager.class);
when(lifecycleManager.isContainerRunning(TEST_CONTAINER_ID)).thenReturn(true);
DockerClient dockerClient = mock(DockerClient.class);
when(dockerClient.startContainerCmd(TEST_CONTAINER_ID))
.thenReturn(mock(StartContainerCmd.class, RETURNS_SELF));
// A workload in the helper's namespace has no Docker attachment of its own, so there is
// no bridge address on it to rediscover after the restart.
InspectContainerResponse workload = mock(InspectContainerResponse.class);
HostConfig hostConfig = mock(HostConfig.class);
when(hostConfig.getNetworkMode()).thenReturn("container:helper-1");
when(workload.getHostConfig()).thenReturn(hostConfig);
InspectContainerCmd inspectWorkload = mock(InspectContainerCmd.class);
when(inspectWorkload.exec()).thenReturn(workload);
when(dockerClient.inspectContainerCmd(TEST_CONTAINER_ID)).thenReturn(inspectWorkload);
InspectContainerResponse helper = mock(InspectContainerResponse.class);
ContainerConfig helperConfig = mock(ContainerConfig.class);
when(helperConfig.getLabels()).thenReturn(Map.of(
"floci.security-group-helper", "true",
"io.floci.service", "ec2",
"io.floci.resource-id", "i-protected",
"floci_owner_port", "4566"));
when(helper.getConfig()).thenReturn(helperConfig);
NetworkSettings helperNetworks = mock(NetworkSettings.class);
when(helperNetworks.getNetworks())
.thenReturn(Map.of("bridge", new ContainerNetwork().withIpv4Address("172.17.0.7")));
when(helper.getNetworkSettings()).thenReturn(helperNetworks);
InspectContainerCmd inspectHelper = mock(InspectContainerCmd.class);
when(inspectHelper.exec()).thenReturn(helper);
when(dockerClient.inspectContainerCmd("helper-1")).thenReturn(inspectHelper);
EmulatorConfig config = mock(EmulatorConfig.class, RETURNS_DEEP_STUBS);
when(config.port()).thenReturn(4566);
when(config.docker().resourceNamespace()).thenReturn(Optional.empty());
Ec2MetadataServer metadataServer = mock(Ec2MetadataServer.class);
Ec2ContainerManager manager = new Ec2ContainerManager(
mock(ContainerBuilder.class),
lifecycleManager,
mock(ContainerLogStreamer.class),
mock(ContainerDetector.class),
mock(DockerHostResolver.class),
dockerClient,
mock(PortAllocator.class),
config,
metadataServer,
mock(Ec2PortForwardManager.class),
mock(RegionResolver.class),
mock(ContainerNetworkReachability.class),
mock(VpcNetworkManager.class),
mock(ContainerReachableEndpoint.class),
mock(SecurityGroupFirewallManager.class));
Instance instance = new Instance();
instance.setInstanceId("i-protected");
instance.setDockerContainerId(TEST_CONTAINER_ID);
manager.start(instance);
awaitUntil(() -> "running".equals(instance.getState().getName()), Duration.ofSeconds(5));
verify(metadataServer, timeout(2000)).registerContainer("172.17.0.7", "i-protected", instance);
assertEquals("172.17.0.7", instance.getContainerBridgeIp(),
"StartInstances must keep addressing the instance through its protected namespace");
}
private static Ec2ContainerManager managerWith(ContainerLifecycleManager lifecycleManager,
DockerClient dockerClient,
Ec2MetadataServer metadataServer) {
@@ -42,10 +42,23 @@ class Ec2NetworkInterfaceIntegrationTest {
@Test
@Order(1)
void discoverDefaultSubnetAndSecurityGroup() {
String vpcId = given()
.formParam("Action", "DescribeVpcs")
.formParam("Filter.1.Name", "is-default")
.formParam("Filter.1.Value.1", "true")
.header("Authorization", AUTH_HEADER)
.when()
.post("/")
.then()
.statusCode(200)
.extract().path("DescribeVpcsResponse.vpcSet.item[0].vpcId");
subnetId = given()
.formParam("Action", "DescribeSubnets")
.formParam("Filter.1.Name", "default-for-az")
.formParam("Filter.1.Value.1", "true")
.formParam("Filter.2.Name", "vpc-id")
.formParam("Filter.2.Value.1", vpcId)
.header("Authorization", AUTH_HEADER)
.when()
.post("/")
@@ -57,6 +70,8 @@ class Ec2NetworkInterfaceIntegrationTest {
.formParam("Action", "DescribeSecurityGroups")
.formParam("Filter.1.Name", "group-name")
.formParam("Filter.1.Value.1", "default")
.formParam("Filter.2.Name", "vpc-id")
.formParam("Filter.2.Value.1", vpcId)
.header("Authorization", AUTH_HEADER)
.when()
.post("/")
@@ -0,0 +1,155 @@
package io.github.hectorvent.floci.services.ec2;
import com.github.dockerjava.api.DockerClient;
import com.github.dockerjava.api.async.ResultCallback;
import com.github.dockerjava.api.model.Frame;
import io.github.hectorvent.floci.core.common.docker.ContainerBuilder;
import io.github.hectorvent.floci.core.common.docker.ContainerLifecycleManager;
import io.github.hectorvent.floci.services.ec2.model.IpPermission;
import io.github.hectorvent.floci.services.ec2.model.IpRange;
import io.github.hectorvent.floci.services.ec2.model.SecurityGroup;
import io.quarkus.test.junit.QuarkusTest;
import jakarta.inject.Inject;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
@QuarkusTest
class SecurityGroupFirewallDockerIntegrationTest {
@Inject SecurityGroupFirewallManager firewall;
@Inject ContainerLifecycleManager lifecycle;
@Inject ContainerBuilder builder;
@Inject DockerClient docker;
@Test
void deniedLogicalCidrBlocksManagedPeerThenRuleUpdatePermitsIt() throws Exception {
Assumptions.assumeTrue(firewall.enabled());
try {
Assumptions.assumeTrue("linux".equalsIgnoreCase(docker.infoCmd().exec().getOsType()));
} catch (Exception e) {
Assumptions.abort("Docker daemon is unavailable");
}
String suffix = UUID.randomUUID().toString().substring(0, 8);
String targetEni = "eni-target-" + suffix;
String sourceEni = "eni-source-" + suffix;
List<SecurityGroupFirewallManager.Namespace> namespaces = new ArrayList<>();
List<String> workers = new ArrayList<>();
try {
SecurityGroupFirewallManager.Namespace target = firewall.createNamespace("ec2", "sg-target-" + suffix, "000000000000",
"us-east-1", Optional.empty(), Map.of());
namespaces.add(target);
SecurityGroupFirewallManager.Namespace source = firewall.createNamespace("ec2", "sg-source-" + suffix, "000000000000",
"us-east-1", Optional.empty(), Map.of());
namespaces.add(source);
SecurityGroup targetGroup = group("sg-target", false, "10.0.0.0/24");
SecurityGroup sourceGroup = group("sg-source", true, "0.0.0.0/0");
firewall.register(endpoint(targetEni, "10.0.0.2", target, targetGroup),
target.helperId(), Map.of());
firewall.register(endpoint(sourceEni, "10.1.0.2", source, sourceGroup),
source.helperId(), Map.of());
workers.add(lifecycle.createAndStart(builder.newContainer("alpine:3.21")
.withName("floci-sg-test-target-" + suffix)
.withNetworkMode("container:" + target.helperId())
.withEntrypoint(List.of("sh", "-c"))
.withCmd(List.of("exec nc -lk -p 8080 -e /bin/cat"))
.build()).containerId());
workers.add(lifecycle.createAndStart(builder.newContainer("alpine:3.21")
.withName("floci-sg-test-source-" + suffix)
.withNetworkMode("container:" + source.helperId())
.withEntrypoint(List.of("sleep"))
.withCmd(List.of("600"))
.build()).containerId());
for (int attempt = 0; attempt < 20 && connect(workers.getFirst(), "127.0.0.1") != 0; attempt++) {
Thread.sleep(100);
}
assertEquals(0, connect(workers.getFirst(), "127.0.0.1"));
assertNotEquals(0, connect(workers.get(1), target.transportAddress()));
IpRange corrected = new IpRange();
corrected.setCidrIp("10.1.0.0/24");
targetGroup.getIpPermissions().getFirst().getIpRanges().add(corrected);
firewall.refreshPolicies("us-east-1", Map.of("sg-target", targetGroup,
"sg-source", sourceGroup), Map.of());
assertEquals(0, connect(workers.get(1), target.transportAddress()));
firewall.quarantineSurvivingNamespaces();
assertNotEquals(0, connect(workers.get(1), target.transportAddress()));
firewall.refreshPolicies("us-east-1", Map.of("sg-target", targetGroup,
"sg-source", sourceGroup), Map.of());
assertEquals(0, connect(workers.get(1), target.transportAddress()));
SecurityGroup replacement = group("sg-replacement", false, "192.0.2.0/24");
Map<String, SecurityGroup> groups = Map.of("sg-target", targetGroup, "sg-source", sourceGroup,
"sg-replacement", replacement);
firewall.updateGroups(targetEni, Set.of("sg-replacement"), groups, Map.of());
assertNotEquals(0, connect(workers.get(1), target.transportAddress()));
firewall.updateGroups(targetEni, Set.of("sg-target"), groups, Map.of());
assertEquals(0, connect(workers.get(1), target.transportAddress()));
docker.stopContainerCmd(target.helperId()).withTimeout(0).exec();
firewall.refreshPolicies("us-east-1", groups, Map.of());
assertFalse(docker.inspectContainerCmd(workers.getFirst()).exec().getState().getRunning());
} finally {
for (String worker : workers) {
lifecycle.removeIfExists(worker);
}
firewall.unregister(sourceEni);
firewall.unregister(targetEni);
for (SecurityGroupFirewallManager.Namespace namespace : namespaces) {
lifecycle.removeIfExists(namespace.helperId());
}
}
}
private int connect(String worker, String address) throws Exception {
String id = docker.execCreateCmd(worker).withAttachStdout(true).withAttachStderr(true)
.withCmd("nc", "-z", "-w", "2", address, "8080")
.exec().getId();
try (ResultCallback.Adapter<Frame> callback = new ResultCallback.Adapter<>()) {
docker.execStartCmd(id).exec(callback).awaitCompletion(5, TimeUnit.SECONDS);
}
return docker.inspectExecCmd(id).exec().getExitCodeLong().intValue();
}
private static SecurityGroup group(String id, boolean egress, String cidr) {
SecurityGroup group = new SecurityGroup();
group.setGroupId(id);
group.setVpcId("vpc-1");
group.setOwnerId("000000000000");
IpPermission permission = new IpPermission();
permission.setIpProtocol("tcp");
permission.setFromPort(8080);
permission.setToPort(8080);
IpRange range = new IpRange();
range.setCidrIp(cidr);
permission.getIpRanges().add(range);
if (egress) {
group.getIpPermissionsEgress().add(permission);
} else {
group.getIpPermissions().add(permission);
}
return group;
}
private static SecurityGroupNftCompiler.Endpoint endpoint(String eni, String logical,
SecurityGroupFirewallManager.Namespace namespace, SecurityGroup group) {
return new SecurityGroupNftCompiler.Endpoint("000000000000", "us-east-1", "vpc-1",
eni, logical, namespace.transportAddress(), Set.of(group.getGroupId()), List.of(group));
}
}
@@ -0,0 +1,80 @@
package io.github.hectorvent.floci.services.ec2;
import io.github.hectorvent.floci.services.ec2.model.IpPermission;
import io.github.hectorvent.floci.services.ec2.model.IpRange;
import io.github.hectorvent.floci.services.ec2.model.SecurityGroup;
import org.junit.jupiter.api.Test;
import java.util.List;
import java.util.Map;
import java.util.Set;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
class SecurityGroupNftCompilerTest {
@Test
void managedPeersAreCheckedBeforeDockerAddressCidrs() {
SecurityGroup group = new SecurityGroup();
group.setVpcId("vpc-1");
group.setOwnerId("000000000000");
IpPermission permission = new IpPermission();
permission.setIpProtocol("tcp");
permission.setFromPort(443);
permission.setToPort(443);
IpRange cidr = new IpRange();
cidr.setCidrIp("10.0.0.0/16");
permission.getIpRanges().add(cidr);
IpRange broadTransport = new IpRange();
broadTransport.setCidrIp("172.17.0.0/16");
permission.getIpRanges().add(broadTransport);
group.getIpPermissions().add(permission);
SecurityGroupNftCompiler.Endpoint target = endpoint("eni-a", "10.0.0.2", "172.17.0.2", group);
SecurityGroupNftCompiler.Endpoint allowed = endpoint("eni-b", "10.0.0.3", "172.17.0.3", group);
SecurityGroupNftCompiler.Endpoint denied = endpoint("eni-c", "10.1.0.3", "172.17.0.4", group);
String nft = SecurityGroupNftCompiler.compile(target, List.of(allowed, denied), Map.of());
assertTrue(nft.contains("ip saddr 172.17.0.3 tcp dport 443 accept"));
assertTrue(nft.indexOf("ip saddr 172.17.0.4 drop")
< nft.indexOf("ip saddr 172.17.0.0/16 tcp dport 443 accept"));
}
@Test
void icmpTypeAndCodeRepeatTheProtocolKeyword() {
SecurityGroup group = new SecurityGroup();
group.setVpcId("vpc-1");
group.setOwnerId("000000000000");
// AWS maps IpPermission.FromPort to the ICMP type and ToPort to the ICMP code.
IpPermission echo = new IpPermission();
echo.setIpProtocol("icmp");
echo.setFromPort(8);
echo.setToPort(0);
IpRange cidr = new IpRange();
cidr.setCidrIp("10.0.0.0/16");
echo.getIpRanges().add(cidr);
group.getIpPermissions().add(echo);
IpPermission anyIcmpv6 = new IpPermission();
anyIcmpv6.setIpProtocol("icmpv6");
anyIcmpv6.setFromPort(-1);
anyIcmpv6.setToPort(-1);
IpRange allV4 = new IpRange();
allV4.setCidrIp("10.1.0.0/16");
anyIcmpv6.getIpRanges().add(allV4);
group.getIpPermissions().add(anyIcmpv6);
String nft = SecurityGroupNftCompiler.compile(
endpoint("eni-a", "10.0.0.2", "172.17.0.2", group), List.of(), Map.of());
assertTrue(nft.contains("ip saddr 10.0.0.0/16 icmp type 8 icmp code 0 accept"));
assertFalse(nft.contains("icmp type 8 code 0"));
assertTrue(nft.contains("ip saddr 10.1.0.0/16 meta l4proto icmpv6 accept"));
}
private static SecurityGroupNftCompiler.Endpoint endpoint(String eni, String logical,
String transport, SecurityGroup group) {
return new SecurityGroupNftCompiler.Endpoint("000000000000", "us-east-1", "vpc-1",
eni, logical, transport, Set.of("sg-1"), List.of(group));
}
}
@@ -0,0 +1,91 @@
package io.github.hectorvent.floci.services.ec2;
import io.github.hectorvent.floci.services.ec2.model.IpPermission;
import io.github.hectorvent.floci.services.ec2.model.IpRange;
import io.github.hectorvent.floci.services.ec2.model.Ipv6Range;
import io.github.hectorvent.floci.services.ec2.model.PrefixListId;
import io.github.hectorvent.floci.services.ec2.model.SecurityGroup;
import io.github.hectorvent.floci.services.ec2.model.UserIdGroupPair;
import org.junit.jupiter.api.Test;
import java.util.List;
import java.util.Map;
import java.util.Set;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
class SecurityGroupPolicyTest {
@Test
void evaluatesLogicalPeerIdentityAndPorts() {
SecurityGroup group = group("sg-target");
IpPermission rule = tcp(443);
IpRange cidr = new IpRange();
cidr.setCidrIp("10.42.0.0/16");
rule.getIpRanges().add(cidr);
group.getIpPermissions().add(rule);
assertTrue(SecurityGroupPolicy.allows(List.of(group), false, "6", 443, -1,
peer("10.42.7.9"), Map.of()));
assertFalse(SecurityGroupPolicy.allows(List.of(group), false, "tcp", 443, -1,
peer("10.43.7.9"), Map.of()));
assertFalse(SecurityGroupPolicy.allows(List.of(group), false, "tcp", 80, -1,
peer("10.42.7.9"), Map.of()));
assertFalse(SecurityGroupPolicy.allows(List.of(group), true, "tcp", 443, -1,
peer("10.42.7.9"), Map.of()));
}
@Test
void evaluatesReferencesPrefixListsAndIpv6() {
SecurityGroup group = group("sg-target");
IpPermission byGroup = tcp(80);
UserIdGroupPair reference = new UserIdGroupPair();
reference.setGroupId("sg-peer");
reference.setUserId("000000000000");
byGroup.getUserIdGroupPairs().add(reference);
group.getIpPermissions().add(byGroup);
assertTrue(SecurityGroupPolicy.allows(List.of(group), false, "tcp", 80, -1,
peer("172.17.0.4"), Map.of()));
assertFalse(SecurityGroupPolicy.allows(List.of(group), false, "tcp", 80, -1,
new SecurityGroupPolicy.Peer("172.17.0.4", "000000000000", "vpc-other", Set.of("sg-peer")), Map.of()));
IpPermission prefix = tcp(8080);
PrefixListId id = new PrefixListId();
id.setPrefixListId("pl-1");
prefix.getPrefixListIds().add(id);
group.getIpPermissions().add(prefix);
assertTrue(SecurityGroupPolicy.allows(List.of(group), false, "tcp", 8080, -1,
peer("10.42.7.9"), Map.of("pl-1", List.of("10.42.0.0/16"))));
IpPermission ipv6 = tcp(8443);
Ipv6Range range = new Ipv6Range();
range.setCidrIpv6("2001:db8::/32");
ipv6.getIpv6Ranges().add(range);
group.getIpPermissions().add(ipv6);
assertTrue(SecurityGroupPolicy.allows(List.of(group), false, "tcp", 8443, -1,
peer("2001:db8::1"), Map.of()));
assertFalse(SecurityGroupPolicy.inCidr("10.42.7.9", "invalid/16"));
}
private static SecurityGroup group(String id) {
SecurityGroup group = new SecurityGroup();
group.setGroupId(id);
group.setOwnerId("000000000000");
group.setVpcId("vpc-1");
return group;
}
private static IpPermission tcp(int port) {
IpPermission rule = new IpPermission();
rule.setIpProtocol("tcp");
rule.setFromPort(port);
rule.setToPort(port);
return rule;
}
private static SecurityGroupPolicy.Peer peer(String ip) {
return new SecurityGroupPolicy.Peer(ip, "000000000000", "vpc-1", Set.of("sg-peer"));
}
}
@@ -300,6 +300,8 @@ class EventBridgeSchedulerIntegrationTest {
@Override
public StorageConfig storage() { return null; }
@Override
public NetworkConfig network() { return null; }
@Override
public DnsConfig dns() {
return new DnsConfig() {
@Override