summaryrefslogtreecommitdiff
path: root/static/openbsd/man5/ypserv.acl.5
blob: 914c17daadc105eb20bbe41234a647277c703d20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
.\"	$OpenBSD: ypserv.acl.5,v 1.27 2022/03/31 17:27:32 naddy Exp $
.\"
.\" Copyright (c) 1994 Mats O Jansson <moj@stacken.kth.se>
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd $Mdocdate: March 31 2022 $
.Dt YPSERV.ACL 5
.Os
.Sh NAME
.Nm ypserv.acl
.Nd ypserv(8) access control configuration
.Sh DESCRIPTION
The
.Nm
file controls which hosts can connect to the
.Xr yp 8
server.
.Pp
The format is more complex than the format for
.Xr securenet 5 .
The first two words on each line controls if the line will
.Ic allow
or
.Ic deny
access for a
.Cm host ,
network
.Pq Cm net ,
or
.Cm all
hosts.
.Pp
The YP
server reads the configuration file and builds a list in memory.
This list is processed from the beginning for every incoming request.
As soon as a
match is found in the list, the search terminates and it returns success
or failure depending on which of
.Ic allow
or
.Ic deny
was specified.
If no match was found in the list, success is returned.
.Pp
If access is denied, every call will cause a
.Dq no such domain
error for the caller.
.Pp
Normally both the local hostname and localhost must be
allowed access.
Otherwise
.Xr ypserv 8
might not work correctly.
.Pp
There is no default name for this file.
Start
.Xr ypserv 8
with
.Fl a Ar filename
to read a file with this format.
.Pp
The following syntax may be used:
.Pp
.D1 Ic allow Ns | Ns Ic deny Cm host Ar hostname Ns | Ns Ar ip-address
.Pp
If
.Ic hostname
has more than one IP address, they will all be added to the list.
.Pp
.D1 Ic allow Ns | Ns Ic deny Cm net Ar netnumber Op Cm netmask Ar netnumber
.Pp
If the
.Cm netmask
part of the command isn't given then the netmask will be assumed to be a
class A, B or C net depending on the net number.
.Pp
.D1 Ic allow Ns | Ns Ic deny Cm all
.Pp
A line containing one of these commands will always match any host.
.Sh FILES
.Bl -tag -width /var/yp/ypserv.acl -compact
.It Pa /var/yp/ypserv.acl
a
.Xr ypserv 8
configuration file
.El
.Sh EXAMPLES
A configuration file might look like the following:
.Bd -literal
# This is an example of an access control file to be used by ypserv.
#
# This file is parsed line by line. First match will terminate the check
# of the caller.
#

###########################################################################
# This is the commands that will match a single host
#
#	allow host <hostname|ip-address>
#	deny host <hostname|ip-address>
#
# To process hostname gethostbyname is called. If the hostname has
# multiple ip-addresses all will be added (I hope). ip-address
# processed by inet_aton.
allow host localhost
allow host myypserver
deny host jodie

###########################################################################
# This is the commands that will match a network
#
#	allow net <netnumber> [netmask <netnumber>]
#	deny net <netnumber> [netmask <netnumber>]
#
# inet_aton is used for netnumber.
# inet_aton both access numbers as 255.255.255.0 and 0xffffff00.
#
# If netmask isn't given the parser will assume netmask from the first bits
# of the network number. So if the network is subneted the you have to add
# the netmask. In my case I've got the network 139.58.253.0 at home so to
# allow any of my computers to talk with the server I need the following
# line
#
allow net 139.58.253.0 netmask 255.255.255.0

###########################################################################
# At last we have a command that will match any caller:
#
#	allow all
#	deny all
#

# reject all connections
deny all

.Ed
.Sh SEE ALSO
.Xr securenet 5 ,
.Xr yp 8 ,
.Xr ypserv 8
.Sh AUTHORS
.An Mats O Jansson Aq Mt moj@stacken.kth.se