I’m trying to create a non-admin user that can authenticate via JSON-RPC and execute:[“SESSION”,“file”,“read”,{“path”:“/etc/config/network”}]
What I’ve found
- Device: RUTX50
- Firmware: RutOS 7.25.3
- JSON-RPC is enabled.
- Non-admin user (
filereader) can successfully log in viasession.login. - Admin user can successfully execute
file.read. - Non-admin user gets:
{ “code”: -32002, “message”: “Access denied”}
ACL investigation
ubus -v list file shows:
- read
- write
- list
- stat
- md5
- remove
- exec
/usr/share/rpcd/acl.d/superuser.json contains:
“file”: { “*”: [ “read”, “write”, “exec” ] }
I created: /usr/share/rpcd/acl.d/filereader.json
{ “filereader”: { “description”: “Allow file read only”, “read”: { “file”: { “*”: [ “read” ] } } } }
but the permission is not applied to the user (filereader)
Question
Has anyone successfully assigned a custom rpcd ACL (such as file.read) to a non-admin user on RutOS 7.25.3? If so, where is the user-to-ACL mapping configured? I can’t find any ACL assignment option in the WebUI or an obvious configuration in /etc/config/rpcd.