Network Interface

Filters

  • Standard Value Filter (see Generic Filters)
  • ARM Resource Filters (see Generic Filters)
    • Tag Filter - Filter on tag presence and/or values

    • Marked-For-Op Filter - Filter on tag that indicates a scheduled operation for a resource

  • effective-route-table
    • Filter based on Effective Routes associated with network interfaces such as route names, next hops.

    • Network Interfaces must be attached to a virtual machine and the virtual machine must be powered on.

    properties:
      default:
        type: object
      key:
        type: string
      op:
        enum:
        - eq
        - equal
        - ne
        - not-equal
        - gt
        - greater-than
        - ge
        - gte
        - le
        - lte
        - lt
        - less-than
        - glob
        - regex
        - regex-case
        - in
        - ni
        - not-in
        - contains
        - difference
        - intersect
      type:
        enum:
        - effective-route-table
      value:
        oneOf:
        - type: array
        - type: string
        - type: boolean
        - type: number
        - type: 'null'
      value_from:
        additionalProperties: 'False'
        properties:
          expr:
            oneOf:
            - type: integer
            - type: string
          format:
            enum:
            - csv
            - json
            - txt
            - csv2dict
          url:
            type: string
        required:
        - url
        type: object
      value_regex:
        type: string
      value_type:
        enum:
        - age
        - integer
        - expiration
        - normalize
        - size
        - cidr
        - cidr_size
        - swap
        - resource_count
        - expr
        - unique_size
        - date
    required:
    - type
    

Actions

Example Policies

This policy will get Network Interfaces that have User added routes.

policies:
  - name: get-nic-with-user-routes
    resource: azure.networkinterface
    filters:
      - type: effective-route-table
        key: routes.value[].source
        op: in
        value_type: swap
        value: User

This policy will get Network Interfaces that have VirtualNetworkGateway and VNet hops.

policies:
  - name: virtual-network-gateway-hop
    resource: azure.networkinterface
    filters:
      - type: effective-route-table
        key: routes.value[?source == 'User'].nextHopType
        op: difference
        value:
          - Internet
          - None
          - VirtualAppliance

This policy will get Network Interfaces that are not attached to any Virtual Machine.