Open MggMuggins opened 4 months ago
I think a security first approach would be to always restrict certificates, and only unrestrict with a flag e.g. --unrestricted
. However, I don't think this is possible without breaking backwards compatibility.
In general though I agree, if passing a list of projects then the restricted property of the certificate is implicit.
@MggMuggins @markylaing are there any uses of an identity's projects list when not restricted?
If not then I think one way we can fix this is to require --restricted
be passed when providing --projects
flag.
@MggMuggins @markylaing are there any uses of an identity's projects list when not restricted?
No, we only check the project list of restricted certificates. Would it be worth also adding a warning log message if an unrestricted certificate has a project list?
If not then I think one way we can fix this is to require
--restricted
be passed when providing--projects
flag.
Yeah I think this is a good idea. It makes the usage more clear for now without breaking anything.
lxc config trust add
requires the--restricted
flag in order to actually restrict the identity to the specified set of projects. As a user this is very confusing; I would expect if I pass a set of projects to restrict the cert to, that the cert would be restricted. Per the help page:I propose removing
--restricted
and inferringcert.Restricted
from the presence/absence of--projects
.Current Behavior