You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2022/05/13 15:05:25 UTC
[GitHub] [trafficserver] brbzull0 opened a new pull request, #8849: Jsonrpc socket credentials work
brbzull0 opened a new pull request, #8849:
URL: https://github.com/apache/trafficserver/pull/8849
When moved from `traffic_manger` admin socket to the new `JSONRPC` api the management api [restrictions](https://docs.trafficserver.apache.org/en/latest/admin-guide/files/records.config.en.html?highlight=restricted#proxy.config.admin.api.restricted) were left out, the only restriction in place was related to the creation of the jsonrpc unix socket(either `700` or `777`) just at user level, before we have the capability to check the socket’s peers credentials and allow or deny certain operations, like read only(record lookup) vs operation that can change the state of ATS(like a record set). This was a useful method to allow some non-root users to perform some actions while we leave root users to have full access to the API.
This change brings a similar base approach, and allows the RPC API to let the developers specify this restriction when registering the jsonrpc node handler.
As(of course) the message parsing is done earlier than the actual rpc handler callback is made and there was no connection between them I had to implement a sort of late check that can be set by the network part and be executed later on right before the actual call is made, now a Context object travels from the server to the actual rpc manager which can be populated with specific checks which are executed after the rpc handler was found valid.
All this permissions checks are handled by a new error code (`Unauthorized Action`) which is the high level error, depending of the particular check that failed to pass the sub error section will be set, leaving the client an error like this:
```
{
"jsonrpc": "2.0",
"error":{
"code": 10,
"message": "Unauthorized action",
"data":[
{
"code": 2,
"message":"Denied privileged API access for uid=XXX gid=XXX"
}
]
},
"id":"5e273ec0-3e3b-4a81-90ec-aeee3d38073f"
}
```
This change also includes documentation support and also some clean up in the code.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficserver] brbzull0 closed pull request #8849: Jsonrpc socket credentials work( and related work to support this sort of checks )
Posted by GitBox <gi...@apache.org>.
brbzull0 closed pull request #8849: Jsonrpc socket credentials work( and related work to support this sort of checks )
URL: https://github.com/apache/trafficserver/pull/8849
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficserver] brbzull0 commented on pull request #8849: Jsonrpc socket credentials work( and related work to support this sort of checks )
Posted by GitBox <gi...@apache.org>.
brbzull0 commented on PR #8849:
URL: https://github.com/apache/trafficserver/pull/8849#issuecomment-1137446135
I am creating a new one with separated commits for an easy review.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org