You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is possible for an operator to submit a register request to the CSI volume endpoint with a payload that is invalid and receive a 200 OK response. The register request successfully makes its ways via RPC and into raft. It misses any of Nomad's internal validation checks because the args.Volumes field is nil.
I believe inline with what I have seen in other agent endpoints, the decoded object should go through some basic validation before sending via RPC. Different endpoints approach validation in different ways:
using the payload below perform an API request: curl -v --request PUT --data @payload.json http://localhost:4646/v1/volume/csi/helloworld
perform the curl request again and notice the X-Nomad-Index header integer has been incremented
example payload:
{"Foo": "bar"}
Nomad logs
I added a test log message to display the output of the rafApply function call which also shows the raft index being update on subsequent calls as detailed in the reproduction steps.
Thanks for reporting this, @jrasell. Easy enough to fix, but we should take a pass through the other endpoints to make sure we haven't dropped the ball on this elsewhere.
I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Nomad version
Master commit
06f0f3a41563ac2cc557d8e68546ad6003b121ca
Operating system and Environment details
Reproduced on MacOS
Issue
It is possible for an operator to submit a register request to the CSI volume endpoint with a payload that is invalid and receive a 200 OK response. The register request successfully makes its ways via RPC and into raft. It misses any of Nomad's internal validation checks because the
args.Volumes
field is nil.I believe inline with what I have seen in other agent endpoints, the decoded object should go through some basic validation before sending via RPC. Different endpoints approach validation in different ways:
Reproduction steps
nomad agent -dev
curl -v --request PUT --data @payload.json http://localhost:4646/v1/volume/csi/helloworld
X-Nomad-Index
header integer has been incrementedexample payload:
Nomad logs
I added a test log message to display the output of the rafApply function call which also shows the raft index being update on subsequent calls as detailed in the reproduction steps.
The text was updated successfully, but these errors were encountered: