Diferenças
Aqui você vê as diferenças entre duas revisões dessa página.
Próxima revisão | Revisão anterior | ||
espec:man-host-access [2008/06/19 19:40] – created maziero | espec:man-host-access [2008/06/19 19:42] (atual) – maziero | ||
---|---|---|---|
Linha 1: | Linha 1: | ||
+ | ** mudar para português** | ||
+ | < | ||
+ | HOSTS_ACCESS(5) | ||
+ | |||
+ | NAME | ||
+ | | ||
+ | |||
+ | DESCRIPTION | ||
+ | | ||
+ | based on client (host name/ | ||
+ | | ||
+ | | ||
+ | quick introduction. | ||
+ | |||
+ | | ||
+ | | ||
+ | build time by building with -DPROCESS_OPTIONS. | ||
+ | |||
+ | In the following text, daemon is the the process name of a network dae- | ||
+ | mon process, and client is the name and/or address of a host requesting | ||
+ | | ||
+ | | ||
+ | |||
+ | ACCESS CONTROL FILES | ||
+ | The access control software consults two files. The search stops at the | ||
+ | first match: | ||
+ | |||
+ | | ||
+ | entry in the / | ||
+ | |||
+ | | ||
+ | matches an entry in the / | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | file. Thus, access control can be turned off by providing | ||
+ | | ||
+ | |||
+ | ACCESS CONTROL RULES | ||
+ | Each access control file consists of zero or more lines of text. These | ||
+ | lines are processed in order of appearance. The search terminates | ||
+ | a match is found. | ||
+ | |||
+ | | ||
+ | slash character. This permits you to break up long lines so that | ||
+ | they are easier to edit. | ||
+ | |||
+ | | ||
+ | ignored. | ||
+ | that the tables are easier to read. | ||
+ | |||
+ | | ||
+ | between [] being optional: | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | ues) or wildcards (see below). | ||
+ | |||
+ | | ||
+ | terns or wildcards (see below) that will be matched against the client | ||
+ | host name or address. | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | List elements should be separated by blanks and/or commas. | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | PATTERNS | ||
+ | The access control language implements the following patterns: | ||
+ | |||
+ | | ||
+ | matched | ||
+ | pattern. | ||
+ | name `wzv.win.tue.nl' | ||
+ | |||
+ | | ||
+ | matched if its first numeric fields match the given string. | ||
+ | example, | ||
+ | every host on the Eindhoven University network (131.155.x.x). | ||
+ | |||
+ | | ||
+ | (formerly | ||
+ | host member of the specified netgroup. Netgroup matches are not | ||
+ | supported for daemon process names or for client user names. | ||
+ | |||
+ | | ||
+ | `net/ | ||
+ | equal to the bitwise | ||
+ | example, | ||
+ | matches | ||
+ | `131.155.73.255' | ||
+ | |||
+ | | ||
+ | as a `[net]/ | ||
+ | `prefixlen' | ||
+ | the | ||
+ | `[3ffe: | ||
+ | `3ffe: | ||
+ | |||
+ | | ||
+ | name. A host name or address is matched if it matches | ||
+ | name or address pattern listed in the named file. The file for- | ||
+ | mat is zero or more lines with zero or more host name or address | ||
+ | patterns | ||
+ | used anywhere a host name or address pattern can be used. | ||
+ | |||
+ | | ||
+ | addresses. | ||
+ | tion with `net/ | ||
+ | `.' or IP address matching ending with `.'. | ||
+ | |||
+ | WILDCARDS | ||
+ | The access control language supports explicit wildcards: | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | Matches | ||
+ | whose name or address are unknown. | ||
+ | with care: host names may be unavailable due to temporary name | ||
+ | server problems. A network address will be unavailable when the | ||
+ | software | ||
+ | to. | ||
+ | |||
+ | | ||
+ | name and address | ||
+ | care: host names may be unavailable due to temporary name server | ||
+ | problems. | ||
+ | ware cannot figure out what type of network it is talking to. | ||
+ | |||
+ | | ||
+ | Matches any host whose name does not match its address. | ||
+ | tcpd is built with -DPARANOID (default mode), it drops requests | ||
+ | from such clients even before | ||
+ | tables. | ||
+ | over such requests. | ||
+ | |||
+ | OPERATORS | ||
+ | | ||
+ | struct | ||
+ | list_2. | ||
+ | client_lists. | ||
+ | language would permit the use of parentheses, | ||
+ | c' would parse as `(a EXCEPT (b EXCEPT c))'. | ||
+ | |||
+ | SHELL COMMANDS | ||
+ | If the first-matched access control rule contains a shell command, that | ||
+ | | ||
+ | | ||
+ | | ||
+ | the command if you do not want to wait until it has completed. | ||
+ | |||
+ | | ||
+ | | ||
+ | an explicit PATH=whatever statement. | ||
+ | |||
+ | | ||
+ | uses the shell command field in a different and incompatible way. | ||
+ | |||
+ | % EXPANSIONS | ||
+ | The following expansions are available within shell commands: | ||
+ | |||
+ | %a (%A) | ||
+ | The client (server) host address. | ||
+ | |||
+ | | ||
+ | just an address, depending on how much information is available. | ||
+ | |||
+ | | ||
+ | |||
+ | %h (%H) | ||
+ | The client (server) host name or address, if the host name is | ||
+ | unavailable. | ||
+ | |||
+ | %n (%N) | ||
+ | The client (server) host name (or " | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | mon name, depending on how much information is available. | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | SERVER ENDPOINT PATTERNS | ||
+ | | ||
+ | nect to, use patterns of the form: | ||
+ | |||
+ | process_name@host_pattern : client_list ... | ||
+ | |||
+ | | ||
+ | | ||
+ | this facility to offer FTP, GOPHER or WWW archives with internet | ||
+ | | ||
+ | | ||
+ | | ||
+ | face; with other systems you may have to resort to SLIP or PPP pseudo | ||
+ | | ||
+ | |||
+ | | ||
+ | | ||
+ | is available only with connection-oriented services. | ||
+ | |||
+ | CLIENT USERNAME LOOKUP | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | name, and can be used to match patterns like: | ||
+ | |||
+ | daemon_list : ... user_pattern@host_pattern ... | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | would cause username lookup only when both the daemon_list | ||
+ | | ||
+ | |||
+ | | ||
+ | same wildcards apply (netgroup | ||
+ | | ||
+ | |||
+ | | ||
+ | needed most, i.e. when the client system has been compromised. | ||
+ | In general, | ||
+ | that make sense. | ||
+ | |||
+ | | ||
+ | only when the client host runs a suitable daemon; in all other | ||
+ | cases the result is " | ||
+ | |||
+ | | ||
+ | username | ||
+ | document describes a procedure to find out if your kernel | ||
+ | this bug. | ||
+ | |||
+ | | ||
+ | The default timeout for username | ||
+ | short to cope with slow networks, but long enough to irritate PC | ||
+ | users. | ||
+ | |||
+ | | ||
+ | a rule like: | ||
+ | |||
+ | daemon_list : @pcnetgroup ALL@ALL | ||
+ | |||
+ | | ||
+ | but would perform username lookups with all other systems. | ||
+ | |||
+ | DETECTING ADDRESS SPOOFING ATTACKS | ||
+ | A flaw in the sequence number generator of many TCP/ | ||
+ | | ||
+ | via, for example, the remote shell service. | ||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | vice to find out that the client did not send the request at all. When | ||
+ | the client host provides IDENT service, a negative IDENT lookup | ||
+ | (the client matches `UNKNOWN@host' | ||
+ | ing attack. | ||
+ | |||
+ | A positive IDENT lookup result (the client | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | Note: IDENT lookups don't work with UDP services. | ||
+ | |||
+ | EXAMPLES | ||
+ | The language is flexible enough that different types of access | ||
+ | | ||
+ | uses two access control tables, the most common policies can be imple- | ||
+ | | ||
+ | |||
+ | | ||
+ | allow table is scanned before the deny table, that the search | ||
+ | | ||
+ | is found at all. | ||
+ | |||
+ | The examples use host and domain names. They can be improved by includ- | ||
+ | ing address and/or network/ | ||
+ | | ||
+ | |||
+ | MOSTLY CLOSED | ||
+ | In this case, access is denied by default. Only explicitly | ||
+ | hosts are permitted access. | ||
+ | |||
+ | The default policy (no access) is implemented with a trivial deny file: | ||
+ | |||
+ | / | ||
+ | ALL: ALL | ||
+ | |||
+ | This denies all service to all hosts, unless they are permitted | ||
+ | by entries in the allow file. | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | / | ||
+ | ALL: LOCAL @some_netgroup | ||
+ | ALL: .foobar.edu EXCEPT terminalserver.foobar.edu | ||
+ | |||
+ | The first rule permits access from hosts in the local domain (no `.' in | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | MOSTLY OPEN | ||
+ | Here, access is granted by default; only explicitly specified hosts are | ||
+ | | ||
+ | |||
+ | | ||
+ | that it can be omitted. | ||
+ | in the deny file. For example: | ||
+ | |||
+ | / | ||
+ | ALL: some.host.name, | ||
+ | ALL EXCEPT in.fingerd: other.host.name, | ||
+ | |||
+ | | ||
+ | rule still permits finger requests from other hosts and domains. | ||
+ | |||
+ | BOOBY TRAPS | ||
+ | The next example permits tftp requests from hosts in the local domain | ||
+ | | ||
+ | | ||
+ | host. The result is mailed to the superuser. | ||
+ | |||
+ | / | ||
+ | in.tftpd: LOCAL, .my.domain | ||
+ | |||
+ | / | ||
+ | in.tftpd: ALL: spawn (/ | ||
+ | / | ||
+ | |||
+ | | ||
+ | | ||
+ | by the remote finger server. | ||
+ | dard finger command. | ||
+ | |||
+ | The expansion of the %h (client host) and %d (service | ||
+ | is described in the section on shell commands. | ||
+ | |||
+ | | ||
+ | for infinite finger loops. | ||
+ | |||
+ | On network firewall systems this trick can be carried | ||
+ | The typical network firewall only provides a limited set of services to | ||
+ | the outer world. All other services can be " | ||
+ | tftp example. The result is an excellent early-warning system. | ||
+ | |||
+ | DIAGNOSTICS | ||
+ | An error is reported when a syntax error is found in a host access con- | ||
+ | trol rule; when the length of an access control rule exceeds the capac- | ||
+ | | ||
+ | nated by a newline character; when the result | ||
+ | | ||
+ | | ||
+ | |||
+ | FILES | ||
+ | / | ||
+ | / | ||
+ | |||
+ | SEE ALSO | ||
+ | | ||
+ | | ||
+ | |||
+ | BUGS | ||
+ | If a name server lookup times out, the host name will not be available | ||
+ | to the access control software, even though the host is registered. | ||
+ | |||
+ | | ||
+ | group lookups are case sensitive. | ||
+ | |||
+ | AUTHOR | ||
+ | | ||
+ | | ||
+ | | ||
+ | Den Dolech 2, P.O. Box 513, | ||
+ | 5600 MB Eindhoven, The Netherlands | ||
+ | |||
+ | | ||
+ | </ |