LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 11-15-2011, 03:47 PM   #1
WildDrake!
Member
 
Registered: Dec 2003
Location: Current Location: Colorado
Distribution: Ubuntu 14.10, Mint 17.1 Cinnamon and Mate
Posts: 101

Rep: Reputation: 15
OpenVZ: HOWto Communicate between VE's without creating a security weakness?


Debian 6 I'm a beginner...and your insight helps a lot!

I am looking at implementing the HN based firewall method described on the below page, where the HN creates the VE's firewalls:
http://wiki.openvz.org/Setting_up_an_iptables_firewall
If that isn't the firewall method I should be implementing for what I want to do, please point me to the firewall setup I do need.

I want my catalog sales in VE 101 and my company bookkeeping and accounting in VE 102 for security's sake. -At least, I am assuming it is more secure to do this.

From a Security viewpoint, what would be the best/proper way to communicate my sales happening in VE 101 to VE 102 where my business's bookkeeping is happening, thus having a fully integrated automatic environment?

And could you provide an example of the programming statement that would be used to send this information from VE 101 to VE 102, and for receiving that information in VE 102? (If it helps, I am planning to use shell scripts and python to stitch things together.)

Thanks!
 
Old 11-17-2011, 05:10 AM   #2
Cotun
Member
 
Registered: Jan 2009
Location: UK
Distribution: Debian Stable and Unstable
Posts: 61

Rep: Reputation: 21
I don't know if the online documentation for this has improved since I had to put my own firewall on my OpenVZ hardware server, but when I had to do it, I found nothing I read really helped me and asking on forums drew a blank as well So I'll be happy to help you as much as I can. I don't use Iptables directly and so I won't be able to help you with that, but I do have Shorewall running nicely. It filters all traffic and firewalls the hardware node as well as the VE's

Unfortunately you've caught me at a bad time, but give me a couple of days and I'll get back to you on this.
 
Old 11-17-2011, 12:01 PM   #3
WildDrake!
Member
 
Registered: Dec 2003
Location: Current Location: Colorado
Distribution: Ubuntu 14.10, Mint 17.1 Cinnamon and Mate
Posts: 101

Original Poster
Rep: Reputation: 15
Thanks Cotun! That would be fantastic! And, you're right, I have posted on forums and mailing lists, and not a single reply. It seems to me that shorewall would be ideal, but I couldn't get my questions answered on that either.

When I first started, I bumped into a OpenVZ server guy who does do what I want to do, who quickly outlined my layout for me, while we were waiting for transportation. I was lucky. Below is what he told me to do. If it doesn't fit with your own layout and solution, tell me, and I will adapt to yours so that I can get something up and running and get on with the creating my websites....the part I thought would surely be the hard part! :; :

All external domains will, for now, point to my single home IP address.

The host node should have a "rough" firewall which is not really meant to protect the host node. Instead the host's rough firewall is to be set to direct ALL port 80 and 443 traffic to OpenVZ's 1st container, VE Container 101, which is to contain a "sophisticated" firewall. (I'm thinking he meant Shorewall)

This "sophisticated" firewall in VE container 101, which recognizes port numbers and has them mapped to their respective various VE container's own IP addresses, then routes IP number traffic directly to the proper VE Containers.

-AND this "sophisticated" firewall in VE 101 also directs all domain name based http traffic to VE container 102 which is setting within VE 101's firewall's DMZ.

Container VE 102 contains an Apache server which is running in VIRTUAL HOST MODE and which then handles all the external incoming and internal outgoing domain name based http(s) traffic by passing it to the respective and proper virtual containers I create for my business operations, etc., and receiving it back from the same.

Within each of these other VE containers which I will create as I need them, will also have their own firewall and Apache server operating in SINGLE SERVER MODE and listening on their own high port numbers, such as 8800, 9123, etc.

I assume there is a logical return path back through Containers 102 and 101, but he didn't mention anything about that.

Is your setup close enough to this layout it can be easily adapted? -Or should I adopt your's for now, for the sake of actually moving ahead???

Take your time, I don't mind waiting for open windows in your life. I really appreciate your insights and help! Thanks!
 
Old 11-21-2011, 10:19 AM   #4
Cotun
Member
 
Registered: Jan 2009
Location: UK
Distribution: Debian Stable and Unstable
Posts: 61

Rep: Reputation: 21
Hi, sorry about the delay in responding.

I'm not surprised to hear that you haven't been able to get any help with this. Before OpenVZ, I had a Xen server and had the same problems trying to firewall it!! (with an ultimately different solution)

Anyway, your network configuration looks a bit more complicated than mine, but I'll explain what I did with Shorewall on the hardware node to make it work. From there, we can look at what needs to be done further. In all reality, it wasn't that difficult to set up a basic configuration, but without complete documentation on the subject, it took a bit of trial and error to make it work.

There are four critical Shorewall configuration files to make a firewall work on the hardware node in a basic sense. These are zones, policy, rules and interface. Assuming you have one physical ethernet port, you'll want to create two interfaces in 'interface', one for your physical device and another for the virtual interface OpenVZ uses. After this, you'll want to create three zones in the 'zones' file, one for the firewall itself (the hardware node basically), one for the OpenVZ virtual interface and one for outside the physical machine. You can then customise the 'policy' file by defining how the firewall should response to traffic between the three zones.

After this has been done, you can use the 'rules' file to enter more specific instructions as to how firewalling and routing should be handled. Typical examples of this are firewalling the virtual machines from communicating with any outside LAN machine, opening specific ports for individual virtual machines and adding any port forwarding required. From here on, it's just a matter of looking through the configuration files and making any additional subtle changes required based on what you want. But those four files should get you a basic, working configuration.
 
1 members found this post helpful.
Old 11-21-2011, 07:52 PM   #5
WildDrake!
Member
 
Registered: Dec 2003
Location: Current Location: Colorado
Distribution: Ubuntu 14.10, Mint 17.1 Cinnamon and Mate
Posts: 101

Original Poster
Rep: Reputation: 15
Smile

Thanks Coltun! I will dig deeper into shorewall and your layout and will get back to you with a few questions. I really appreciate your insight and help on this! It may take me a little while though...

The biggest thing (other than security) is I will have multiple domains coming into my home all on the same ip address and I will need to make sure each one ends up going to it's proper respective VE website.
 
Old 11-26-2011, 09:06 AM   #6
Cotun
Member
 
Registered: Jan 2009
Location: UK
Distribution: Debian Stable and Unstable
Posts: 61

Rep: Reputation: 21
No problem, glad to help
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
qmail weakness needs to remove it aliabbass Linux - Server 2 02-24-2011 05:06 AM
Quota exceeded on CentOS 5.2 when creating OpenVZ container eager Linux - Software 1 03-25-2009 01:19 PM
Fatal weakness in Linux cov Linux - Software 71 07-05-2005 04:13 AM
Howto stop users creating certain files kinasz Linux - Security 4 05-06-2004 02:13 AM
What would you say is the most basic Linux weakness wayloud Linux - Security 3 12-09-2003 04:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 01:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration