Setting Up Virtual Security Zones in a Linux Cluster
When DSM is loaded, it enforces default permissive security rules. To achieve cluster subdivision, we have to edit the DSP file ~/dsi/etc/SampleDSP.xml and replace all the existing security rules with our own.
PhoneMania's sockets are assigned ScID=10, and RingBell uses ScID=20. The following rule assigns ScID=10 to PhoneMania's entry point UDP socket (port 8800):
<class_SOCKET_INIT_rule> <protocol>UDP</protocol> <port>8800</port> <SnID>ALL</SnID> <ScID>10</ScID> </class_SOCKET_INIT_rule>
We need three other similar rules: one for PhoneMania's back-end server and two others for ScID=20 for RingBell.
Then, PhoneMania's processes (source ScID=10) are allowed to create, send or receive messages on sockets they own (that is, with target ScID=10):
<class_SOCKET_rule> <sScID>10</sScID> <sSnID>ALL</sSnID> <tScID>10</tScID> <tSnID>ALL</tSnID> <allow>CREATE CONNECT LISTEN RECEIVE SEND</allow> </class_SOCKET_rule>
Create a similar rule for RingBell's processes.
Of course, communication between ScID=10 and 20 must be denied. This is done simply by setting no socket permissions at all between those ScIDs:
<class_SOCKET_rule> <sScID>10</sScID> <sSnID>ALL</sSnID> <tScID>20</tScID> <tSnID>ALL</tSnID> <allow></allow> </class_SOCKET_rule>
Create a similar rule between source ScID=20 and target ScID=10.
Back-end and entry point servers of a given operator may be located on different nodes of a cluster; remember, we're sharing a cluster, not dedicating one node to RingBell and another to PhoneMania. Hence, processes of PhoneMania (source ScID=10) must be able to communicate with other PhoneMania processes (target ScID=10) through the network. The same holds true for RingBell:
<class_NETWORK_rule> <sScID>10</sScID> <sSnID>ALL</sSnID> <tScID>10</tScID> <tSnID>ALL</tSnID> <deny>NETWORK_RECEIVE</deny> </class_NETWORK_rule>
Finally, PhoneMania (ScID=10) and RingBell (ScID=10) processes usually are launched from a shell (default ScID=2). So, basically, we need to allow the shell to create a new process. This is done with a transition rule:
<class_TRANSITION_rule> <parent_ScID> 2 </parent_ScID> <SnID>ALL</SnID> <binary_ScID>10</binary_ScID> <new_ScID>10</new_ScID> </class_TRANSITION_rule>
The binary_ScID is the ScID explicitly assigned to the binary. Remember, we assigned ScIDs to PhoneManiaBE or PhoneManiaEP using SetSID. The new_ScID is the ScID assigned to the new process also created. As access to sockets 8800 and 8801 is granted only to ScID=10, for PhoneMania, the new process should be assigned ScID=10. A similar rule for RingBell should be created.
This is all we need in the DSP—12 security rules. Then, we update the security policy in the whole cluster by sending an update event to the security server:
[colby]$ cd ~/dsi/SS/test/demoSecOM [colby]$ ./dsiUpdatePolicy ~/dsi/etc/DSP.xml
The security server reads the updated DSP file (located in ~/dsi/etc/DSP.xml) and displays warnings if there are syntax errors. Finally, it automatically sends updates to each security manager; no need to log in to each machine to update the security policy manually or develop your own version of system management Perl-based software. This feature can be a benediction when you have a cluster of hundreds of nodes physically spread out around the world (think grid computing).
Now, it's time to try the case again in which PhoneMania forwards requests to RingBell's back-end server:
[colby demo]$ ./TelecomClient -h 10.1.1.1 -p 8800 Requesting quotation for Ericsson Quote Ericsson ... [colby demo]$ ./PhoneManiaEP -h 10.1.1.1 -p 8800 -b 10.1.1.2 -r 9001 PHONEMANIA: bind/connect on 10.1.1.1:8800 = 0 PHONEMANIA: bind/connect on 10.1.1.2:9001 = 0 Quote Ericsson Quotation request received ... [munster demo]$ ./RingBellBE -h 10.1.1.2 -p 9001 RINGBELL: bind on 10.1.1.2:9001 ...
On the other node (munster), we notice that RingBell's back-end server is no longer handling PhoneMania's requests, although PhoneMania illicitly redirects them to RingBell. You can use logs generated by DSI, located in /var/log/messages to trace illicit requests:
May 6 07:47:31 munster kernel: DSI-LSM MODULE - dsi_sock_rcv_skb check permission sscid 10 ssnid 1 tscid 20 May 6 07:47:31 munster kernel: DSI-LSM MODULE Error - dsi_sock_rcv_skb - No Permission
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.
|Using Salt Stack and Vagrant for Drupal Development||May 20, 2013|
|Making Linux and Android Get Along (It's Not as Hard as It Sounds)||May 16, 2013|
|Drupal Is a Framework: Why Everyone Needs to Understand This||May 15, 2013|
|Home, My Backup Data Center||May 13, 2013|
|Non-Linux FOSS: Seashore||May 10, 2013|
|Trying to Tame the Tablet||May 08, 2013|
- Using Salt Stack and Vagrant for Drupal Development
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- New Products
- Validate an E-Mail Address with PHP, the Right Way
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Home, My Backup Data Center
- New Products
- RSS Feeds
- New Products
- I like your topic on android
13 min 49 sec ago
- Reply to comment | Linux Journal
34 min 59 sec ago
- This is the easiest tutorial
6 hours 49 min ago
- Ahh, the Koolaid.
12 hours 28 min ago
- git-annex assistant
18 hours 27 min ago
- direct cable connection
18 hours 50 min ago
- Agreed on AirDroid. With my
19 hours 24 sec ago
- I just learned this
19 hours 4 min ago
19 hours 34 min ago
- not living upto the mobile revolution
22 hours 25 min ago