AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Socket : security and accept ...

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Security and Java
View previous topic :: View next topic  
Author Message
pabegue
Guest





PostPosted: Wed Oct 01, 2003 7:26 pm    Post subject: Socket : security and accept ... Reply with quote



I want to accept connection only if the host of the clients of the
sockets are members of a restricted list. This list is specified on my
server.


For instance, my server is waiting on accept().

My client is trying to connect using connect(). If the client is
hosted by an unauthorized host, I want the client to catch an
IOException (connection refused by foreign host) on the connect call.

I think that I need to use SecurityManager but I really do not know
how to do that ...

If someone could give me a sample code ...


Thanks by advance


Pascal BEGUE
Back to top
Gordon Beaton
Guest





PostPosted: Thu Oct 02, 2003 8:23 am    Post subject: Re: Socket : security and accept ... Reply with quote



On 1 Oct 2003 12:26:58 -0700, pabegue wrote:
Quote:
I want to accept connection only if the host of the clients of the
sockets are members of a restricted list. This list is specified on my
server.

For instance, my server is waiting on accept().

My client is trying to connect using connect(). If the client is
hosted by an unauthorized host, I want the client to catch an
IOException (connection refused by foreign host) on the connect call.

This is only possible in some limited sense, when a (multihomed)
server only accepts connections on a specific network interface.
Connections to the specific interface will be accepted, but attempts
to connect to the other interfaces will result in "connection
refused". Unless your list of approved clients coincides with the
topology of your network, this isn't your solution.

In the normal case, the server cannot prevent connections from
succeeding. It has to accept each connection, but can see where it
comes from, check against the list, and close it if necessary.

The client won't get "connection refused" in this case, but if you
write both server and client code, then the server can tell the client
why it closes the connection, and the client can deal with that
information in an appropriate way.

/gordon

--
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e

Back to top
Pankaj Kumar
Guest





PostPosted: Thu Oct 02, 2003 7:08 pm    Post subject: Re: Socket : security and accept ... Reply with quote



If you are running your server program on a Linux (2.4 kernel) then
you can use "iptables" to set the packet filtering rules so that all
incoming connections from a specified set of IP addresses are DROPPED.

Pankaj Kumar,
Author, "J2EE Security ..." (www.j2ee-security.net)

[email]pabegue (AT) airfrance (DOT) fr[/email] (pabegue) wrote in message news:<ce62cbd2.0310011126.d1ed14a (AT) posting (DOT) google.com>...
Quote:
I want to accept connection only if the host of the clients of the
sockets are members of a restricted list. This list is specified on my
server.


For instance, my server is waiting on accept().

My client is trying to connect using connect(). If the client is
hosted by an unauthorized host, I want the client to catch an
IOException (connection refused by foreign host) on the connect call.

I think that I need to use SecurityManager but I really do not know
how to do that ...

If someone could give me a sample code ...


Thanks by advance


Pascal BEGUE

Back to top
Sven Boeckelmann
Guest





PostPosted: Tue Oct 07, 2003 10:56 am    Post subject: Re: Socket : security and accept ... Reply with quote

Why don't you consider unsing SSLSocket.
If you build a proper PKI (private key infrastructure)
you can have the clients to authenticate themselves by
using the TrustManager. All the data being transferred will also
be encrypted. That's much better and basically more flexible than
just using plain IP-Address based authentication.

Cheers,
Sven

On Wed, 01 Oct 2003 12:26:58 -0700, pabegue wrote:

Quote:
I want to accept connection only if the host of the clients of the
sockets are members of a restricted list. This list is specified on my
server.


For instance, my server is waiting on accept().

My client is trying to connect using connect(). If the client is
hosted by an unauthorized host, I want the client to catch an
IOException (connection refused by foreign host) on the connect call.

I think that I need to use SecurityManager but I really do not know
how to do that ...

If someone could give me a sample code ...


Thanks by advance


Pascal BEGUE


Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Security and Java All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.