TIS0102 - Invalid HTTP Method or gRPC Name
Only valid HTTP methods and fully-qualified gRPC names are allowed.
To avoid misconfigurations, ensure that only valid HTTP methods or fully-qualified gRPC names are used in your Istio policies. Incorrect values can lead to configuration errors and ineffective policy application.
Examples
-
AuthorizationPolicywith Invalid HTTP MethodapiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
name: invalid-http-method
namespace: example-namespace
spec:
rules:
- to:
- operation:
methods: ["INVALID_METHOD"]Explanation: The
AuthorizationPolicyspecifies an HTTP methodINVALID_METHODwhich is not a valid HTTP method. Only valid methods likeGET,POST,PUT, etc., are allowed. -
AuthorizationPolicywith Incorrect gRPC NameapiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
name: incorrect-grpc-name
namespace: example-namespace
spec:
rules:
- to:
- operation:
methods: ["/invalid/service/name"]Explanation: The gRPC name specified is incorrect. A valid gRPC name must be in the form
/package.service/method. -
VirtualServicewith Invalid HTTP MethodapiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: virtual-service-invalid-method
namespace: example-namespace
spec:
http:
- match:
- method:
type: INVALID_METHOD
route:
- destination:
host: my-serviceExplanation: The HTTP method specified in the
VirtualServiceis invalid. Only standard HTTP methods likeGET,POST, etc., should be used.
Recommendation
Change or remove the invalid method. It must be a valid HTTP method or a fully-qualified gRPC service name in the form /package.service/method.
-
Use a Valid HTTP Method
Update the configuration to use a valid HTTP method.
apiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
name: valid-http-method
namespace: example-namespace
spec:
rules:
- to:
- operation:
methods: ["GET"] -
Use a Valid gRPC Name
Specify a fully-qualified gRPC service name in the correct format.
apiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
name: valid-grpc-name
namespace: example-namespace
spec:
rules:
- to:
- operation:
methods: ["/package.service/method"] -
Remove Invalid Method or Update with Correct Value
Remove or replace the invalid method in the
VirtualServicewith a valid HTTP method.apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: virtual-service-valid-method
namespace: example-namespace
spec:
http:
- match:
- method:
type: GET
route:
- destination:
host: my-service