YP, Netgroups, And Fixing Insecure hosts.equiv

Steve Simmons scs at lokkur.uucp
Thu Jan 19 18:39:52 AEST 1989


Douglas M. Bates writes:
>Bernard Silver writes:
>> A (hopefully) harmless intrusion brought to our notice the default
>> /etc/hosts.equiv in 3.5 and 4.0 The default consists of a single "+",
>> which in this context means ALL known hosts are trusted.
>
>This can be a bad security hole in some configurations.

Try "in all configurations where you attach to machines you don't
control".  Fortunately there is something you can do about it.  Take the
following with a grain of salt as it's all from memory (ie, go RTFM).
However:

YP has a db called netgroups.  It allows you to define arbitrary
collections of users, machines, and domains (domain in this case means YP
domain, not Internet domain).  You define a name followed by a list of
triplets of user, host, domain.  Leaving one of the three blank means
"none", putting in a star means "any" (again, RTFM on this, OK?).  So you
could define a list of all the machines in your domain by (trusted_hosts)
(*,host1,my_domain) (*,host2,my_domain) . . .  Now put whatever hosts you
want into the YP hosts db, but don't put them into trusted_hosts unless
they're really in your domain.

Now change your hosts.equiv files from '+' to '+ at trusted_hosts'.  Voila!
You've locked out other machines from rlogin, rcp, rsh, etc.

You can use the same technique for password files and login management.
We created a 'staff' group like

  staff (scs,*,my_domain) (wnl,*,my_domain) . . .

We also created a 'everybody' group.  On machines we wanted only staff
people on, the bottom of the password file looked like:

  + at staff
  - at everybody
  +:: (std yp passwd end)

Worked fine.

Warning!  Experiment very carefully before installing a lot of this stuff.
Also, it can add to your YP overhead.

Steve Simmons, Inland Sea Software, Ltd.         scs at lokkur.dexter.mi.us
   9353 Hidden Lake, Dexter, MI. 48130                   313-426-8981



More information about the Comp.sys.sun mailing list