Skip to content

Commit

Permalink
AppProtect gRPC automation tests (#1603)
Browse files Browse the repository at this point in the history
* Add AppProtect gRPC tests

Co-authored-by: Michael Pleshakov <[email protected]>
  • Loading branch information
vepatel and pleshakov authored Jun 3, 2021
1 parent 89ba98e commit 65adfd1
Show file tree
Hide file tree
Showing 10 changed files with 513 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/data/appprotect/appprotect-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ metadata:
name: appprotect-secret
type: kubernetes.io/tls
data:
tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURMakNDQWhZQ0NRREFPRjl0THNhWFdqQU5CZ2txaGtpRzl3MEJBUXNGQURCYU1Rc3dDUVlEVlFRR0V3SlYKVXpFTE1Ba0dBMVVFQ0F3Q1EwRXhJVEFmQmdOVkJBb01HRWx1ZEdWeWJtVjBJRmRwWkdkcGRITWdVSFI1SUV4MApaREViTUJrR0ExVUVBd3dTWTJGbVpTNWxlR0Z0Y0d4bExtTnZiU0FnTUI0WERURTRNRGt4TWpFMk1UVXpOVm9YCkRUSXpNRGt4TVRFMk1UVXpOVm93V0RFTE1Ba0dBMVVFQmhNQ1ZWTXhDekFKQmdOVkJBZ01Ba05CTVNFd0h3WUQKVlFRS0RCaEpiblJsY201bGRDQlhhV1JuYVhSeklGQjBlU0JNZEdReEdUQVhCZ05WQkFNTUVHTmhabVV1WlhoaApiWEJzWlM1amIyMHdnZ0VpTUEwR0NTcUdTSWIzRFFFQkFRVUFBNElCRHdBd2dnRUtBb0lCQVFDcDZLbjdzeTgxCnAwanVKL2N5ayt2Q0FtbHNmanRGTTJtdVpOSzBLdGVjcUcyZmpXUWI1NXhRMVlGQTJYT1N3SEFZdlNkd0kyaloKcnVXOHFYWENMMnJiNENaQ0Z4d3BWRUNyY3hkam0zdGVWaVJYVnNZSW1tSkhQUFN5UWdwaW9iczl4N0RsTGM2SQpCQTBaalVPeWwwUHFHOV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ucHBIdjZ5RHg4QnorSGRBb0dBTkFPKwpwUDI4VExVOVFKa0dhNWRUWjBOMWx4VU9nRjFWazM2dDBqeTlFN0tHTjBVVzVFMEtVK3BCQmo0N2RGMmVvRlFwCk5NZ2NoNWM0QnhrYWJFSndtTW5neXpKVllYc3FkWmJ1SksycU5LWDJ1VW5LTURNV1JSejNXamY3N3J6NUJHRG0Kbk9XbE5zWDJuY1lEMjF0Wk1Od1JqMmpPb2FPYmtUQUxUc0cvTWlFQ2dZRUF5aGFEVFh5RnNicEF3bU5yejRuawpoVjVDREVSdnp6MW5NRHp6bTdselhEQkpKZit3Q1VmUnhmY2pSRlV2RWV1cmJ5d2RncForeHBHSkhheE1Pd1FlCk5Bd2RvSjFtbDhHVGozRjYrTUpnZU5CdTgza09abXpXSzQ2MW54NGJhUmplVlBMWTN2WFgvZmVMNi92UnNjQmMKWnpaWkthTVI1REhtU3cwZ3MwSFN1VWc9Ci0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K
32 changes: 32 additions & 0 deletions tests/data/appprotect/grpc/grpc-block-saygoodbye.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: appprotect.f5.com/v1beta1
kind: APPolicy
metadata:
name: grpc-block-saygoodbye
spec:
policy:
blocking-settings:
violations:
- name: VIOL_GRPC_METHOD
block: true
alarm: true
applicationLanguage: utf-8
bot-defense:
settings:
isEnabled: false
grpc-profiles:
- associateUrls: true
defenseAttributes:
allowUnknownFields: false
maximumDataLength: "10000"
description: My first profile
idlFiles:
- idlFile:
fileName: autheid.proto
name: gProf1
idl-files:
- isBase64: true
fileName: autheid.proto
contents: Ly8gVGhlIGdyZWV0aW5nIHNlcnZpY2UgZGVmaW5pdGlvbi4KCnN5bnRheCA9ICJwcm90bzMiOwoKcGFja2FnZSBoZWxsb3dvcmxkOwoKc2VydmljZSBHcmVldGVyIHsKICAvLyBTZW5kcyBhIGdyZWV0aW5nCiAgcnBjIFNheUhlbGxvIChIZWxsb1JlcXVlc3QpIHJldHVybnMgKEhlbGxvUmVwbHkpIHt9Cn0KCi8vIFRoZSByZXF1ZXN0IG1lc3NhZ2UgY29udGFpbmluZyB0aGUgdXNlcidzIG5hbWUuCm1lc3NhZ2UgSGVsbG9SZXF1ZXN0IHsKICBzdHJpbmcgbmFtZSA9IDE7Cn0KCi8vIFRoZSByZXNwb25zZSBtZXNzYWdlIGNvbnRhaW5pbmcgdGhlIGdyZWV0aW5ncwptZXNzYWdlIEhlbGxvUmVwbHkgewogIHN0cmluZyBtZXNzYWdlID0gMTsKfQo=
name: valid_string_encoding_policy
template:
name: POLICY_TEMPLATE_NGINX_BASE
32 changes: 32 additions & 0 deletions tests/data/appprotect/grpc/grpc-block-sayhello.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: appprotect.f5.com/v1beta1
kind: APPolicy
metadata:
name: grpc-block-sayhello
spec:
policy:
blocking-settings:
violations:
- name: VIOL_GRPC_METHOD
block: True
alarm: True
applicationLanguage: utf-8
bot-defense:
settings:
isEnabled: false
grpc-profiles:
- associateUrls: true
defenseAttributes:
allowUnknownFields: false
maximumDataLength: "10000"
description: My first profile
idlFiles:
- idlFile:
fileName: autheid.proto
name: gProf1
idl-files:
- isBase64: true
fileName: autheid.proto
contents: Ly8gVGhlIGdyZWV0aW5nIHNlcnZpY2UgZGVmaW5pdGlvbi4KCnN5bnRheCA9ICJwcm90bzMiOwoKcGFja2FnZSBoZWxsb3dvcmxkOwoKc2VydmljZSBHcmVldGVyIHsKICAvLyBTZW5kcyBhIGdyZWV0aW5nCiAgcnBjIFNheUdvb2RieWUgKEhlbGxvUmVxdWVzdCkgcmV0dXJucyAoSGVsbG9SZXBseSkge30KfQoKLy8gVGhlIHJlcXVlc3QgbWVzc2FnZSBjb250YWluaW5nIHRoZSB1c2VyJ3MgbmFtZS4KbWVzc2FnZSBIZWxsb1JlcXVlc3QgewogIHN0cmluZyBuYW1lID0gMTsKfQoKLy8gVGhlIHJlc3BvbnNlIG1lc3NhZ2UgY29udGFpbmluZyB0aGUgZ3JlZXRpbmdzCm1lc3NhZ2UgSGVsbG9SZXBseSB7CiAgc3RyaW5nIG1lc3NhZ2UgPSAxOwp9Cg==
name: valid_string_encoding_policy
template:
name: POLICY_TEMPLATE_NGINX_BASE
25 changes: 25 additions & 0 deletions tests/data/appprotect/grpc/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: appprotect-ingress
annotations:
nginx.org/grpc-services: "grpc-svc"
kubernetes.io/ingress.class: "nginx"
appprotect.f5.com/app-protect-policy: "default/grpc"
appprotect.f5.com/app-protect-enable: "True"
appprotect.f5.com/app-protect-security-log-enable: "True"
appprotect.f5.com/app-protect-security-log: "default/logconf"
appprotect.f5.com/app-protect-security-log-destination: "syslog:server=172.17.0.10:514"
spec:
tls:
- hosts:
- appprotect.example.com
secretName: appprotect-secret
rules:
- host: appprotect.example.com
http:
paths:
- path: /helloworld.Greeter
backend:
serviceName: grpc-svc
servicePort: 50051
7 changes: 7 additions & 0 deletions tests/data/appprotect/grpc/nginx-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
kind: ConfigMap
apiVersion: v1
metadata:
name: nginx-config
namespace: nginx-ingress
data:
http2: "True"
32 changes: 32 additions & 0 deletions tests/data/common/app/grpc/app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: grpc
spec:
replicas: 1
selector:
matchLabels:
app: greeter
template:
metadata:
labels:
app: greeter
spec:
containers:
- name: greeter
image: nginxkic/test-grpc-server:0.1
ports:
- containerPort: 50051
---
apiVersion: v1
kind: Service
metadata:
name: grpc-svc
spec:
ports:
- port: 50051
targetPort: 50051
protocol: TCP
name: grpc
selector:
app: greeter
4 changes: 3 additions & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ urllib3==1.26.5
pytest-html==3.1.1
pytest-profiling==1.7.0
more-itertools==8.8.0
mock==4.0.3
mock==4.0.3
grpcio==1.38.0
grpcio-tools==1.38.0
134 changes: 134 additions & 0 deletions tests/suite/grpc/helloworld_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions tests/suite/grpc/helloworld_pb2_grpc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

from suite.grpc.helloworld_pb2 import (
HelloRequest,
HelloReply,
)


class GreeterStub(object):
"""The greeting service definition.
"""

def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.SayHello = channel.unary_unary(
'/helloworld.Greeter/SayHello',
request_serializer=HelloRequest.SerializeToString,
response_deserializer=HelloReply.FromString,
)


class GreeterServicer(object):
"""The greeting service definition.
"""

def SayHello(self, request, context):
"""Sends a greeting
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')


def add_GreeterServicer_to_server(servicer, server):
rpc_method_handlers = {
'SayHello': grpc.unary_unary_rpc_method_handler(
servicer.SayHello,
request_deserializer=HelloRequest.FromString,
response_serializer=HelloReply.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'helloworld.Greeter', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
Loading

0 comments on commit 65adfd1

Please sign in to comment.