/**
* @return Extra IP permissions to be configured on this entity's location.
*/
protected Collection<IpPermission> getIpPermissions(JcloudsLocationSecurityGroupCustomizer customizer) {
IpPermission dockerPort = IpPermission.builder()
.ipProtocol(IpProtocol.TCP)
.fromPort(getEntity().getAttribute(DockerHost.DOCKER_PORT))
.toPort(getEntity().getAttribute(DockerHost.DOCKER_PORT))
.cidrBlock(customizer.getBrooklynCidrBlock())
.build();
IpPermission dockerSslPort = IpPermission.builder()
.ipProtocol(IpProtocol.TCP)
.fromPort(getEntity().getAttribute(DockerHost.DOCKER_SSL_PORT))
.toPort(getEntity().getAttribute(DockerHost.DOCKER_SSL_PORT))
.cidrBlock(customizer.getBrooklynCidrBlock())
.build();
IpPermission dockerPortForwarding = IpPermission.builder()
.ipProtocol(IpProtocol.TCP)
.fromPort(49000)
.toPort(49900)
.cidrBlock(Cidr.UNIVERSAL.toString())
.build();
List<IpPermission> permissions = MutableList.of(dockerPort, dockerSslPort, dockerPortForwarding);
if (getEntity().getConfig(DockerInfrastructure.WEAVE_ENABLED)) {
Integer weavePort = ((DockerHost) getEntity()).getInfrastructure()
.getAttribute(DockerInfrastructure.WEAVE_INFRASTRUCTURE)
.getConfig(WeaveContainer.WEAVE_PORT);
IpPermission weaveTcpPort = IpPermission.builder()
.ipProtocol(IpProtocol.TCP)
.fromPort(weavePort)
.toPort(weavePort)
.cidrBlock(Cidr.UNIVERSAL.toString()) // TODO could be tighter restricted?
.build();
permissions.add(weaveTcpPort);
IpPermission weaveUdpPort = IpPermission.builder()
.ipProtocol(IpProtocol.UDP)
.fromPort(weavePort)
.toPort(weavePort)
.cidrBlock(Cidr.UNIVERSAL.toString()) // TODO could be tighter restricted?
.build();