The nomad job run command uses the Job Register API endpoint and is a write operation. I would therefore suggest changing the policy = "read" to policy = "write.
If you wanted to test a policy just for the nomad job run command execution then it would look something like:
Doesn’t that necessarily mean you’re giving more access than should be required? If the ‘submit-job’ capability is all that is required, a full ‘write’ policy is overkill. The fact that this is resulting in a 403 implies that the job register API requires more than just the ‘submit-job’ capability, or that something is broken in the capability system.
I Just ran through a reproduction for this on Nomad 1.0.4 and it worked without having to change the policy on the default namespace to write. I was able to use the policy as provided in the ticket. Perhaps there is something in the job that is running afoul of a different permission?
I have my reproduction script in this gist. I’m not sure what might have happened in @surajthakur’s environment.
Wanted to at least chime in with the results of my experiment.