Post by Chris NelsonPost by James CarlsonPost by Chris Nelsonauthentication? Presumably at that point, CALLER_ID would still be in
the environment and, I'd hope, the PPP user name would be available
somehow so I could act on the combination of those two values.
[...]
Post by Chris NelsonPost by James CarlsonI suspect it's really this latter one that you'll want to use.
Why the latter? Building a binary plug-in seems a *lot* more work than
writing a script. Is it just that it's a more secure mechanism (the
code can't be read, even if the file can be seen)? Also, while I said
No, that's not the reason.
The reason is that it sounds like you want to make the access decision
based on a combination of factors -- the authentication data supplied
by the peer *plus* some additional factors.
In order to do that correctly, you need to be synchronous with the
rest of the framework operation. If you use auth-up (or, worse,
ip-up), then the "bad" user who authenticates correctly but is calling
from the wrong location will be able to gain access for a short period
of time before your script runs, you find the problem, and you kill
off the connection.
You're introducing an unnecessary race condition.
Post by Chris Nelson"after PAP authentication" I really meant just authentication; I'm
using PAP now but I'd rather be flexible in case I add/use another
method later.
Sure. auth-up works for both, though it's not what you really need
here.
Post by Chris NelsonIt seems to me that by using ip-up, I can secure against
misconfiguration or hacking so that if someone gets in without
authentication I can trap it and drop the link in ip-up. If I put my
code in auth-up then if noauth gets into the mix my code won't get
executed. Right?
How exactly does "noauth" get "into the mix?" It needs to be added by
someone with root privileges -- all of the files that can specify that
option are writable only by root. If it's getting "into the mix," I
think it means that you have a root user who is vandalizing the
system. All bets are off if that happens, as such a user can scribble
on /dev/kmem.
In any event, if you want to use it with "noauth" (relying on just
some external data to authenticate the connection, and nothing else),
then the same sorts of issues apply, though the regular PAP auth hook
won't work. I think you'll need to modify the main pppd code to do
that correctly.
Post by Chris Nelsonecho "CALLER_ID=$CALLER_ID;export CALLER_ID" >/etc/ppp/cid.$DEVICE
Nit: use /var instead. I also suggest that you just write the value
itself into the file, and read it back, rather than using "." to
execute that file. Executing dynamically-created content can be a bit
hazardous.
Post by Chris Nelson/usr/sbin/pppd silent auth -chap +pap
That might not do what you're expecting. "+pap" is the deprecated
(obsolete) alias of the "require-pap" option. It causes pppd to
demand PAP from the peer.
However, "-chap" is "refuse-chap." That means that if the peer asks
us to identify *ourselves* using CHAP, we'll refuse. Do your clients
ask your server for authentication? That's not often done.
The +/- flags here are not at all symmetric in operation.
Also note that "silent" likely doesn't do anything good here. This
should *not* have to be done. If it does, then it sounds like there
are bugs somewhere.
Post by Chris NelsonI imagine the same code could be in auth-up.
The problem is (still) that those scripts are fired off by pppd when
the event occurs, but that the PPP link itself intentionally isn't
"paused" to wait for them to complete.
If you're trying to add another authentication factor, this isn't the
place to do it.
--
James Carlson, KISS Network <***@sun.com>
Sun Microsystems / 1 Network Drive 71.232W Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677