-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reworks access control API #136
Conversation
This interface will be removed.
Break up monolithic SecurityPlugin API into three parts. 1. Authentication. 2. Authorization. 3. Access Control decision. Left to ChannelProviders
While there is nothing here which must be replicated on the java side (it isn't a protocol change) I'd like to solicit opinions from @shroffk and/or @georgweiss on whether this new abstraction makes sense. |
The default value of _verificationStatus is reported on auth timeout. Make sure it isn't success.
I'm not planning to merge this until I've successfully used it with, at least, the PVA gateway access controls. There are a few remaining questions which I have:
|
@shroffk / @georgweiss: I remember using the JAAS API for Java AuthN/AuthZ. Would that be a reasonable thing to use, or are the scopes too different? |
Not sure I completely understand why this is not a protocol change. How would a client present roles (or rather: list of groups)? |
Michael wrote earlier:
So my understanding is that lists of groups are not sent by the client. |
Fair enough. I was mostly looking to test the idea of expressing groups using the existing UAG syntax. https://code.launchpad.net/~epics-core/epics-base/+git/asLib/+merge/358821/comments/941273 |
This understanding is correct. The structure send by clients has, and had, only two string fields: "host" and "user". |
So the suggested procedure to pass group (role) names is through the exchange of PeerInfo, right? |
Why not use a config file as we currently do for the gateway and IOC CA Access Security configuration? Re this not being a protocol change, isn't that only true for CA, and only so long as CA only implements the current client supplied username authentication mechanism? Does pvAccess have a protocol version, and wouldn't we need to update that so a pvAccess server can be backward compatible w/ an older pvAccess client? Would these older clients just ignore the list of AuthenticationPlugin names? |
I agree re needing more than 16 groups. If we populate the groups a user belongs to through POSIX, many of our users belong to way more than 16 groups as each experiment gets a numbered group. Do we need to limit these? |
As clarification, any mention of "ca" here refers only to what was the |
For a gateway, sure. This change is more general, and applies to all PVA clients and servers. A configuration file is still a possibility in the same way that all targets load .acf files.
The question is then what to do. Simply start denying puts? Force a disconnect? Somehow fallback to anonymous? I see potential problems with all of these options. And of course there is the mechanical question of how, and where, a timeout would be expressed. Neither the existing or proposed APIs provide a way to do this. Absent any better ideas my inclination is the force disconnect option as this error case is handled. This leaves the usual issue of avoiding a reset loop though. |
I've been able to use this successfully so far with my second PVA gateway prototype. I also think I've sorted out the mingw/windows linking error. I still haven't had any feedback on whether Also, the larger question of how to handle runtime configuration probably can't be resolved without input from someone who has actually tried to deploy it. So I think this change is now merge-able. |
Ignore NGROUPS_MAX. On Darwin NGROUPS_MAX==16. The actual limit is higher. getgrouplist() is weird...
@georgweiss encountered some portability issues with To assist with this I've added the $ ./testApp/O.linux-x86_64/showauth
User: mdavidsaver
Groups:
audio
bluetooth
... Some test results I'd like to have.
In all cases, the first question is whether it builds and runs at all. With Linux and Mac, I'm interested to know the execution time of With Windows, I'm interested what is actually reported, and whether it would be useful in an ACF file. |
On a Macbook pro, in an LDAP environment, I have:
It seems that the OS occasionally needs to refresh LDAP information. In those cases execution time doubles or triples (at least real and sys). |
Mac 10.13.6 (office machine, with AD, member of ~90 groups)
|
redhat 7.6 (LDAP, member of ~30 groups)
|
@georgweiss @hartmansm Thanks for the feedback.
wrt. execution time, I think that giving In both cases it is then necessary to consult As an aside, |
@mdavidsaver sorry I missed $USER in your instructions. Typical results below . . . Mac 10.13.6 (office machine, with AD, member of ~90 groups)
redhat 7.6 (LDAP, member of ~30 groups)
|
Do we need to test with an LDAP server not answering, i.e. no connection / time out? |
time groups $USER on Macbook pro (10.13.6), AD connected (not LDAP as stated previously), 30 groups: results are a wee bit faster (1-2 ms) compared to "time groups georgweiss". However, this is tested over VPN, will provide results from office network on Thursday. |
I would like to know how this fails.
imo. this is a situation which sites using centralized authentication systems should already be mitigating by eg. having redundant LDAP servers and/or local caching with nscd. |
A quick check on Mac (pulled the network cable) was inconclusive. Group information is cached and it replied as before (and as quickly) for both |
In the ESS environment Mac does not use nscd. Guess it depends on client configuration, but I observe the same thing as Steven: there is obviously a cache, and on Linux we will be able to tweak the cache expire time. What I do observe is a longer (~100-200 ms) response time for command "groups" when the host has been off-line and goes back on-line. Suppose this is caused by an AD request. |
No and I have been unable to determine what service is doing the cacheing. Some online docs gave information relevant to earlier versions of MacOS but implied that 10.13 only uses the cache for offline mode which doesn't match my observations. Our linux hosts do not use nscd either. I think the cacheing is provided by |
ESS is using sssd and we can set the cache expire time based on whatever we will conclude from future tests. |
I was planning to merge this past weekend. But I decided to do PVD merges first, and then epics-base/pvDataCPP#62 blew up in my face. So I don't see any blockers. |
... so I'll merge when I have time to deal with any CI failures. |
The added requirement of linking against netapi32.dll has triggered downstream build failures. @anjohnson Can we avoid patching every downstream module Makefile? I'm wondering about adding |
Building on Windows for Windows has mixed results. EPICS_HOST_ARCH=windows-x64-mingw builds fine. EPICS_HOST_ARCH=windows-x64 does not build due to:
|
Adding Contrary to what we implied in the meeting, I see no need to set the parallel The other solution might be to conditionally (when |
Still a work in progress, but I think far enough along for a first look.
This is not a protocol change. It should not be a change to the "ca" style authentication mechanism. It is an incompatible change in
pv/security.h
. The only breakage I anticipate is pvaSrv.There is a lot here. The part I'd most like to have feedback on is the new
PeerInfo
struct, and associated new methodChannelRequester::getPeerInfo()
.PeerInfo
is intended to be the common piece which joins together three stages: Authentication (who are you?), Authorization (what can you do?), and access control decisions (do I let you do it?). The last part is no longer handled implicitly. Rather, everyChannelProvider
is responsible to inspecting thePeerInfo
provided (or not) by each requester.The core information which a ChannelProvider will use is
PeerInfo::account
(aka username, aka principle name, ...), andPeerInfo::roles
(aka. groups, aka attributes, ...). The later being an unordered set of strings which can be tested (any other meaning is left to a ChannelProvider).pvAccessCPP/src/remote/pv/security.h
Lines 104 to 145 in fa484a8
pvAccessCPP/src/client/pv/pvAccess.h
Lines 1138 to 1156 in fa484a8
The mechanics of this process is:
AuthenticationPlugin
names.PeerInfo
.PeerInfo
through a chain ofAuthorizationPlugin
s which may modify it.So far there is only one
AuthorizationPlugin
which populatesPeerInfo::roles
with the list of *NIX group names, or Windows group names (tested with cross mingw only so far). vxWorks and RTEMS leave this empty. This happens only on the server side.The credentials (account name and roles) of connect clients is printed by the
pvasr
iocsh command. A concurrently runningpvmonitor cnt
shows.