policy-library/policies/templates/gcp_compute_external_ip_address.yaml [89:122]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        }

        ###########################
        # Rule Utilities
        ###########################
        instance_name_targeted(asset_name, instance_filters, mode, match_mode) {
        	mode == "allowlist"
        	match_mode == "exact"
        	matches := {asset_name} & cast_set(instance_filters)
        	count(matches) == 0
        }

        instance_name_targeted(asset_name, instance_filters, mode, match_mode) {
        	mode == "denylist"
        	match_mode == "exact"
        	matches := {asset_name} & cast_set(instance_filters)
        	count(matches) > 0
        }

        instance_name_targeted(asset_name, instance_filters, mode, match_mode) {
        	mode == "allowlist"
        	match_mode == "regex"
        	not re_match_name(asset_name, instance_filters)
        }

        instance_name_targeted(asset_name, instance_filters, mode, match_mode) {
        	mode == "denylist"
        	match_mode == "regex"
        	re_match_name(asset_name, instance_filters)
        }

        re_match_name(name, filters) {
        	re_match(filters[_], name)
        }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



policy-library/policies/templates/gcp_compute_ip_forward.yaml [89:122]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        }

        ###########################
        # Rule Utilities
        ###########################
        instance_name_targeted(asset_name, instance_filters, mode, match_mode) {
        	mode == "allowlist"
        	match_mode == "exact"
        	matches := {asset_name} & cast_set(instance_filters)
        	count(matches) == 0
        }

        instance_name_targeted(asset_name, instance_filters, mode, match_mode) {
        	mode == "denylist"
        	match_mode == "exact"
        	matches := {asset_name} & cast_set(instance_filters)
        	count(matches) > 0
        }

        instance_name_targeted(asset_name, instance_filters, mode, match_mode) {
        	mode == "allowlist"
        	match_mode == "regex"
        	not re_match_name(asset_name, instance_filters)
        }

        instance_name_targeted(asset_name, instance_filters, mode, match_mode) {
        	mode == "denylist"
        	match_mode == "regex"
        	re_match_name(asset_name, instance_filters)
        }

        re_match_name(name, filters) {
        	re_match(filters[_], name)
        }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



