Repository navigation
rgw: beast ssl certs config through config-key - #33287
Conversation
cbodley
left a comment
There was a problem hiding this comment.
frontend code looks great, but it feels like overkill to add two new services for this. can we just call into the rados service directly, until we have a need for more abstraction?
There was a problem hiding this comment.
can we document the security considerations here? aren't these keys being sent over the wire in cleartext unless messenger encryption is on? how can we make it impossible for users to get this wrong?
a link to some docs about setting up the keys would be helpful too
There was a problem hiding this comment.
Maybe we can require that if this is set then client_modes and possibly mon_client_modes are set to secure only?
There was a problem hiding this comment.
Also, we should probably enforce secure mode all on communication to/from mon and mgr. But that's maybe a different discussion. See #33288 also.
|
@cbodley overkill? maybe. But I think it's vital that we hide the specific rados implementation details if possible. |
|
Would it make sense to somehow make rgw default to pulling the cert from rgw/$realm/... or rgw/$realm/$zone/...? If I'm reading this right the key name needs to be set midway in the rgw_frontends config option, which is a bit awkward. If not present there, it could fall back to looking in the rgw_data dir with a default filename instead. |
|
@liewegas it never looks unless the fronend config is set, so that would require adding new defaults to the frontend, and also have it behave differently. There are no default filenames. I'm not against doing that, but need to make sure that would make sense. |
0b914e2 to
9a742fc
Compare
can't the frontend just check whether a rados service exists, and use that to call mon_command()? i don't think we need a generic interface, especially as part of the service framework, until we have a second implementation. this could just be a helper function like: int rgw_config_key_get(RGWSI_RADOS *rados, const string& key, bufferlist *result); |
|
@cbodley why should the frontend know about rados? The servification was done in order to make things abstracted from the get go, so that we hide all that logic from the upper layers. |
9a742fc to
0071849
Compare
|
@liewegas added the option to have set default configurables for rgw frontends, and by default it will have for beast frontend |
| "{" | ||
| "\"prefix\": \"config-key get\", " | ||
| "\"key\": \"" + key + "\"" | ||
| "}"; |
There was a problem hiding this comment.
While we're at it. For completeness sake, should be make this also able to get stuff out of the config database, not just the config-key database?
Maybe we can't call it ConfigKey in that case.
Maybe it needs to be MonConfig::get and MonConfig::getkey or something(or just GSWSI_Config::)? If you look into the cephadm rgw code, they set the realm and zone using config set (https://github.com/ceph/ceph/blob/master/src/pybind/mgr/cephadm/module.py#L2089-L2100). So we need to plumb RGW to also check for not just config-key get but also config get.
This will take the who into account too and not have to worry about different keys for different RGW instances.
Just a thought
There was a problem hiding this comment.
oh, looking closer, can we just access the config get from config-key using key:
config/client.rgw.<realm>.<zone> but it's the processing the scope of the config which is, I'm assuming, already handled by the mon config, ie, the who. For example, do I need to check config/client/option or config/client.rgw,realm/option or config/client.rgw.realm.zone etc
That'll be alot more requests to the mon asking about existence of options then just a single call to mon config get
There was a problem hiding this comment.
@matthewoliver I'm not sure I quite follow you, but note that config get won't apply the defaults on rgw_frontends
There was a problem hiding this comment.
Sorry, I'm probably confusing things. The problem is outside of rgw_frontends. The current version of the rgw code in cephadm sets the rgw_realm and rgw_zone options via config set. But not sure RGW currently can or does get these values from the config get. So am guessing will always default to default for both.
I know that is out of scope of what your trying to do here. But was raising the suggestion of extending the plumbing you've done to include config get in the hopes that it means we don't need to dump the realm and zone in the ceph.conf in the container to really get it to work.
NOTE: I'm assuming here that in fact RGW currently isn't talking to config get as I can't see any mon_commands that do that. And pretty sure the ConfigProxy object doesn't.
There was a problem hiding this comment.
You can configure these params (realm, zonegroup, zone) via the ceph config commands.
ok. i'm still uncomfortable with the proliferation of services and the amount of boilerplate it takes to do simple things. i'd really like to revisit services as part of the zipper project, to see which parts can be taken over by the rados store, and which abstractions still make sense outside more than anything, i just want the development of new features to be easy |
now that these are the defaults, i'd really like to avoid trying to fetch these keys from the monitor unless the frontend configuration actually requests an ssl port |
DO NOT MERGE, STILL A WIP. I'm looking at attempting to add iscsi to cephadm, but frankly having to place the crt and key inside the container makes things a little harder. While working on adding RGW SSL support to cephadm sage et al, suggested we should use the mon config-key store the certs[0][1]. So thought why not fo the same here. This will mean when setting up service in cephadm, an op can either place the certs: ceph config-key put 'iscsi/<client-name>/iscsi-gateway.crt -i <file> ceph config-key put 'iscsi/<client-name>/iscsi-gateway.key -i <file> Or if given the files via cephadm we can place them on their behalf. [0]- ceph/ceph#32951 [1]- ceph/ceph#33287 Signed-off-by: Matthew Oliver <[email protected]>
I understand that. I do think that when dealing with rados internal apis we should avoid introducing new direct calls into them. Keeping everything in under |
|
DO NOT MERGE, STILL A WIP. I'm looking at attempting to add iscsi to cephadm, but frankly having to place the crt and key inside the container makes things a little harder. While working on adding RGW SSL support to cephadm sage et al, suggested we should use the mon config-key store the certs[0][1]. So thought why not fo the same here. This will mean when setting up service in cephadm, an op can either place the certs: ceph config-key put 'iscsi/<client-name>/iscsi-gateway.crt -i <file> ceph config-key put 'iscsi/<client-name>/iscsi-gateway.key -i <file> Or if given the files via cephadm we can place them on their behalf. [0]- ceph/ceph#32951 [1]- ceph/ceph#33287 Signed-off-by: Matthew Oliver <[email protected]>
Signed-off-by: Yehuda Sadeh <[email protected]>
Signed-off-by: Yehuda Sadeh <[email protected]>
Fixes: https://tracker.ceph.com/issues/44128 For example: radosgw --rgw-frontends= \ "beast ssl_port=443 \ ssl_certificate=config://rgw/cert/domain.crt \ ssl_private_key=config://rgw/cert/domain.key" Signed-off-by: Yehuda Sadeh <[email protected]>
Signed-off-by: Yehuda Sadeh <[email protected]>
Also don't exit immediately if can't init ssl cert, only if cert is actually needed (if ssl_port/ssl_endpoint is configured). Signed-off-by: Yehuda Sadeh <[email protected]>
Signed-off-by: Yehuda Sadeh <[email protected]>
Add the following variables:
$realm, $realm_id, $zonegroup, $zonegroup_id, $zone, $zone_id
Variables can also be passed in with curly braces, e.g., ${realm}
Signed-off-by: Yehuda Sadeh <[email protected]>
Allow setting default configuration per frontend config option. This allows having defaults for part of the frontend config options and set others. Signed-off-by: Yehuda Sadeh <[email protected]>
Signed-off-by: Yehuda Sadeh <[email protected]>
So that central config could be used Signed-off-by: Yehuda Sadeh <[email protected]>
6f48e96 to
e28718e
Compare
|
retest this please |
|
do we have a way to guarantee that the keys are fetched over an encrypted connection? |
|
They are by default. But rgw could also verify that the I'm not 100% sold on (2), though--usually we don't prevent users from doing weird things if that's what the config options say to do. |
cbodley
left a comment
There was a problem hiding this comment.
TODO: document security considerations, warn on insecure mon connection
| // claim the reference and release it after subsequent destructors have fired | ||
| auto cct = global_init(&defaults, args, CEPH_ENTITY_TYPE_CLIENT, | ||
| CODE_ENVIRONMENT_DAEMON, | ||
| flags, "rgw_data", false); |
There was a problem hiding this comment.
@yehudasa a regression was reported in https://tracker.ceph.com/issues/44661 because we're now calling global_init() before this happens below:
// If civetweb or beast is configured as a frontend, prevent global_init() from
// dropping permissions by setting the appropriate flag.
flags |= CINIT_FLAG_DEFER_DROP_PRIVILEGES;our teuthology suite uses these privileged ports and hasn't seen any failures here, so I'm not sure where the gap is
I'm looking at attempting to add iscsi to cephadm, but frankly having to place the crt and key inside the container makes things a little harder. While working on adding RGW SSL support to cephadm sage et al, suggested we should use the mon config-key store the certs[0][1]. So thought why not fo the same here. This will mean when setting up service in cephadm, an op can either place the certs: ceph config-key put 'iscsi/<client-name>/iscsi-gateway.crt -i <file> ceph config-key put 'iscsi/<client-name>/iscsi-gateway.key -i <file> Or if given the files via cephadm we can place them on their behalf. [0]- ceph/ceph#32951 [1]- ceph/ceph#33287 Signed-off-by: Matthew Oliver <[email protected]>
Implements: https://tracker.ceph.com/issues/44128
For example:
Signed-off-by: Yehuda Sadeh [email protected]
Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard backendjenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume tox