|
|||||||||||||||||||||
|
|||||||||||||||||||||
In a filtering rule, the action (pass,
block, ...) is performed on an IP packet if it meets certain conditions.
Some of these conditions are the interface the packet in passing through,
its source and destination addresses, its protocol and source and destination
ports for tcp or udp packets, or its ICMP-type and ICMP-code for ICMP packets. Isba uses three types of objects to represent these conditions: Interfaces, Host/Nets and Services. When building a rule, you will paste one (or more) objects in purpose-built boxes, e.g. the From and To boxes will accept to receive hosts and/or nets, etc. In Nat rules the hosts and nets objects can go to Original From, Original To and Translated Address boxes. |
|||||||||||||||||||||
|
|||||||||||||||||||||
All three kinds of objects have the following properties:
Services have two additional properties:
You can define or change your objects' properties in edition windows. To open the edition window of an object, double-click on it. For example: |
Objects properties | ||||||||||||||||||||
Editing a host or net object |
|||||||||||||||||||||
All properties are optional, except that an object must have at least a name or a value. If an object has a value but no name, this value will appear in the ruleset: use such anonymous objects when you want to see constants. For example, if you want to see 127.0.0.1 instead of a name, define the following object: | Anonymous objects | ||||||||||||||||||||
Sample anonymous object |
|||||||||||||||||||||
On the opposite, objects may be given a name but no value. At compile time, isba will generate an error unless it is a well-known object, such as for example the ftp service (see below). This feature allows you to start writing a ruleset prior to knowing the values of all your objects. |
Unvalued objects | ||||||||||||||||||||
Sample unvalued object |
|||||||||||||||||||||
An object's Value field may receive the name of another object. In that case both objects have the same literal value. More interesting, the Value field may receive the names of several objects: see Groups of objects. |
"Variable" objects |
||||||||||||||||||||
|
|||||||||||||||||||||
You can create an object from several places:
These four methods all open an clean object edition window. |
|
||||||||||||||||||||
|
|||||||||||||||||||||
Note that in the Service edit window above, there is an entry box for one value only. Apparently you cannot enter the second value needed to define a port range. In actual fact the second field is only needed in TCP, UDP,TCP/UDP and ICMP protocols. For ICMP it receives the ICMP-Code (if any) and for the other three it receives the upper bound (if any) of the port range. The Service edition window dynamically shows the second field only if the protocol entered is one of the four quoted above. | Editing Service objects | ||||||||||||||||||||
The Protocol field may be defined by either typing in the protocol name, or its number, or by using a popup menu (right-clic in the entry field). This menu allows you to choose among the four protocols quoted above and all the protocols found in the local /etc/protocols file. | Specifying the protocol | ||||||||||||||||||||
The TCP, UDP and TCP/UDP port ranges may be one of four kinds: a single port, a standard port range, and one-bound ranges (low bounded and high bounded). The following table explains how to define these four kinds of ranges. Note the particular way of specifying the low-bounded range. Also note that outbound ranges (e.g.: port 2000 <> 3000, ports outside the 2000-3000 range) are not supported by isba. | Defining a TCP, UDP or TCP/UDP port range | ||||||||||||||||||||
|
|||||||||||||||||||||
If you choose ICMP in the Protocol area, the two following fields are respectively the 'ICMP-Type' and the optional 'ICMP-Code'. Like the Protocol, those fields may be entered manually, by typing the ICMP type or code number (or the ipfilter keywords), or by using the right-clic popup menu. As the ICMP-Codes available depend on the ICMP-Type chosen, the ICMP-Code right-clic popup menu contents depend on the value you chose for the ICMP-Type. On the following screenshot, the Service 'ICMP Host Unreachable' have been defined, and the popup menus are shown together to illustrate this point. | Defining an ICMP Service | ||||||||||||||||||||
|
|||||||||||||||||||||
|
|
||||||||||||||||||||
The objects you create are
managed in three lists: one Interfaces list, one Hosts/nets list and one
Services list. Each objects list is browseable in a Chooser window.
You can open a Chooser either from the Objects main menu, or by clicking
on one of the three buttons in the upper-right corner, or by right-clicking
on a rule box.
The Choosers show all objects properties: the Name (with the object color), the Value, the Comment, and the file the object was included from, if any. The Chooser for Services objects also shows the protocol. |
|||||||||||||||||||||
|
|||||||||||||||||||||
From the Chooser window you can:
|
|
||||||||||||||||||||
|
|||||||||||||||||||||
At any time you can see the literal value of an object in the Eval window: its IP address and mask if it's a net or host, its port range if it's a tcp or udp service, etc. This feature is interesting for group objects: you see the set of literal values a group contains. |
|
||||||||||||||||||||
|
|||||||||||||||||||||
As an object may be defined as a function of other objects, up to any recursion level, there may happen to be a cycle in the definition graph. This is an error condition as the value of all objects involved in the cycle can't be computed. In this case the Eval window displays 'CYCLIC' in its value field. | "CYCLIC" literal value | ||||||||||||||||||||
With isba you can (temporarily) define objects as having no value. The Eval window displays 'UNDEF' for undefined objects. The same thing applies to objects whose value is a function of an undefined object. | "UNDEF" literal value | ||||||||||||||||||||
|
|||||||||||||||||||||
The 'Where' button in Choosers opens a popup window that allows you to see where the currently selected object (call it A) is used: | Objects dependancies | ||||||||||||||||||||
|
|
||||||||||||||||||||
You get a dual-column list where the first columns is the type of location where object A is used (is it an interface, a host/net, a service, an ipf rule or a nat rule), and the second column is the name of the object or the number of the rule. | |||||||||||||||||||||
When you select one of these locations and clic the 'Show me' button, isba takes you straight to that location: if it's an object, its edition window is opened, and if it's a rule, it is shown (ruleset is scrolled) in main window. | "Show me" button | ||||||||||||||||||||
|
|||||||||||||||||||||
|
|||||||||||||||||||||
The 'Del' button in Choosers open a popup
window that is exactly a 'Where' window with the addition of a 'Delete'
button. Being a confirmation popup, it lets you decide whether to delete
the object or not, depending on where it is used. If the 'Where' window
is empty, you can safely delete the object. If the object is used in some
objects or rules, it will be removed from the latter.
Note that included objects can't be deleted (the Delete button is disabled). If you don't want an included object anymore, you must delete it from the file it is defined in (open the include fine). |
Deleting an object | ||||||||||||||||||||
When your object is ready to be created (or updated), holding down the Shift key while clicking the Create (or Update) button, results in the edit window staying open and retaining its data. This is useful to enter several similar objects. Similarly, if you hold down the Control key, the edition window will stay open but will be cleared. |
Creating many objects one after the other | ||||||||||||||||||||
|
|||||||||||||||||||||
When you create a new isba ruleset, the following objects are predefined for the sake of convenience: | Predefined objects | ||||||||||||||||||||
|
|||||||||||||||||||||
Moreover, at compile time, isba tries to resolve values of undefined objects:
At compile time, for each undefined object which value is found that way, isba prints a warning on stdout. |
|
||||||||||||||||||||
|
Cut, copy, paste | ||||||||||||||||||||
Objects can be cut, copied and pasted.
This is the way you place objects in rules: you first copy them in Choosers,
then you paste them in rules.
See also how you can copy objects from one ruleset to another. |
|||||||||||||||||||||
|
|||||||||||||||||||||
|
|||||||||||||||||||||
We have seen that the value of an object may be a literal value or the name of another object. Actually it can be any number of literal values and objects names, so you can define a "group object". A group object may contain names of other group objects. Group objects are managed in the same Chooser as simple objects of the same kind (there's no special Chooser for groups). |
Groups of objects | ||||||||||||||||||||
|
|||||||||||||||||||||
At any time you can see the literal value of a group object. | |||||||||||||||||||||
|
|||||||||||||||||||||
In multi-targets rulesets you can make the value of an object depend on the target the ruleset is compiled for. The syntax is:
At compile time, the object which value is entered as above has its value equal to value1 if the target the ruleset is compiled for belongs to hosts_nets. Otherwise its value is value2 if present, or nothing if value2 is not defined (as if the object didn't exist). |
#if-target() #if-not-target() |
||||||||||||||||||||
In hosts/nets objects, value1 and value2 may be given the value 'any'. There is also a '#if-not-target()' directive with the same syntax. |
|||||||||||||||||||||
|
|||||||||||||||||||||
In multi-targets rulesets,
and if remote management is set up, interfaces and hosts objects may receive
a target-dependent value at compile time.
An Interface object can be given the value #from-ifconfig or #from-ifconfig(N): it receives the name of the Nth interface found in the target machine's `ifconfig -a` (lo0 excepted) at compile time. Isba uses the remote management SSH channel to get it. The syntax for the interface value is (default value for N is 1):
A Host object can be given the value #from-ifconfig(intf_name): it receives the IP address of the interface named intf_name (read from target machine's ifconfig -a through SSH) at compile time. The syntax for the host value is: |
#from-ifconfig[(N)] #from-ifconfig(intf) |
||||||||||||||||||||
Currently automatic values are supported in Solaris and *BSD. |
|||||||||||||||||||||
Isba User's Guide - last modified on 09-Jan-2002 13:38 MET - Copyright (c) 2001 |