Create apache-shenyu-gateway-admin-detect.yaml #10454
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This nuclei template:
https://github.com/apache/shenyu
I've validated this template locally?
Steps to test:
Apache ShenYu Docker:
Download the Docker images:
$ docker pull apache/shenyu-admin
$ docker pull apache/shenyu-bootstrap
Running container:
$ docker run -d --name shenyu-admin-quickstart -p 9095:9095 --net shenyu apache/shenyu-admin
$ docker run -d --name shenyu-quickstart -p 9195:9195 -e "shenyu.local.enabled=true" -e SHENYU_SYNC_WEBSOCKET_URLS=ws://shenyu-admin-quickstart:9095/websocket --net shenyu apache/shenyu-bootstrap
Get the IP Address of Apache ShenYu Gateway:
$ docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' shenyu-admin-quickstart
$ docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' shenyu-quickstart
Configure the Apache ShenYu:
$ curl --location --request POST 'http://<shenyu-quickstart_IP_ADDRESS>:9195/shenyu/plugin/selectorAndRules' \ --header 'Content-Type: application/json' \ --header 'localKey: 123456' \ --data-raw '{ "pluginName": "divide", "selectorHandler": "[{\"upstreamUrl\":\"127.0.0.1:8080\"}]", "conditionDataList": [{ "paramType": "uri", "operator": "match", "paramValue": "/**" }], "ruleDataList": [{ "ruleHandler": "{\"loadBalance\":\"random\"}", "conditionDataList": [{ "paramType": "uri", "operator": "match", "paramValue": "/**" }] }] }'
4.And the access URL will be http://<shenyu-admin-quickstart-obteined_inspect_IP_Address>:9095/
Nuclei execution:
$ ~/go/bin/nuclei -t apache-shenyu-gateway-detect.yaml -u "http://<local_machine_or_shenyu-admin-quickstart_IP_Address>:9095" -H "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36"