Class SecurityGroupRule


public class SecurityGroupRule extends SecurityGroupRuleIdentityProjection
SecurityGroupRules are used to model the routing rules on Security Groups or firewalls. For example, the Inbound and Outbound rules in Amazon are modeled using SecurityGroupRule. The protocol, port range, type, source, destination, and policy (among other attributes) can be specified.
  • Field Details

  • Constructor Details

    • SecurityGroupRule

      public SecurityGroupRule()
  • Method Details

    • getSecurityGroup

      public SecurityGroupIdentityProjection getSecurityGroup()
      The SecurityGroup for which this SecurityGroupRule applies
      Returns:
      The SecurityGroup for which this SecurityGroupRule applies
    • setSecurityGroup

      public void setSecurityGroup(SecurityGroupIdentityProjection securityGroup)
      The SecurityGroup for which this SecurityGroupRule applies
      Parameters:
      securityGroup - The SecurityGroup for which this SecurityGroupRule applies
    • getGroupName

      public String getGroupName()
      Some clouds group SecurityGroupRules into a group. The name of that group may be specified
      Returns:
      Some clouds group SecurityGroupRules into a group. The name of that group may be specified
    • setGroupName

      public void setGroupName(String groupName)
      Some clouds group SecurityGroupRules into a group. The name of that group may be specified
      Parameters:
      groupName - Some clouds group SecurityGroupRules into a group. The name of that group may be specified
    • getGroupType

      public String getGroupType()
      Some clouds group SecurityGroupRules into a group. The type of that group may be specified. Either instance, firewall, or router is typical
      Returns:
      Some clouds group SecurityGroupRules into a group. The type of that group may be specified. Either instance, firewall, or router is typical
    • setGroupType

      public void setGroupType(String groupType)
      Some clouds group SecurityGroupRules into a group. The type of that group may be specified. Either instance, firewall, or router is typical
      Parameters:
      groupType - Some clouds group SecurityGroupRules into a group. The type of that group may be specified. Either instance, firewall, or router is typical
    • getDescription

      public String getDescription()
    • setDescription

      public void setDescription(String description)
    • getRuleType

      public String getRuleType()
      The type of SecurityGroupRule. In most cases, should be set to 'custom'
      Returns:
      The type of SecurityGroupRule. In most cases, should be set to 'custom'
    • setRuleType

      public void setRuleType(String ruleType)
      The type of SecurityGroupRule. In most cases, should be set to 'custom'
      Parameters:
      ruleType - The type of SecurityGroupRule. In most cases, should be set to 'custom'
    • getDirection

      public String getDirection()
      The direction for the SecurityGroupRule. Options are 'ingress', 'egress', or 'any'
      Returns:
      The direction for the SecurityGroupRule. Options are 'ingress', 'egress', or 'any'
    • setDirection

      public void setDirection(String direction)
      The direction for the SecurityGroupRule. Options are 'ingress', 'egress', or 'any'
      Parameters:
      direction - The direction for the SecurityGroupRule. Options are 'ingress', 'egress', or 'any'
    • getEtherType

      public String getEtherType()
      The ether type. Either 'IPv4' or 'IPv6'
      Returns:
      The ether type. Either 'IPv4' or 'IPv6'
    • setEtherType

      public void setEtherType(String etherType)
      The ether type. Either 'IPv4' or 'IPv6'
      Parameters:
      etherType - The ether type. Either 'IPv4' or 'IPv6'
    • getPolicy

      public String getPolicy()
      The type of policy. Either 'accept' or 'reject'
      Returns:
      The type of policy. Either 'accept' or 'reject'
    • setPolicy

      public void setPolicy(String policy)
      The type of policy. Either 'accept' or 'reject'
      Parameters:
      policy - The type of policy. Either 'accept' or 'reject'
    • getPriority

      public Integer getPriority()
      The priority for the rule
      Returns:
      The priority for the rule
    • setPriority

      public void setPriority(Integer priority)
      The priority for the rule
      Parameters:
      priority - The priority for the rule
    • getSource

      public String getSource()
      The cidr for the source of the rule. i.e. 10.0.0.0/23
      Returns:
      The cidr for the source of the rule. i.e. 10.0.0.0/23
    • setSource

      public void setSource(String source)
      The cidr for the source of the rule. i.e. 10.0.0.0/23
      Parameters:
      source - The cidr for the source of the rule. i.e. 10.0.0.0/23
    • getSourceType

      public String getSourceType()
      The source type. 'all', 'cidr', 'group'
      Returns:
      The source type. 'all', 'cidr', 'group'
    • setSourceType

      public void setSourceType(String sourceType)
      The source type. 'all', 'cidr', 'group'
      Parameters:
      sourceType - The source type. 'all', 'cidr', 'group'
    • getSourceGroup

      public SecurityGroupIdentityProjection getSourceGroup()
      The source SecurityGroup may be set. Some clouds refer to other SecurityGroups (like Amazon)
      Returns:
      The source SecurityGroup may be set. Some clouds refer to other SecurityGroups (like Amazon)
    • setSourceGroup

      public void setSourceGroup(SecurityGroupIdentityProjection sourceGroup)
      The source SecurityGroup may be set. Some clouds refer to other SecurityGroups (like Amazon)
      Parameters:
      sourceGroup - The source SecurityGroup may be set. Some clouds refer to other SecurityGroups (like Amazon)
    • getDestination

      public String getDestination()
      The cidr for the destination of the rule. i.e. 10.0.0.0/23
      Returns:
      The cidr for the destination of the rule. i.e. 10.0.0.0/23
    • setDestination

      public void setDestination(String destination)
      The cidr for the destination of the rule. i.e. 10.0.0.0/23
      Parameters:
      destination - The cidr for the destination of the rule. i.e. 10.0.0.0/23
    • getDestinationType

      public String getDestinationType()
      The destination type. 'all', 'cidr', 'group'
      Returns:
      The destination type. 'all', 'cidr', 'group'
    • setDestinationType

      public void setDestinationType(String destinationType)
      The destination type. 'all', 'cidr', 'group'
      Parameters:
      destinationType - The destination type. 'all', 'cidr', 'group'
    • getDestinationGroup

      public SecurityGroupIdentityProjection getDestinationGroup()
      The destination SecurityGroup may be set. Some clouds refer to other SecurityGroups (like Amazon)
      Returns:
      The destination SecurityGroup may be set. Some clouds refer to other SecurityGroups (like Amazon)
    • setDestinationGroup

      public void setDestinationGroup(SecurityGroupIdentityProjection destinationGroup)
      The destination SecurityGroup may be set. Some clouds refer to other SecurityGroups (like Amazon)
      Parameters:
      destinationGroup -
    • getAppliedTarget

      public String getAppliedTarget()
    • setAppliedTarget

      public void setAppliedTarget(String appliedTarget)
    • getAppliedTargetType

      public String getAppliedTargetType()
    • setAppliedTargetType

      public void setAppliedTargetType(String appliedTargetType)
    • getApplicationType

      public String getApplicationType()
      Always set to 'port'
      Returns:
      Always set to 'port'
    • setApplicationType

      public void setApplicationType(String applicationType)
      Always set to 'port'
      Parameters:
      applicationType - Always set to 'port'
    • getApplication

      public String getApplication()
      Not used
      Returns:
      Not used
    • setApplication

      public void setApplication(String application)
      Not used
      Parameters:
      application - Not used
    • getPortRange

      public String getPortRange()
      The port range for the rule. (i.e. 0-65535 or 10000-10050)
      Returns:
      The port range for the rule. (i.e. 0-65535 or 10000-10050)
    • setPortRange

      public void setPortRange(String portRange)
      The port range for the rule. (i.e. 0-65535 or 10000-10050)
      Parameters:
      portRange - The port range for the rule. (i.e. 0-65535 or 10000-10050)
    • getSourcePortRange

      public String getSourcePortRange()
      The source port range for the rule. (i.e. 0-65535 or 10000-10050)
      Returns:
      The source port range for the rule. (i.e. 0-65535 or 10000-10050)
    • setSourcePortRange

      public void setSourcePortRange(String sourcePortRange)
      The source port range for the rule. (i.e. 0-65535 or 10000-10050)
      Parameters:
      sourcePortRange - The source port range for the rule. (i.e. 0-65535 or 10000-10050)
    • getDestinationPortRange

      public String getDestinationPortRange()
      The destination port range for the rule. (i.e. 0-65535 or 10000-10050)
      Returns:
      The destination port range for the rule. (i.e. 0-65535 or 10000-10050)
    • setDestinationPortRange

      public void setDestinationPortRange(String destinationPortRange)
      The destination port range for the rule. (i.e. 0-65535 or 10000-10050)
      Parameters:
      destinationPortRange - The destination port range for the rule. (i.e. 0-65535 or 10000-10050)
    • getProtocol

      public String getProtocol()
      The protocol for the rule ('icmp', 'tcp', 'all')
      Returns:
      The protocol for the rule ('icmp', 'tcp', 'all')
    • setProtocol

      public void setProtocol(String protocol)
      The protocol for the rule ('icmp', 'tcp', 'all')
      Parameters:
      protocol - The protocol for the rule ('icmp', 'tcp', 'all')
    • getIcmpType

      public String getIcmpType()
      Not used
      Returns:
      Not used
    • setIcmpType

      public void setIcmpType(String icmpType)
      Not used
      Parameters:
      icmpType - Not used
    • getSourceFromPort

      public String getSourceFromPort()
      The port for the source (i.e. 3389)
      Returns:
      The port for the source (i.e. 3389)
    • setSourceFromPort

      public void setSourceFromPort(String sourceFromPort)
      The port for the source (i.e. 3389)
      Parameters:
      sourceFromPort - The port for the source (i.e. 3389)
    • getSourceToPort

      public String getSourceToPort()
      The port to the source (i.e. 3389)
      Returns:
      The port to the source (i.e. 3389)
    • setSourceToPort

      public void setSourceToPort(String sourceToPort)
      The port to the source (i.e. 3389)
      Parameters:
      sourceToPort - The port to the source (i.e. 3389)
    • getDestinationFromPort

      public String getDestinationFromPort()
      The port from the destination (i.e. 3389)
      Returns:
      The port from the destination (i.e. 3389)
    • setDestinationFromPort

      public void setDestinationFromPort(String destinationFromPort)
      The port from the destination (i.e. 3389)
      Parameters:
      destinationFromPort - The port from the destination (i.e. 3389)
    • getDestinationToPort

      public String getDestinationToPort()
      The port to the destination (i.e. 3389)
      Returns:
      The port to the destination (i.e. 3389)
    • setDestinationToPort

      public void setDestinationToPort(String destinationToPort)
      The port to the destination (i.e. 3389)
      Parameters:
      destinationToPort - The port to the destination (i.e. 3389)
    • getInternalId

      public String getInternalId()
      An internal id
      Returns:
      An internal id
    • setInternalId

      public void setInternalId(String internalId)
      An internal id
      Parameters:
      internalId - An internal id
    • getUniqueId

      public String getUniqueId()
      A unique id
      Returns:
      A unique id
    • setUniqueId

      public void setUniqueId(String uniqueId)
      A unique id
      Parameters:
      uniqueId - A unique id
    • getProviderId

      public String getProviderId()
      The id used by the provider. May be used for sync operations
      Returns:
      The id used by the provider. May be used for sync operations
    • setProviderId

      public void setProviderId(String providerId)
      The id used by the provider. May be used for sync operations
      Parameters:
      providerId - The id used by the provider. May be used for sync operations
    • getExternalType

      public String getExternalType()
      An external type
      Returns:
      An external type
    • setExternalType

      public void setExternalType(String externalType)
      An external type
      Parameters:
      externalType - An external type
    • getIacId

      public String getIacId()
      An infrastructure as code id
      Returns:
      An infrastructure as code id
    • setIacId

      public void setIacId(String iacId)
      An infrastructure as code id
      Parameters:
      iacId - An infrastructure as code id
    • getRawData

      public String getRawData()
      The raw data from the provider for the rule
      Returns:
      The raw data from the provider for the rule
    • setRawData

      public void setRawData(String rawData)
      The raw data from the provider for the rule
      Parameters:
      rawData - The raw data from the provider for the rule
    • getEnabled

      public Boolean getEnabled()
      Whether the rule is enabled
      Returns:
      Whether the rule is enabled
    • setEnabled

      public void setEnabled(Boolean enabled)
      Whether the rule is enabled
      Parameters:
      enabled - Whether the rule is enabled
    • getVisible

      public Boolean getVisible()
      Not used
      Returns:
    • setVisible

      public void setVisible(Boolean visible)
      Not used
      Parameters:
      visible - Not used
    • getScope

      public String getScope()
      Not used
      Returns:
      Not used
    • setScope

      public void setScope(String scope)
      Not used
      Parameters:
      scope - Not used
    • getProfile

      public String getProfile()
      Not used
      Returns:
      Not used
    • setProfile

      public void setProfile(String profile)
      Not used
      Parameters:
      profile - Not used
    • getSyncSource

      public String getSyncSource()
      Indicates how the rule was created. Either 'internal', or 'external'
      Returns:
      Indicates how the rule was created. Either 'internal', or 'external'
    • setSyncSource

      public void setSyncSource(String syncSource)
      Indicates how the rule was created. Either 'internal', or 'external'
      Parameters:
      syncSource - Indicates how the rule was created. Either 'internal', or 'external'
    • getLocations

      public List<SecurityGroupRuleLocation> getLocations()
      The Locations for this SecurityGroupRule. A location usually indicates a cloud. For example, a SecurityGroupRule can exist in multiple locations or clouds
      Returns:
      The locations for this SecurityGroupRule
    • setLocations

      public void setLocations(List<SecurityGroupRuleLocation> locations)
      The Locations for this SecurityGroupRule. A location usually indicates a cloud. For example, a SecurityGroupRule can exist in multiple locations or clouds
      Parameters:
      locations - The locations for this SecurityGroupRule
    • getApplications

      public List<SecurityGroupRuleApplication> getApplications()
      The Applications for this SecurityGroupRule. For example, NSX-T associates Applications (like APP_HTTP) to rules and these are modeled via the SecurityGroupRuleApplication
      Returns:
      The Applications for this SecurityGroupRule
    • setApplications

      public void setApplications(List<SecurityGroupRuleApplication> applications)
      The Applications for this SecurityGroupRule. For example, NSX-T associates Applications (like APP_HTTP) to rules and these are modeled via the SecurityGroupRuleApplication
      Parameters:
      applications - The Applications for this SecurityGroupRule
    • getDestinations

      public List<SecurityGroupRuleDestination> getDestinations()
      The Destinations for this SecurityGroupRule. For example, NSX-T associates Destinations (like ipset-2) to firewall rules and these are modeled with SecurityGroupRuleDestination and SecurityGroupRules
      Returns:
      The Destinations for this SecurityGroupRule
    • setDestinations

      public void setDestinations(List<SecurityGroupRuleDestination> destinations)
      The Destinations for this SecurityGroupRule. For example, NSX-T associates Destinations (like ipset-2) to firewall rules and these are modeled with SecurityGroupRuleDestination and SecurityGroupRules
      Parameters:
      destinations - The Destinations for this SecurityGroupRule
    • getProfiles

      public List<SecurityGroupRuleProfile> getProfiles()
      The Profiles for this SecurityGroupRule. For example, NSX-T associates Profiles to firewall rules and these are modeled with SecurityGroupRuleProfile and SecurityGroupRules The Profiles for this SecurityGroupRule
      Returns:
    • setProfiles

      public void setProfiles(List<SecurityGroupRuleProfile> profiles)
      The Profiles for this SecurityGroupRule. For example, NSX-T associates Profiles to firewall rules and these are modeled with SecurityGroupRuleProfile and SecurityGroupRules
      Parameters:
      profiles - The Profiles for this SecurityGroupRule
    • getScopes

      public List<SecurityGroupRuleScope> getScopes()
      The Scopes for this SecurityGroupRule. For example, NSX-T associates Scopes to firewall rules and these are modeled with SecurityGroupRuleScope and SecurityGroupRules
      Returns:
      The Scopes for this SecurityGroupRule
    • setScopes

      public void setScopes(List<SecurityGroupRuleScope> scopes)
      The Scopes for this SecurityGroupRule. For example, NSX-T associates Scopes to firewall rules and these are modeled with SecurityGroupRuleScope and SecurityGroupRules
      Parameters:
      scopes - The Scopes for this SecurityGroupRule
    • getSources

      public List<SecurityGroupRuleSource> getSources()
      The Sources for this SecurityGroupRule. For example, NSX-T associates Sources to firewall rules and these are modeled with SecurityGroupRuleSource and SecurityGroupRule
      Returns:
      The Sources for this SecurityGroupRule
    • setSources

      public void setSources(List<SecurityGroupRuleSource> sources)
      The Sources for this SecurityGroupRule. For example, NSX-T associates Sources to firewall rules and these are modeled with SecurityGroupRuleSource and SecurityGroupRule
      Parameters:
      sources - The Sources for this SecurityGroupRule
    • isCustomRule

      public Boolean isCustomRule()
      Is this rule a custom rule or a predefined rule.
      Returns:
      Boolean
    • getMinPort

      public Integer getMinPort()
      The minimum port from the port range
      Returns:
      the minimum port number
    • getMaxPort

      public Integer getMaxPort()
      The maximum port from the port range
      Returns:
      the maximum port number