1 year ago
A few days ago, I wrote a blog post about Using Citrix ingress controller with Azure Kubernetes Service. In this post, I’m going to show how easy it is to use the Custom Resource Definitions from Citrix to replace the Server header in an HTTP response, as well as removing it completely.
If you would like to know more about Custom Resource Definitions, see the Custom Resources documentation on kubernetes.io. If you want to know more about what you can do with them from Citrix, see this developer documentation Using Rewrite and Responder policies in Kubernetes.
If you deploy the example I’ve used in my blog post, you should have a few apache PODs up an running. These will be using a Server header looking something like this:
In our first example, we will rewrite it to show as asterisks instead of Apache:
apiVersion: citrix.com/v1 kind: rewritepolicy metadata: name: rewriteserverheader spec: rewrite-policies: - servicenames: - apache rewrite-policy: operation: replace target: 'HTTP.RES.HEADER("Server")' modify-expression: '"****"' comment: 'Rewrite HTTP Response Server header' direction: RESPONSE rewrite-criteria: 'HTTP.RES.HEADER("Server").EXISTS'
apiVersion: citrix.com/v1 kind: rewritepolicy metadata: name: deleteserverheader spec: rewrite-policies: - servicenames: - apache rewrite-policy: operation: delete_http_header target: 'Server' comment: 'Delete HTTP Response Server header' direction: RESPONSE rewrite-criteria: 'HTTP.RES.HEADER("Server").EXISTS'
And now will it instead be deleted:
These are just two easy examples of how you can get the cloud native experience using Citrix ADC CPX and the Citrix ingress controller.
Feel free to comment here or on GitHub if you have any questions or feedback!
Vi erbjuder personlig rådgivning med författaren för 1400 SEK per timme. Anmäl ditt intresse i här så återkommer vi så snart vi kan.