Chapter 3: The `policy' file

stealth reads a policy file defining the actions that must be performed. Each policy file is uniquely associated with a host to be tested. There may be multiple policy files for a host, though. In that case, each policy file will define a certain set of checks to be performed.

Below, the term controller is used for the computer where stealth is started, while the term client is used for the computer that is scanned by stealth. The controller and the client could be the same computer, but normally they are different.

The policy file consists of three sets of data: define directives (starting with the keyword DEFINE), use directives (starting with the keyword USE) and commands.

Directives are written in capitals, and should appear exactly as written below: letter casing is preserved.

Blank lines and information beyond hash-marks (#) are ignored, while lines following lines terminating in backslashes (\ ) will be concatenated (en passant removing the backslashes). Initial white space on lines of the policy file is ignored.

3.1: DEFINE directives

DEFINE directives can be used to define symbols for longer strings. A DEFINE directive is constructed as follows:


    DEFINE name     that what is defined by `name'
        
Here,

3.2: USE directives

USE directives provide stealth with arguments which may be conditional to a certain installation. The following USE directives may be specified:

Note, however, that using stealth to inspect localhost is not recommended, as it counters one of the main reasons for stealth's existence.

As yet another alternative, applicable only to localhost, ssh could be avoided altogether. In that case /bin/bash or a comparable shell may be specified with USE SSH. For example:


    # For stealth inspecting localhost:
        USE SSH /bin/bash --noprofile
        

3.3: Commands

Following the USE specifications, commands can be specified. The commands are executed in their order of appearance in the policy file. Processing continues until the last command has been processed or until a tested command (see below) returns a non-zero return value.

3.3.1: LABEL commands

The following LABEL commands are available:

Examples:


    LABEL Inspecting files in /etc\nIncluding subdirectories
    LABEL
        
The second LABEL command clears the first label.

3.3.2: LOCAL commands

LOCAL commands can be used to specify commands that are executed on the controller itself. The following LOCAL commands are available:

3.3.3: REMOTE commands

Plain commands can be executed on the client computer by merely specifying them. Of course, this means that programs called LABEL, LOCAL USE or DEFINE, cannot be executed, since these names are interpreted otherwise by stealth. It's unlikely that this will cause problems. Remote commands must succeed (i.e., their return codes must be 0).

Remote commands are commands executed on the client using the SSH shell. These commands are executed using the standard PATH set for the SSH shell. However, it is advised to specify the full pathname to the programs to be executed, to prevent ``trojan approaches'' where a trojan horse is installed in an `earlier' directory of the PATH-specification than the intended program.

Two special remote commands are GET and PUT, which can be used to copy files between the client and the controller. Internally, GET and PUT use the DD use-specification. If a non-default specification is used, one should ensure that the alternate program accepts dd(1)'s if=, of=, bs= and count= options. With GET the options bs=, count= and of= are used, with PUT the options bs=, count= and if= are used. Normally there should be no need to alter the default DD specification.

The GET command may be used as follows:

The PUT command may be used as follows:

Other commands to be executed on the client can be specified as follows: