fwOptions.network(group.getUri());
if (!ipPermission.getGroupIds().isEmpty()) {
fwOptions.sourceTags(ipPermission.getGroupIds());
}
if (!ipPermission.getCidrBlocks().isEmpty()) {
fwOptions.sourceRanges(ipPermission.getCidrBlocks());
}
Firewall.Rule.Builder ruleBuilder = Firewall.Rule.builder();
ruleBuilder.IpProtocol(ipPermission.getIpProtocol());
if (ipPermission.getToPort() > 0) {
ruleBuilder.addPortRange(ipPermission.getFromPort(), ipPermission.getToPort());