본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

MeshTrafficPermissions 정책 구성 참조

원문 보기 위키 갱신

MeshTrafficPermissions 정책 구성 참조 (MeshTrafficPermissions Policy Configuration Reference)

이 문서는 Kong Mesh에서 MeshTrafficPermissions 정책을 설정할 때 사용하는 스키마 구성 요소를 하나씩 설명하는 참조 자료예요. from 목록으로 정책을 적용할 클라이언트 그룹을 매칭하고, default의 action에서 Allow, Deny, AllowWithShadowDeny 중 어떤 동작을 내릴지 정하는 구조예요. 클라이언트 그룹은 targetRef로 Mesh, MeshService, MeshGateway 같은 리소스를 참조해 지정하고, proxyTypes로 Sidecar와 Gateway 중 정책이 적용될 데이터 플레인 유형을 고를 수 있어요

출처: 문서

본문

구성

{
  "description": "Spec is the specification of the Kuma MeshTrafficPermission resource.",
  "properties": {
    "from": {
      "description": "From list makes a match between clients and corresponding configurations",
      "items": {
        "properties": {
          "default": {
            "description": "Default is a configuration specific to the group of clients referenced in\n'targetRef'",
            "properties": {
              "action": {
                "description": "Action defines a behavior for the specified group of clients:",
                "enum": [
                  "Allow",
                  "Deny",
                  "AllowWithShadowDeny"
                ],
                "type": "string"
              }
            },
            "type": "object"
          },
          "targetRef": {
            "description": "TargetRef is a reference to the resource that represents a group of\nclients.",
            "properties": {
              "kind": {
                "description": "Kind of the referenced resource",
                "enum": [
                  "Mesh",
                  "MeshSubset",
                  "MeshGateway",
                  "MeshService",
                  "MeshExternalService",
                  "MeshMultiZoneService",
                  "MeshServiceSubset",
                  "MeshHTTPRoute",
                  "Dataplane"
                ],
                "type": "string"
              },
              "labels": {
                "additionalProperties": {
                  "type": "string"
                },
                "description": "Labels are used to select group of MeshServices that match labels. Either Labels or\nName and Namespace can be used.",
                "type": "object"
              },
              "mesh": {
                "description": "Mesh is reserved for future use to identify cross mesh resources.",
                "type": "string"
              },
              "name": {
                "description": "Name of the referenced resource. Can only be used with kinds: `MeshService`,\n`MeshServiceSubset` and `MeshGatewayRoute`",
                "type": "string"
              },
              "namespace": {
                "description": "Namespace specifies the namespace of target resource. If empty only resources in policy namespace\nwill be targeted.",
                "type": "string"
              },
              "proxyTypes": {
                "description": "ProxyTypes specifies the data plane types that are subject to the policy. When not specified,\nall data plane types are targeted by the policy.",
                "items": {
                  "enum": [
                    "Sidecar",
                    "Gateway"
                  ],
                  "type": "string"
                },
                "type": "array"
              },
              "sectionName": {
                "description": "SectionName is used to target specific section of resource.\nFor example, you can target port from MeshService.ports[] by its name. Only traffic to this port will be affected.",
                "type": "string"
              },
              "tags": {
                "additionalProperties": {
                  "type": "string"
                },
                "description": "Tags used to select a subset of proxies by tags. Can only be used with kinds\n`MeshSubset` and `MeshServiceSubset`",
                "type": "object"
              }
            },
            "required": [
              "kind"
            ],
            "type": "object"
          }
        },
        "required": [
          "targetRef"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "rules": {
      "description": "Rules defines inbound permissions configuration",
      "items": {
        "properties": {
          "default": {
            "properties": {
              "allow": {
                "description": "Allow definees a list of matches for which access will be allowed",
                "items": {
                  "properties": {
                    "sni": {
                      "description": "SNI defines a matcher configuration for matching by SNI value carried on the TLS connection",
                      "properties": {
                        "type": {
                          "description": "Type defines how to match traffic by SNI. Only `Exact` is supported.",
                          "enum": [
                            "Exact"
                          ],
                          "type": "string"
                        },
                        "value": {
                          "description": "Value is the SNI carried on the TLS connection that needs to match for the configuration to be applied",
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "value"
                      ],
                      "type": "object"
                    },
                    "spiffeID": {
                      "description": "SpiffeID defines a matcher configuration for SpiffeID matching",
                      "properties": {
                        "type": {
                          "description": "Type defines how to match incoming traffic by SpiffeID. `Exact` or `Prefix` are allowed.",
                          "enum": [
                            "Exact",
                            "Prefix"
                          ],
                          "type": "string"
                        },
                        "value": {
                          "description": "Value is SpiffeID of a client that needs to match for the configuration to be applied",
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "value"
                      ],
                      "type": "object"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "allowWithShadowDeny": {
                "description": "AllowWithShadowDeny defines a list of matches for which access will be allowed but emits logs as if\nrequests are denied",
                "items": {
                  "properties": {
                    "sni": {
                      "description": "SNI defines a matcher configuration for matching by SNI value carried on the TLS connection",
                      "properties": {
                        "type": {
                          "description": "Type defines how to match traffic by SNI. Only `Exact` is supported.",
                          "enum": [
                            "Exact"
                          ],
                          "type": "string"
                        },
                        "value": {
                          "description": "Value is the SNI carried on the TLS connection that needs to match for the configuration to be applied",
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "value"
                      ],
                      "type": "object"
                    },
                    "spiffeID": {
                      "description": "SpiffeID defines a matcher configuration for SpiffeID matching",
                      "properties": {
                        "type": {
                          "description": "Type defines how to match incoming traffic by SpiffeID. `Exact` or `Prefix` are allowed.",
                          "enum": [
                            "Exact",
                            "Prefix"
                          ],
                          "type": "string"
                        },
                        "value": {
                          "description": "Value is SpiffeID of a client that needs to match for the configuration to be applied",
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "value"
                      ],
                      "type": "object"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "deny": {
                "description": "Deny defines a list of matches for which access will be denied",
                "items": {
                  "properties": {
                    "sni": {
                      "description": "SNI defines a matcher configuration for matching by SNI value carried on the TLS connection",
                      "properties": {
                        "type": {
                          "description": "Type defines how to match traffic by SNI. Only `Exact` is supported.",
                          "enum": [
                            "Exact"
                          ],
                          "type": "string"
                        },
                        "value": {
                          "description": "Value is the SNI carried on the TLS connection that needs to match for the configuration to be applied",
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "value"
                      ],
                      "type": "object"
                    },
                    "spiffeID": {
                      "description": "SpiffeID defines a matcher configuration for SpiffeID matching",
                      "properties": {
                        "type": {
                          "description": "Type defines how to match incoming traffic by SpiffeID. `Exact` or `Prefix` are allowed.",
                          "enum": [
                            "Exact",
                            "Prefix"
                          ],
                          "type": "string"
                        },
                        "value": {
                          "description": "Value is SpiffeID of a client that needs to match for the configuration to be applied",
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "value"
                      ],
                      "type": "object"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              }
            },
            "type": "object"
          }
        },
        "required": [
          "default"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "targetRef": {
      "description": "TargetRef is a reference to the resource the policy takes an effect on.\nThe resource could be either a real store object or virtual resource\ndefined inplace.",
      "properties": {
        "kind": {
          "description": "Kind of the referenced resource",
          "enum": [
            "Mesh",
            "MeshSubset",
            "MeshGateway",
            "MeshService",
            "MeshExternalService",
            "MeshMultiZoneService",
            "MeshServiceSubset",
            "MeshHTTPRoute",
            "Dataplane"
          ],
          "type": "string"
        },
        "labels": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Labels are used to select group of MeshServices that match labels. Either Labels or\nName and Namespace can be used.",
          "type": "object"
        },
        "mesh": {
          "description": "Mesh is reserved for future use to identify cross mesh resources.",
          "type": "string"
        },
        "name": {
          "description": "Name of the referenced resource. Can only be used with kinds: `MeshService`,\n`MeshServiceSubset` and `MeshGatewayRoute`",
          "type": "string"
        },
        "namespace": {
          "description": "Namespace specifies the namespace of target resource. If empty only resources in policy namespace\nwill be targeted.",
          "type": "string"
        },
        "proxyTypes": {
          "description": "ProxyTypes specifies the data plane types that are subject to the policy. When not specified,\nall data plane types are targeted by the policy.",
          "items": {
            "enum": [
              "Sidecar",
              "Gateway"
            ],
            "type": "string"
          },
          "type": "array"
        },
        "sectionName": {
          "description": "SectionName is used to target specific section of resource.\nFor example, you can target port from MeshService.ports[] by its name. Only traffic to this port will be affected.",
          "type": "string"
        },
        "tags": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Tags used to select a subset of proxies by tags. Can only be used with kinds\n`MeshSubset` and `MeshServiceSubset`",
          "type": "object"
        }
      },
      "required": [
        "kind"
      ],
      "type": "object"
    }
  },
  "type": "object"
}

관련 리소스

더 알아보기 (Learn more)