Focus on Linux
How to check UID of process on the other side of local TCP/UDP connection Nov 24 2006 06:11PM
rainmailbox2001-ola yahoo ca (6 replies)
Re: Secure client/server file processing (was: How to check UID of process on the other side of local TCP/UDP connection) Nov 29 2006 07:49PM
Michael T. Babcock (mike triplepc com) (1 replies)
rainmailbox2001-ola (at) yahoo (dot) ca [email concealed] wrote:
> I have the following situation:
> - Client communicates with server via TCP or UDP.
> - Both client and server are on the same local host.
> - Server runs with root privilege.
>
Are you using the sockets for something other than this authentication?
You could use shared memory (not always portable) or unix sockets as
some have suggested, or simply use named pipes for that matter.

Are you using the UIDs of the files for anything interesting, or just to
make sure nobody else created the file on you? If you're just doing
this to make sure the client is who it claims to be, use a different
authentication system like a cryptographically strong hash function.

Decide what you care about: Do you care what the UID is for security
purposes, or just to make sure the same user created the file and is
talking to you? Do you need the file for processing, or is it just an
out-of-band security system? Do you need the socket for communication
of anything else, or is it just the security system?

If you're processing real files with data in them, create the file
securely (put users and server in the same group, make directory only
writable and usable by the group, etc.) with whatever metadata you need
inside it and then open a unix socket connection to your server app
telling it the name of the file and the SHA-1 (or other) hash of the
file you created (preferably with a negotiated salt involved). The
server can then process the file and make sure the signature matches,
and move on.

If its an insecure server, consider using real digital signatures,
perhaps kerberos authentication for clients and servers. There are lots
of good options out there.

--
Michael T. Babcock
Triple PC Ltd.

[ reply ]
Re: How to check UID of process on the other side of local TCP/UDP connection Nov 28 2006 02:31AM
Greg Metcalfe (metcalfegreg qwest net)
RE: How to check UID of process on the other side of local TCP/UDP connection Nov 27 2006 08:48PM
Bond Masuda (bond masuda jlbond com)
Re: How to check UID of process on the other side of local TCP/UDP connection Nov 27 2006 08:06PM
Luciano Miguel Ferreira Rocha (strange nsk no-ip org) (1 replies)
Re: How to check UID of process on the other side of local TCP/UDP connection Nov 28 2006 05:17PM
Filipe Varela (fcv dev6 com) (3 replies)
Re: How to check UID of process on the other side of local TCP/UDP connection Nov 29 2006 08:57PM
Luciano Miguel Ferreira Rocha (strange nsk no-ip org) (1 replies)
Re: How to check UID of process on the other side of local TCP/UDP connection Nov 30 2006 06:02PM
Filipe Varela (fcv dev6 com) (2 replies)
Re: How to check UID of process on the other side of local TCP/UDP connection Dec 01 2006 11:31PM
Glynn Clements (glynn gclements plus com)
Re: How to check UID of process on the other side of local TCP/UDP connection Dec 01 2006 09:38PM
Luciano Miguel Ferreira Rocha (strange nsk no-ip org)
Re: How to check UID of process on the other side of local TCP/UDP connection Nov 29 2006 08:13PM
Glynn Clements (glynn gclements plus com)
Re: How to check UID of process on the other side of local TCP/UDP connection Nov 29 2006 07:24PM
Vladimir Mitiouchev (vovcia gmail com)
Re: How to check UID of process on the other side of local TCP/UDP connection Nov 27 2006 08:06PM
Vladimir Mitiouchev (vovcia gmail com) (2 replies)
Re: How to check UID of process on the other side of local TCP/UDP connection Nov 29 2006 06:29AM
Greg Metcalfe (metcalfegreg qwest net)
Re: How to check UID of process on the other side of local TCP/UDP connection Nov 28 2006 05:05PM
Michael Bacarella (mbac netgraft com)


 

Privacy Statement
Copyright 2010, SecurityFocus