{
  "description": "RuleGroup is the Schema for the RuleGroups API",
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
      "type": "string"
    },
    "kind": {
      "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": "string"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "description": "RuleGroupSpec defines the desired state of RuleGroup. \n The object that defines the rules in a rule group. This, along with RuleGroupResponse, define the rule group. You can retrieve all objects for a rule group by calling DescribeRuleGroup. \n Network Firewall uses a rule group to inspect and control network traffic. You define stateless rule groups to inspect individual packets and you define stateful rule groups to inspect packets in the context of their traffic flow. \n To use a rule group, you include it by reference in an Network Firewall firewall policy, then you use the policy in a firewall. You can reference a rule group from more than one firewall policy, and you can use a firewall policy in more than one firewall.",
      "properties": {
        "capacity": {
          "description": "The maximum operating resources that this rule group can use. Rule group capacity is fixed at creation. When you update a rule group, you are limited to this capacity. When you reference a rule group from a firewall policy, Network Firewall reserves this capacity for the rule group. \n You can retrieve the capacity that would be required for a rule group before you create the rule group by calling CreateRuleGroup with DryRun set to TRUE. \n You can't change or exceed this capacity when you update the rule group, so leave room for your rule group to grow. \n # Capacity for a stateless rule group \n For a stateless rule group, the capacity required is the sum of the capacity requirements of the individual rules that you expect to have in the rule group. \n To calculate the capacity requirement of a single rule, multiply the capacity requirement values of each of the rule's match settings: \n - A match setting with no criteria specified has a value of 1. \n - A match setting with Any specified has a value of 1. \n - All other match settings have a value equal to the number of elements provided in the setting. For example, a protocol setting [\"UDP\"] and a source setting [\"10.0.0.0/24\"] each have a value of 1. A protocol setting [\"UDP\",\"TCP\"] has a value of 2. A source setting [\"10.0.0.0/24\",\"10.0.0.1/24\",\"10.0.0.2/24\"] has a value of 3. \n A rule with no criteria specified in any of its match settings has a capacity requirement of 1. A rule with protocol setting [\"UDP\",\"TCP\"], source setting [\"10.0.0.0/24\",\"10.0.0.1/24\",\"10.0.0.2/24\"], and a single specification or no specification for each of the other match settings has a capacity requirement of 6. \n # Capacity for a stateful rule group \n For a stateful rule group, the minimum capacity required is the number of individual rules that you expect to have in the rule group.",
          "format": "int64",
          "type": "integer"
        },
        "description": {
          "description": "A description of the rule group.",
          "type": "string"
        },
        "dryRun": {
          "description": "Indicates whether you want Network Firewall to just check the validity of the request, rather than run the request. \n If set to TRUE, Network Firewall checks whether the request can run successfully, but doesn't actually make the requested changes. The call returns the value that the request would return if you ran it with dry run set to FALSE, but doesn't make additions or changes to your resources. This option allows you to make sure that you have the required permissions to run the request and that your request parameters are valid. \n If set to FALSE, Network Firewall makes the requested changes to your resources.",
          "type": "boolean"
        },
        "encryptionConfiguration": {
          "description": "A complex type that contains settings for encryption of your rule group resources.",
          "properties": {
            "keyID": {
              "type": "string"
            },
            "type_": {
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "ruleGroup": {
          "description": "An object that defines the rule group rules. \n You must provide either this rule group setting or a Rules setting, but not both.",
          "properties": {
            "referenceSets": {
              "description": "Contains a set of IP set references.",
              "properties": {
                "iPSetReferences": {
                  "additionalProperties": {
                    "description": "Configures one or more IP set references for a Suricata-compatible rule group. This is used in CreateRuleGroup or UpdateRuleGroup. An IP set reference is a rule variable that references a resource that you create and manage in another Amazon Web Services service, such as an Amazon VPC prefix list. Network Firewall IP set references enable you to dynamically update the contents of your rules. When you create, update, or delete the IP set you are referencing in your rule, Network Firewall automatically updates the rule's content with the changes. For more information about IP set references in Network Firewall, see Using IP set references (https://docs.aws.amazon.com/network-firewall/latest/developerguide/rule-groups-ip-set-references) in the Network Firewall Developer Guide. \n Network Firewall currently supports only Amazon VPC prefix lists (https://docs.aws.amazon.com/vpc/latest/userguide/managed-prefix-lists.html) as IP set references.",
                    "properties": {
                      "referenceARN": {
                        "type": "string"
                      }
                    },
                    "type": "object",
                    "additionalProperties": false
                  },
                  "type": "object"
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "ruleVariables": {
              "description": "Settings that are available for use in the rules in the RuleGroup where this is defined.",
              "properties": {
                "iPSets": {
                  "additionalProperties": {
                    "description": "A list of IP addresses and address ranges, in CIDR notation. This is part of a RuleVariables.",
                    "properties": {
                      "definition": {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      }
                    },
                    "type": "object",
                    "additionalProperties": false
                  },
                  "type": "object"
                },
                "portSets": {
                  "additionalProperties": {
                    "description": "A set of port ranges for use in the rules in a rule group.",
                    "properties": {
                      "definition": {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      }
                    },
                    "type": "object",
                    "additionalProperties": false
                  },
                  "type": "object"
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "rulesSource": {
              "description": "The stateless or stateful rules definitions for use in a single rule group. Each rule group requires a single RulesSource. You can use an instance of this for either stateless rules or stateful rules.",
              "properties": {
                "rulesSourceList": {
                  "description": "Stateful inspection criteria for a domain list rule group. \n For HTTPS traffic, domain filtering is SNI-based. It uses the server name indicator extension of the TLS handshake. \n By default, Network Firewall domain list inspection only includes traffic coming from the VPC where you deploy the firewall. To inspect traffic from IP addresses outside of the deployment VPC, you set the HOME_NET rule variable to include the CIDR range of the deployment VPC plus the other CIDR ranges. For more information, see RuleVariables in this guide and Stateful domain list rule groups in Network Firewall (https://docs.aws.amazon.com/network-firewall/latest/developerguide/stateful-rule-groups-domain-names.html) in the Network Firewall Developer Guide.",
                  "properties": {
                    "generatedRulesType": {
                      "type": "string"
                    },
                    "targetTypes": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "targets": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                },
                "rulesString": {
                  "type": "string"
                },
                "statefulRules": {
                  "items": {
                    "description": "A single Suricata rules specification, for use in a stateful rule group. Use this option to specify a simple Suricata rule with protocol, source and destination, ports, direction, and rule options. For information about the Suricata Rules format, see Rules Format (https://suricata.readthedocs.io/en/suricata-5.0.0/rules/intro.html#).",
                    "properties": {
                      "action": {
                        "type": "string"
                      },
                      "header": {
                        "description": "The basic rule criteria for Network Firewall to use to inspect packet headers in stateful traffic flow inspection. Traffic flows that match the criteria are a match for the corresponding StatefulRule.",
                        "properties": {
                          "destination": {
                            "type": "string"
                          },
                          "destinationPort": {
                            "type": "string"
                          },
                          "direction": {
                            "type": "string"
                          },
                          "protocol": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string"
                          },
                          "sourcePort": {
                            "type": "string"
                          }
                        },
                        "type": "object",
                        "additionalProperties": false
                      },
                      "ruleOptions": {
                        "items": {
                          "description": "Additional settings for a stateful rule. This is part of the StatefulRule configuration.",
                          "properties": {
                            "keyword": {
                              "type": "string"
                            },
                            "settings": {
                              "items": {
                                "type": "string"
                              },
                              "type": "array"
                            }
                          },
                          "type": "object",
                          "additionalProperties": false
                        },
                        "type": "array"
                      }
                    },
                    "type": "object",
                    "additionalProperties": false
                  },
                  "type": "array"
                },
                "statelessRulesAndCustomActions": {
                  "description": "Stateless inspection criteria. Each stateless rule group uses exactly one of these data types to define its stateless rules.",
                  "properties": {
                    "customActions": {
                      "items": {
                        "description": "An optional, non-standard action to use for stateless packet handling. You can define this in addition to the standard action that you must specify. \n You define and name the custom actions that you want to be able to use, and then you reference them by name in your actions settings. \n You can use custom actions in the following places: \n - In a rule group's StatelessRulesAndCustomActions specification. The custom actions are available for use by name inside the StatelessRulesAndCustomActions where you define them. You can use them for your stateless rule actions to specify what to do with a packet that matches the rule's match attributes. \n - In a FirewallPolicy specification, in StatelessCustomActions. The custom actions are available for use inside the policy where you define them. You can use them for the policy's default stateless actions settings to specify what to do with packets that don't match any of the policy's stateless rules.",
                        "properties": {
                          "actionDefinition": {
                            "description": "A custom action to use in stateless rule actions settings. This is used in CustomAction.",
                            "properties": {
                              "publishMetricAction": {
                                "description": "Stateless inspection criteria that publishes the specified metrics to Amazon CloudWatch for the matching packet. This setting defines a CloudWatch dimension value to be published.",
                                "properties": {
                                  "dimensions": {
                                    "items": {
                                      "description": "The value to use in an Amazon CloudWatch custom metric dimension. This is used in the PublishMetrics CustomAction. A CloudWatch custom metric dimension is a name/value pair that's part of the identity of a metric. \n Network Firewall sets the dimension name to CustomAction and you provide the dimension value. \n For more information about CloudWatch custom metric dimensions, see Publishing Custom Metrics (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html#usingDimensions) in the Amazon CloudWatch User Guide (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatch.html).",
                                      "properties": {
                                        "value": {
                                          "type": "string"
                                        }
                                      },
                                      "type": "object",
                                      "additionalProperties": false
                                    },
                                    "type": "array"
                                  }
                                },
                                "type": "object",
                                "additionalProperties": false
                              }
                            },
                            "type": "object",
                            "additionalProperties": false
                          },
                          "actionName": {
                            "type": "string"
                          }
                        },
                        "type": "object",
                        "additionalProperties": false
                      },
                      "type": "array"
                    },
                    "statelessRules": {
                      "items": {
                        "description": "A single stateless rule. This is used in StatelessRulesAndCustomActions.",
                        "properties": {
                          "priority": {
                            "format": "int64",
                            "type": "integer"
                          },
                          "ruleDefinition": {
                            "description": "The inspection criteria and action for a single stateless rule. Network Firewall inspects each packet for the specified matching criteria. When a packet matches the criteria, Network Firewall performs the rule's actions on the packet.",
                            "properties": {
                              "actions": {
                                "items": {
                                  "type": "string"
                                },
                                "type": "array"
                              },
                              "matchAttributes": {
                                "description": "Criteria for Network Firewall to use to inspect an individual packet in stateless rule inspection. Each match attributes set can include one or more items such as IP address, CIDR range, port number, protocol, and TCP flags.",
                                "properties": {
                                  "destinationPorts": {
                                    "items": {
                                      "description": "A single port range specification. This is used for source and destination port ranges in the stateless rule MatchAttributes, SourcePorts, and DestinationPorts settings.",
                                      "properties": {
                                        "fromPort": {
                                          "format": "int64",
                                          "type": "integer"
                                        },
                                        "toPort": {
                                          "format": "int64",
                                          "type": "integer"
                                        }
                                      },
                                      "type": "object",
                                      "additionalProperties": false
                                    },
                                    "type": "array"
                                  },
                                  "destinations": {
                                    "items": {
                                      "description": "A single IP address specification. This is used in the MatchAttributes source and destination specifications.",
                                      "properties": {
                                        "addressDefinition": {
                                          "type": "string"
                                        }
                                      },
                                      "type": "object",
                                      "additionalProperties": false
                                    },
                                    "type": "array"
                                  },
                                  "protocols": {
                                    "items": {
                                      "format": "int64",
                                      "type": "integer"
                                    },
                                    "type": "array"
                                  },
                                  "sourcePorts": {
                                    "items": {
                                      "description": "A single port range specification. This is used for source and destination port ranges in the stateless rule MatchAttributes, SourcePorts, and DestinationPorts settings.",
                                      "properties": {
                                        "fromPort": {
                                          "format": "int64",
                                          "type": "integer"
                                        },
                                        "toPort": {
                                          "format": "int64",
                                          "type": "integer"
                                        }
                                      },
                                      "type": "object",
                                      "additionalProperties": false
                                    },
                                    "type": "array"
                                  },
                                  "sources": {
                                    "items": {
                                      "description": "A single IP address specification. This is used in the MatchAttributes source and destination specifications.",
                                      "properties": {
                                        "addressDefinition": {
                                          "type": "string"
                                        }
                                      },
                                      "type": "object",
                                      "additionalProperties": false
                                    },
                                    "type": "array"
                                  },
                                  "tcpFlags": {
                                    "items": {
                                      "description": "TCP flags and masks to inspect packets for, used in stateless rules MatchAttributes settings.",
                                      "properties": {
                                        "flags": {
                                          "items": {
                                            "type": "string"
                                          },
                                          "type": "array"
                                        },
                                        "masks": {
                                          "items": {
                                            "type": "string"
                                          },
                                          "type": "array"
                                        }
                                      },
                                      "type": "object",
                                      "additionalProperties": false
                                    },
                                    "type": "array"
                                  }
                                },
                                "type": "object",
                                "additionalProperties": false
                              }
                            },
                            "type": "object",
                            "additionalProperties": false
                          }
                        },
                        "type": "object",
                        "additionalProperties": false
                      },
                      "type": "array"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "statefulRuleOptions": {
              "description": "Additional options governing how Network Firewall handles the rule group. You can only use these for stateful rule groups.",
              "properties": {
                "ruleOrder": {
                  "type": "string"
                }
              },
              "type": "object",
              "additionalProperties": false
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "ruleGroupName": {
          "description": "The descriptive name of the rule group. You can't change the name of a rule group after you create it.",
          "type": "string"
        },
        "rules": {
          "description": "A string containing stateful rule group rules specifications in Suricata flat format, with one rule per line. Use this to import your existing Suricata compatible rule groups. \n You must provide either this rules setting or a populated RuleGroup setting, but not both. \n You can provide your rule group specification in Suricata flat format through this setting when you create or update your rule group. The call response returns a RuleGroup object that Network Firewall has populated from your string.",
          "type": "string"
        },
        "sourceMetadata": {
          "description": "A complex type that contains metadata about the rule group that your own rule group is copied from. You can use the metadata to keep track of updates made to the originating rule group.",
          "properties": {
            "sourceARN": {
              "type": "string"
            },
            "sourceUpdateToken": {
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "tags": {
          "description": "The key:value pairs to associate with the resource.",
          "items": {
            "description": "A key:value pair associated with an Amazon Web Services resource. The key:value pair can be anything you define. Typically, the tag key represents a category (such as \"environment\") and the tag value represents a specific value within that category (such as \"test,\" \"development,\" or \"production\"). You can add up to 50 tags to each Amazon Web Services resource.",
            "properties": {
              "key": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            },
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "type_": {
          "description": "Indicates whether the rule group is stateless or stateful. If the rule group is stateless, it contains stateless rules. If it is stateful, it contains stateful rules.",
          "type": "string"
        }
      },
      "required": [
        "capacity",
        "ruleGroupName",
        "type_"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "description": "RuleGroupStatus defines the observed state of RuleGroup",
      "properties": {
        "ackResourceMetadata": {
          "description": "All CRs managed by ACK have a common `Status.ACKResourceMetadata` member that is used to contain resource sync state, account ownership, constructed ARN for the resource",
          "properties": {
            "arn": {
              "description": "ARN is the Amazon Resource Name for the resource. This is a globally-unique identifier and is set only by the ACK service controller once the controller has orchestrated the creation of the resource OR when it has verified that an \"adopted\" resource (a resource where the ARN annotation was set by the Kubernetes user on the CR) exists and matches the supplied CR's Spec field values. TODO(vijat@): Find a better strategy for resources that do not have ARN in CreateOutputResponse https://github.com/aws/aws-controllers-k8s/issues/270",
              "type": "string"
            },
            "ownerAccountID": {
              "description": "OwnerAccountID is the AWS Account ID of the account that owns the backend AWS service API resource.",
              "type": "string"
            },
            "region": {
              "description": "Region is the AWS region in which the resource exists or will exist.",
              "type": "string"
            }
          },
          "required": [
            "ownerAccountID",
            "region"
          ],
          "type": "object",
          "additionalProperties": false
        },
        "conditions": {
          "description": "All CRS managed by ACK have a common `Status.Conditions` member that contains a collection of `ackv1alpha1.Condition` objects that describe the various terminal states of the CR and its backend AWS service API resource",
          "items": {
            "description": "Condition is the common struct used by all CRDs managed by ACK service controllers to indicate terminal states  of the CR and its backend AWS service API resource",
            "properties": {
              "lastTransitionTime": {
                "description": "Last time the condition transitioned from one status to another.",
                "format": "date-time",
                "type": "string"
              },
              "message": {
                "description": "A human readable message indicating details about the transition.",
                "type": "string"
              },
              "reason": {
                "description": "The reason for the condition's last transition.",
                "type": "string"
              },
              "status": {
                "description": "Status of the condition, one of True, False, Unknown.",
                "type": "string"
              },
              "type": {
                "description": "Type is the type of the Condition",
                "type": "string"
              }
            },
            "required": [
              "status",
              "type"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "ruleGroupResponse": {
          "description": "The high-level properties of a rule group. This, along with the RuleGroup, define the rule group. You can retrieve all objects for a rule group by calling DescribeRuleGroup.",
          "properties": {
            "capacity": {
              "format": "int64",
              "type": "integer"
            },
            "consumedCapacity": {
              "format": "int64",
              "type": "integer"
            },
            "description": {
              "type": "string"
            },
            "encryptionConfiguration": {
              "description": "A complex type that contains optional Amazon Web Services Key Management Service (KMS) encryption settings for your Network Firewall resources. Your data is encrypted by default with an Amazon Web Services owned key that Amazon Web Services owns and manages for you. You can use either the Amazon Web Services owned key, or provide your own customer managed key. To learn more about KMS encryption of your Network Firewall resources, see Encryption at rest with Amazon Web Services Key Managment Service (https://docs.aws.amazon.com/kms/latest/developerguide/kms-encryption-at-rest.html) in the Network Firewall Developer Guide.",
              "properties": {
                "keyID": {
                  "type": "string"
                },
                "type_": {
                  "type": "string"
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "lastModifiedTime": {
              "format": "date-time",
              "type": "string"
            },
            "numberOfAssociations": {
              "format": "int64",
              "type": "integer"
            },
            "ruleGroupARN": {
              "type": "string"
            },
            "ruleGroupID": {
              "type": "string"
            },
            "ruleGroupName": {
              "type": "string"
            },
            "ruleGroupStatus": {
              "type": "string"
            },
            "snsTopic": {
              "type": "string"
            },
            "sourceMetadata": {
              "description": "High-level information about the managed rule group that your own rule group is copied from. You can use the the metadata to track version updates made to the originating rule group. You can retrieve all objects for a rule group by calling DescribeRuleGroup (https://docs.aws.amazon.com/network-firewall/latest/APIReference/API_DescribeRuleGroup.html).",
              "properties": {
                "sourceARN": {
                  "type": "string"
                },
                "sourceUpdateToken": {
                  "type": "string"
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "tags": {
              "items": {
                "description": "A key:value pair associated with an Amazon Web Services resource. The key:value pair can be anything you define. Typically, the tag key represents a category (such as \"environment\") and the tag value represents a specific value within that category (such as \"test,\" \"development,\" or \"production\"). You can add up to 50 tags to each Amazon Web Services resource.",
                "properties": {
                  "key": {
                    "type": "string"
                  },
                  "value": {
                    "type": "string"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "type": "array"
            },
            "type_": {
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "updateToken": {
          "description": "A token used for optimistic locking. Network Firewall returns a token to your requests that access the rule group. The token marks the state of the rule group resource at the time of the request. \n To make changes to the rule group, you provide the token in your request. Network Firewall uses the token to ensure that the rule group hasn't changed since you last retrieved it. If it has changed, the operation fails with an InvalidTokenException. If this happens, retrieve the rule group again to get a current copy of it with a current token. Reapply your changes as needed, then try the operation again using the new token.",
          "type": "string"
        }
      },
      "type": "object",
      "additionalProperties": false
    }
  },
  "type": "object"
}
