WIP Support for the new riak_control#125
Conversation
* /system_info, returning riak, otp versions, uptime; * /cluster, emulating `riak admin cluster` commands; * /tictacaae, returning `riak admin tictacaae treestatus`; * /vnode, for per-vnode backend status report (currently leveled only); * /security, emulating parts of `riak admin security` (i.e., users, groups, grants, permissions).
now printing a JSON object
to work with json parsers that may choke on very large ints
…tiot/openriak-3.4/riak_control
|
I have some general concerns here: about the proliferation of rest endpoints, the change of default security stance, and the exposure of those not controlling security through "riak security". I have an alternative suggestion as an approach, to have a single
The aim here is:
Obviously this creates a requirement for the observability tool to handle term_to_binary/binary_to_term - but I know this has been done in Perhaps I'm being selfish here, but especially if there are other observability tools planned, I don't want to have a flood of changes to riak_kv to support lots of new REST endpoints. We have It also think the single endpoint with the proposed URL scheme would make life much easier for those that audit and restrict control to Riak via proxy policies. |
|
I agree on all points except this one: execution of arbitrary Erlang code in the fashion of In its current, primitive form, users that will have access to riak from riak_control, have to be created in advance, with |
|
I have concerns about For the authentication parts, normally there would be a 'super' admin that can't be deleted or modified that's able to 'fix' anything that others broke. In our case, logging onto the server and using the CLI solves this issue. I didn't look through the diff in detail yet, but I did skim it and I don't see any additional grants added. I believe we only have a few grants for buckets (riak_core.) and a few for objects (riak_kv.). So I'm not sure how this UI is going to be protected. Are we going to add new grants to allow this kind of system administration? Something like |
|
I found it: This is good. I still suggest we have more fine-grained controls though. |
My suggestion was that the eval API would be constrained by a three lists of {Module, Function, Arity} tuples, against which the request would match (with separate lists for monitoring, configuration and security so that these can be specifically enable/disabled). So I don't think I was suggesting "execution of arbitrary Erlang code" ... which I hope means we're in agreement in principle, although the how to implement the restrictions on |
|
Linking this issue - #139 - as we will need to fix this before extending further the number of route definitions. |
59db078 to
343aa61
Compare
|
Progress report. I have combined all requests under a single endpoint, An example request: A response will be a JSON with a "result" key containing the structured data, or an "error" key with an error string. All this will be documented in QuickDocs. Regarding permissions, I can think of the following:
Ideas, suggestions (specifically around permission classes and granularity)? |
|
The permission classes and granularity seem to correct to me. All seems good at this stage. As mentioned before we should be able to control this without enabling security - i.e. block use of the API, or restrict its used based on the high-level permission classes. |
|
Indeed, bolting riak_control-specific users and permissions onto existing riak security infrastructure was too much of an ad-hoc solution. I propose the following:
Questions I have:
|
This reverts commit 9a5ff10.
|
My thoughts:
E.g. |
|
I was thinking something much simpler. By "high-level permission classes" I just meant enable/disable the individual groups (operations, monitoring, security) Riak control API is enabled/disabled in config as you suggest (default disabled). The three categories are than controlled via riak.conf (i.e. either enabled or disabled - and security will be by default disabled, the other two enabled - assuming you enable the global control). I don't think there should be a need for a user unless you have security enabled. i.e. if you want granular controls, and restrict to peer IPs etc - that is what riak security is for. There should be special permission groups for the three categories, but nothing different to how riak security works at present. If you don't want to enable security you just have the ability to enable/disable globally, and by category (e.g. operations, monitoring and security). If you don't want to enable security, it is because you have trust built into your environment - so managing super-users etc is overhead. Security is complicated enough in Riak, I don't think we should add a new layer. We just need to ensure that no-one is compromised by default. If you really, really want to add an extra layer of protection on top of the enable/disable and existing security controls - then add support for a X-Riak-Cookie header on this API, and require a hash of the erlang cookie to be passed (the thing that if you know you could use to connect with anyway). |
50a1dbf to
490d974
Compare
|
Following discussion on 24th March. Somethings are agreed:
Somethings there was majority support for:
There was then an outstanding decision to be take on one of three options going forward:
The primary trade-off is between the functional need for enterprise grade security features in riak control, and the risk that project to introduce Control may increase in complexity. This complexity will not just be in the development overheads but in finding resource to assure that work and the necessary testing, in a timely manner in-time for a Riak 4.0 release. @pjaclark to discuss with @hmmr - and report back next week, on both the preferred choice and the resourcing of a plan for the development, test and assurance of that choice. |
|
Option (c) is more appealing to me: independent pool of users, and independence of whether the standard riak security is enabled. I even fancy a separate webmachine instance serving /ctl endpoint, and moving it from riak_kv over to riak_api. |
|
One options we may have with the new SilverMachine prototype, is simplified "drop-in" API support. Essentially we will have a config item in The number is the priority of the module when matching on routes. If this config is set, on startup we will look for the module in some folder, and code-load it, and then add the module/priority to the routes. The module in its match_route/3 callback says what URLs to match on, and then governs its behaviour through its other callback functions (defined in This will allow for additional APIs to be added to deployed Riak nodes - they don't need to be added to the package. So that something like Riak Control can be added over a Riak installation, rather than having to be an integrated part of Riak. To view WIP of SilverMachine - OpenRiak/riak_api@openriak-3.4...nhse-o40-orkv.i141-silvermachine |
|
Following discussions, a new approach is proposed in which we formally define and expose a set of AWS-style HTTP API requests, served by a separate app, riak_admin_api (rather than squeezing those into riak_kv_wm_* bunch). A new PR to supersede this one is #152. |
This PR implements a set of new HTTP API endpoints for riak_control (external app):
riak admin clustercommands;riak admin tictacaae treestatus;riak admin vnode-status);riak admin security(i.e., users, groups, grants, permissions).