System Administration
Adding Custom Tests
testConfig = \
"""
<div id="test_parameters">
<table height="100%" width="100%" border="0" cellspacing="0"
cellpadding="0">
<tbody>
<tr>
<td colspan="2" style="padding: 5px 3px 5px 3px;">
Enter a list of ports that are not allowed to be open on the
endpoint. Add ports separated by a comma. For example, 23,80.
</td>
</tr>
<tr>
<td style="padding: 3px 0px 3px 3px;">
wrap="on" style="border: 1px solid #A894D1;
8pt; padding: 1px 2px 1px 2px;"></textarea>
</td>
</tr>
</tbody>
</table>
</div>
"""
#
# These are any default values you want to assign to the input parameters
# in the testConfig HTML. The first time this test is configured for a
# policy or if the test is never configured for a policy, this will be
# the default. Notice the key in this hash corresponds to the input
element
# above in the testConfig.
#
defaultConfigValues = { "ports_not_allowed" : "23,80" }
#
# Make up a detailed description for the test.
#
testDescription = \
"""
This test takes a list of ports that should NOT be found open on
the remote host.
fail.
This script will only succeed if none of the undesired ports
are found open.
"""
Figure 13-6. checkOpenPorts.py script (cont.)
13-24
<textarea name="ports_not_allowed" rows="5" cols="30"
font-family: Arial, Helvetica, sans-serif; font-size:
If any port is found open, this test will