> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ck-itsolutions.nl/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Firewall Rule

> Creates a new firewall rule



## OpenAPI

````yaml POST /firewall/rule
openapi: 3.0.1
info:
  title: Ck IT Solutions API
  description: An API that can be used to mange Ck IT Solutions products and services.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.ck-itsolutions.nl/v1
security:
  - ApiKeyAuth: []
paths:
  /firewall/rule:
    post:
      description: Creates a new firewall rule
      requestBody:
        description: Plant to add to the store
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/new_firewall'
        required: true
      responses:
        '200':
          description: Returns newly created firewall rule with uuid as json.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/list_rules'
        '400':
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    new_firewall:
      allOf:
        - $ref: '#/components/schemas/list_rules'
        - required:
            - dst
            - protocol
            - action
            - priority
          type: object
          properties:
            descr:
              description: Description of the firewall rule.
              type: string
            dst:
              description: >-
                Destination IP the firewall rule needs to be created for
                (subnets supported).
              type: string
            src:
              description: Source IP the firewall rule needs to match.
              type: object
              properties:
                start:
                  type: string
                  description: Start IP address for source IP range
                end:
                  type: string
                  description: End IP address for source IP range
            port:
              type: object
              properties:
                src:
                  type: object
                  properties:
                    start:
                      type: integer
                      description: Start port number for source port range
                    end:
                      type: integer
                      description: End port number for source port range
                dst:
                  type: object
                  properties:
                    start:
                      type: integer
                      description: Start port number for destination port range
                    end:
                      type: integer
                      description: End port number for destination port range
            protocol:
              description: >-
                Internet Protocol version this rule applies to. Allowed options:
                any, ip, hopopt, icmp, igmp, ggp, ipencap, st, tcp, egp, igp,
                pup, udp, hmp, xns-idp, rdp, iso-tp4, dccp, xtp, ddp, idpr-cmtp,
                ipv6, ipv6-route, ipv6-frag, idrp, rsvp, gre, esp, ah, skip,
                ipv6-icmp, ipv6-nonxt, ipv6-opts, rspf, vmtp, eigrp, ospf,
                ax.25, ipip, etherip, encap, pim, ipcomp, vrrp, l2tp, isis,
                sctp, fc, mobility-header, udplite, mpls-in-ip, manet, hip,
                shim6, wesp, rohc, ethernet, mptcp 
              type: string
            action:
              description: 'Allowed options: accept, continue, drop and reject'
              type: string
            priority:
              description: Rule priority with 1 being highest priority.
              type: integer
            disabled:
              description: Enable or disable the firewall rule.
              type: boolean
            tcpflags:
              description: >-
                TCP flags the rule must match to. Allowed options: fin, syn,
                rst, psh, ack, urg, ece, cwr
              type: array
            ratelimit:
              description: Ratelimit 0 - 4294967295.
              type: number
            packetlength:
              description: Packet length 1 - 65535.
              type: number
            packettype:
              description: 'Allowed options: broadcast, host, multicast, other'
              type: integer
            statetype:
              description: 'Allowed options: established, invalid, new, related.'
              type: string
    list_rules:
      required:
        - name
      type: object
    Error:
      required:
        - error
        - message
      type: object
      properties:
        message:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````