what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

openbsdacl.html

openbsdacl.html
Posted Sep 24, 2002
Authored by Andi | Site segfault.net

OpenBSD Network ACLs for i386 - This paper discusses how to utilize a kernel patch to create local ACLs to restrict local users from using network services. It allows an administrator to deny network access for a user by restricting bind() and connect() to allowed accounts.

tags | paper, kernel, local
systems | openbsd
SHA-256 | 4049a210d3c28f826d0429cbdcfedc0ee92e89e21c90faa4675b99e21d18a311

openbsdacl.html

Change Mirror Download
<html>
<head>
<title>OpenBSD Network ACLs Kernel Patch</title>
</head>
<body>

<h1>OpenBSD Network ACLs for i386</h1>

<h3>About</h3>
Many system administrators want to restrict their local users even more, i. e. you want
deny network access for a user or you want to allow a bind on port 994 for your ircd. You
cant do this with the OpenBSD packet filter pf. Therefore I started to write a kernel patch
to restrict bind() and connect() for specific users. <br><br>

Thereforce I created an object (void*) to define a rule. To tell the kernel about this new rule
you use the ioctl() function on the /dev/acl pseudo device. This userdefined object can now
be checked with the kernel function aclcheck(). aclcheck() will now compare variables or data. It
depends on the mode what and how the data will be compared. To add this check to a kernel function you
simply include kern/aclvar.h in the kernel source file and call the function aclcheck() and
check the return code.

<h3>Details</h3>
The ACL is realized with a pseudo device and an internal rule list (like pf).
The communication between userland and kernel is done via ioctl. The major number
I used for the device is <b>78</b> (well it was the next free number).

For more details have a look at README

<h3>Examples</h3>
<a href="http://segfault.net/~andi/openbsdacl/example-acl.conf">Here</a> you can find an example for ACL.

<h3>Install</h3>
Download src from cvs or from the OpenBSD ftp server and <a href="http://segfault.net/~andi/openbsdacl/openbsdacl-3.1-0.0.1.tar.gz">openbsdacl-3.1-0.0.1.tar.gz</a>.
Then do the following steps:

<pre>
# cd /tmp
# tar xfz openbsdacl-3.1-0.0.1.tar.gz
# cd /usr
# patch -p0 < /tmp/openbsdacl-3.1-0.0.1/src-3.1-ubf.diff
# cp /tmp/openbsdacl-3.1-0.0.1/acl.c /tmp/openbsdacl-3.1-0.0.1/aclvar.h /usr/src/sys/kern
# cd /usr/src/sys/arch/i386/conf
# cp GENERIC MYKERNEL
</pre>

Edit MYKERNEL and add the line
<pre>
pseudo-device acl 1
</pre>

The "1" stands for one device.

<pre>
# config MYKERNEL
# cd ../compile/MYKERNEL
# make
# make install
# reboot
</pre>

Now create the ubf device

<pre>
# mknod /dev/acl 78 0
# chmod 600 /dev/acl
</pre>

And now test it:

<pre>
# ./aclctl -e
Enable UPF ...
#
</pre>

<h3>History</h3>
<menu>

<li>version 0.0.2
<ul>
<li>log support</li>
<li>All (*) and Not (!) functions for user/group lookup</li>
</ul>
</li>

<li>version 0.0.1
<ul>
<li>pseudo device acl</li>
<li>internal acl rule list</li>
<li>ioctl to add/flush/remove rules</li>
<li>support to allow or deny connect/bind ipv4</li>
<li>a small aclctl tool to test acl</li>
</ul>
</li>
</menu>
<a href="mailto:andi@segfault.net">andi@segfault.net</a>
</body>
</html>
Login or Register to add favorites

File Archive:

August 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Aug 1st
    15 Files
  • 2
    Aug 2nd
    22 Files
  • 3
    Aug 3rd
    0 Files
  • 4
    Aug 4th
    0 Files
  • 5
    Aug 5th
    15 Files
  • 6
    Aug 6th
    11 Files
  • 7
    Aug 7th
    43 Files
  • 8
    Aug 8th
    42 Files
  • 9
    Aug 9th
    36 Files
  • 10
    Aug 10th
    0 Files
  • 11
    Aug 11th
    0 Files
  • 12
    Aug 12th
    0 Files
  • 13
    Aug 13th
    0 Files
  • 14
    Aug 14th
    0 Files
  • 15
    Aug 15th
    0 Files
  • 16
    Aug 16th
    0 Files
  • 17
    Aug 17th
    0 Files
  • 18
    Aug 18th
    0 Files
  • 19
    Aug 19th
    0 Files
  • 20
    Aug 20th
    0 Files
  • 21
    Aug 21st
    0 Files
  • 22
    Aug 22nd
    0 Files
  • 23
    Aug 23rd
    0 Files
  • 24
    Aug 24th
    0 Files
  • 25
    Aug 25th
    0 Files
  • 26
    Aug 26th
    0 Files
  • 27
    Aug 27th
    0 Files
  • 28
    Aug 28th
    0 Files
  • 29
    Aug 29th
    0 Files
  • 30
    Aug 30th
    0 Files
  • 31
    Aug 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close