One of VXE designe prioriyes ia an ease of use. Most of the tasks can be copleted through GUI. REST API is an integral part of VXE and can be used to manage multiple VXE enabled servers or for any other purposes.
There are two VXE userspace services: logger and gui. Logger loads VXE kernel module, starts GUI and collects violation logs prodiced by kernel module.
To start VXE manually, run following comman as root:
# service vxe-logger start
VXE services run as vxeuser.vxegroup.
To check VXE service status:
# service vxe-logger status # service vxe-logger status
To stop VXE services:
# service vxe-logger stop
To check for VXE Kernel Module:
# lsmod Module Size Used by vxe_lkm 171436 0 ...
Look for vxe_lkm.
In production environment vxe-logger should be configure to start during the system start-up.
Services: /usr/lib/systemd/system/vxe-logger.service, /usr/lib/systemd/system/vxe-gui.service
Python service implementation: /usr/lib/python2.7/site-packages/vxe (may vary, based on particual Linux distribution)
VXED definitions: /var/vxe/conf
Violation logs: /var/vxe/log
Hashes of GUI user passwords: /var/vxe/config.json
VXEDs (VXE Descriptions) has a version number. It is increasing after each edit.
After installation VXE accepts default credentials, username admin and passowrd 12345. Go to Config tab to change the password. Only one username is supported as of now.
Dashoboards presents the current running status of VXE. Left pane lists enabled VXEDs. This VXEDs are installed into the Linux kernel. Idle section shows VXEDs that doesn't have any running VXEI (instances) associated with them. Running section represents VXEDs with currently active instances. Long 64-bit numbers are VXEI IDs. They differentiate VXEIs. Selecting any running VXED or VXEI displace corresponding processes on the right pane.
To log-out use VXE menu in the upper right corner. There is a red/green sign next to the VXE letters in this menu. Red means that there are running VXEIs with violations.
This tab allows editing VXEDs.
Left pane lists defined VXEDs. New is not an actual VXED, but used to create ne VXEDs. Marked checkobxes indicate enabled VXEDs. VXED can be enabled or disabled by changing the mark.
Right pane is VXED (VXE Description) itself.
The header part has following fields:
Buttons:
The section with system call rules is under the buttons. These rules describe which system calls with what parameters are allowed.
System call header includes system call index as used by Linux and name. Cliking on this header expands particular system call rules.
Each rule includes index, counter and system call arguments. If system call matches any rule - it is allowed.
Index defines sequence in which rules are matched.
Counter limits the number of matches. If this number is exhausted - rule is excluded from the matching process. If counter is "*" there is no limit on how many times the rule can be matched.
Arguments can be rpresented by file system paths and numbers. If argument in a rule is "*" it will match any corresponding value in the system call.
If argument is a number and not "*" it should match exactly.
Paths can have trailing "/+" or "/*". "/+" matches any filename, but doesn't include contents of the subdirectories. "/*" includes contnts of the subdirectories.
Double click on a row to edit a rule.
Index column can be used for the following actions:
Above the rules there is Tools menu with following options:
This tab shows existing violations logs.
Live section of the left pane lists violation logs of the running VXEIs. If a log index is selected in the left pane, the log contenets is shown in the right pane.
Complete section of the left pane lists violation logs of the ended VXEIs. Logs are grouped by VXED names. Log indexes that can be applied to VXEDs (whose indixes match current index of particular VXED) are marked by bold font.
Buttons at the bottom left are applied to the logs with marked checkboxes. There are three such buttons:
The following script will be used as an example:
1 2 3 4 5 6 7 8 | #!/usr/bin/python from subprocess import call import time call(["ps", "-ef"]) time.sleep(30) |
Path of the script is /home/slozovsky/vxe_test.py
You can create the similar script in your directiry for testing.
Go to VXED Edit tab. Select New. Fill in Name and Activation path. Use path of your script.
Click Save button. Version number should become 1.
Enable VXED by marking the checkbox next to the VXED name test.
No system calls are defined (allowed) in the new VXED, so they all will be logged in the subsequent run.
From the command line run your test script.
Monitor its execution through the Dashboard tab.
Observe that status indicator in the upper right corner is red. That menas that there is VXEDI with violation logs. After script is finished check the logs.
At the Logs tab expand test logs. There is just one log is present 1. Select it. Contents of the log appears at the right pane.
A number before system call name is conter. It indicates how many times this system call was executed with the given parameters.
There are two way to update VXED with the violations from the log. The first is from VXED Edit tab, by clicking Upadte button. GUI will automatically mark all applicable logs. The second way is to mark logs manually. This is what we do in current example.
Mark the checkbox before 1 log and click Apply button. This will bring us to the updated VXED.
In the VXED Edit tab all changed system call definitions and rules are marked as changed. It makes easier to locate changes made by the update. In our example all rules are new, so all of them are marked as changed. VXED version is incremented.
VXED should be generalized to become useful. Expand open syscall by clicking on it. We can see that there are many instances of accessing /proc/...
. Let's allow our script read access to /proc/...
with all subdirectories.
Double-click on any rule with /proc/...
and change /proc/...
to /proc/\*
. Set counter fileld to \*
and press Enter or click outside of the rule. GUI will integarate all /proc/...
rules into one. Flag 0 menas read access.
Go through other system calls and do generalizations as you see fit.
Click Save button to save results.
To get a complete VXED the script should be xecuted multiple times to reveal different exection paths and variances in using resources.
If there is no need to be very specific about some system calls - select Tools - Allow all. For example, we probably don't care about close system call and it's hard to create meningful rules for it.
Repeat previous steps multiple times until no violation logs are produced. At this point in time switch Mode to deny in VXED header above buttons.