From owner-freebsd-security@FreeBSD.ORG Sun Sep 25 04:58:01 2005 Return-Path: X-Original-To: freebsd-security@freebsd.org Delivered-To: freebsd-security@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 89ED416A41F for ; Sun, 25 Sep 2005 04:58:01 +0000 (GMT) (envelope-from bigby@ephemeron.org) Received: from home.ephemeron.org (66-215-204-113.dhcp.rvsd.ca.charter.com [66.215.204.113]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0C71643D48 for ; Sun, 25 Sep 2005 04:57:58 +0000 (GMT) (envelope-from bigby@ephemeron.org) Received: from home.fake.net (bigby@localhost [127.0.0.1]) by home.ephemeron.org (8.12.11/8.12.11) with ESMTP id j8P4vwx6071268; Sat, 24 Sep 2005 21:57:58 -0700 (PDT) (envelope-from bigby@ephemeron.org) Received: from localhost (bigby@localhost) by home.fake.net (8.12.11/8.12.6/Submit) with ESMTP id j8P4vvQ2071265; Sat, 24 Sep 2005 21:57:57 -0700 (PDT) X-Authentication-Warning: home.fake.net: bigby owned process doing -bs Date: Sat, 24 Sep 2005 21:57:57 -0700 (PDT) From: Bigby Findrake X-X-Sender: bigby@home.fake.net To: "carlopmart@gmail.com" In-Reply-To: <43359660.2060606@gmail.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-security Subject: Re: Encrypt some services with ipsec X-BeenThere: freebsd-security@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Security issues \[members-only posting\]" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Sep 2005 04:58:01 -0000 On Sat, 24 Sep 2005, carlopmart@gmail.com wrote: > Hi all, > > I have two prodction servers with FreeBSD 5.4 (all security patches > are applied). They running some services like dns, ssh, http, ftp, etc. > But I woukd like to encrypt some services for some hosts with ipsec when > it is accessed. For example: > > - DNS resolution: not encrypted. > - DNS replication master-slave: encrypted by ipsec. > - Telnet: encrypted by ipsec for some hosts. Deny for the rest. > - SSH: not encrypted for some hosts, encryted by ipsec for the rest. > - FTP: encrypted by ipsec. > - HTTP: encrypted by ipsec. > > is it possible to encrypt only certains services under ipsec tunnel?? Someone please check my work. >From the man page on setkey, it looks like you can specify ports for the security policies, so you could specify certain ports to encrypt, and not specify a blanket/default host-to-host policy for all other traffic, so that all other unspecified traffic is unencrypted. For example: ---------------------BEGIN /ETC/IPSEC.CONF------------------------------- # # encrypt all dns traffic between master host A (1.1.1.1) slave host B # (1.1.1.2) spadd 1.1.1.1 1.1.1.2[53] any -P out ipsec esp/transport//use; spadd 1.1.1.2[53] 1.1.1.1 any -P in ipsec esp/transport//use; spadd 1.1.1.1[53] 1.1.1.2 any -P out ipsec esp/transport//use; spadd 1.1.1.2 1.1.1.1[53] any -P in ipsec esp/transport//use; # # encrypt telnet traffic between server A (1.1.1.1) and client C (1.1.1.3) spadd 1.1.1.1[23] 1.1.1.3 any -P out ipsec esp/transport//use; spadd 1.1.1.3 1.1.1.1[23] any -P in ipsec esp/transport//use; # # encrypt http traffic between server A (1.1.1.1) and client D (1.1.1.4) spadd 1.1.1.1[80] 1.1.1.4 any -P out ipsec esp/transport//use; spadd 1.1.1.4 1.1.1.1[80] any -P in ipsec esp/transport//use; # # and all other traffic is unencrypted. ---------------------END /ETC/IPSEC.CONF------------------------------- /-------------------------------------------------------------------------/ I used to hate weddings; all the Grandmas would poke me and say, "You're next sonny!" They stopped doing that when i started to do it to them at funerals. finger://bigby@ephemeron.org http://www.ephemeron.org/~bigby/ news://news.ephemeron.org/alt.lemurs /-------------------------------------------------------------------------/