root/fwknop/tags/fwknop-0.9.7-pre1/access.conf

Revision 412, 5.6 kB (checked in by mbr, 3 years ago)

added GPG text

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 #
2 ##############################################################################
3 #
4 # File: access.conf
5 #
6 # Purpose: This file defines how fwknop will modify iptables access controls
7 #          for specific IPs/networks.  It gets installed by default at
8 #          /etc/fwknop/access.conf and is consulted by fwknop when run in
9 #          "access control mode", which is the default (i.e. when fwknop is
10 #          run from the command line without any command line arguments).
11 #          The corresponding file ~/.fwknoprc defines how fwknop will
12 #          send the port knocking sequence for source machines in
13 #          access.conf.  Multiple access controls can be specified for
14 #          the same source machine.
15 #
16 # See the fwknop man page for a comprehensive treatment of the various
17 # access control variables.  See below for a few examples of access control
18 # configurations.
19 #
20 # Access examples:
21 #
22 # 1) Define parameters for accepting single-packet authorization messages
23 #    from any source IP address via libpcap.  Fwknop will reconfigure the
24 #    local Netfilter policy to allow access to the port that is contained
25 #    within the encrypted authentication packet for 30 seconds from the IP
26 #    also specified in the packet.  This example probably represents the
27 #    best configuration for most needs:
28 #
29 #   SOURCE: ANY;
30 #   DATA_COLLECT_MODE: PCAP;
31 #   KEY: myencryptkey;
32 #   FW_ACCESS_TIMEOUT: 30;
33 #
34 # 2) This example is identical to example 1) above, but now we add GPG keys
35 #    as an alternate encryption method.  The original symmetric key will
36 #    still be accepted, but only if an attempted GPG decrypt does not
37 #    succeed.  The GPG_REMOTE_ID is the key ID that the encrypted packet is
38 #    signed with by the fwknop client.  Note that using GPG keys requires
39 #    that the client key has been imported (and signed) into the
40 #    GPG_HOME_DIR key ring on the server side, and the server key has been
41 #    imported (and signed) into the GPG key ring on the client side. Because
42 #    the GPG password for the server key is put within the access.conf, the
43 #    server key should be specifically generated and used only for fwknop
44 #    server functions; it should not a valuable GPG key that is used for
45 #    things like personal email encryption. See the fwknop man page for
46 #    examples of how to use the GPG encryption method from the fwknop
47 #    command line on the client side.
48 #
49 #   SOURCE: ANY;
50 #   DATA_COLLECT_MODE: PCAP;
51 #   KEY: myencryptkey;
52 #   GPG_HOME_DIR: /root/.gnupg;
53 #   GPG_DECRYPT_ID: ABCD1234;
54 #   GPG_DECRYPT_PW: myGpgPassword;
55 #   GPG_REMOTE_ID: 1234ABCD;
56 #   FW_ACCESS_TIMEOUT: 30;
57 #
58 # 3) This example is identical to example 1) above, but now we allow a
59 #    remote fwknop client to send a command to the fwknop server (which it
60 #    will execute as root):
61 #
62 #   SOURCE: ANY;
63 #   DATA_COLLECT_MODE: PCAP;
64 #   ENABLE_CMD_EXEC;
65 #   KEY: myencryptkey;
66 #   FW_ACCESS_TIMEOUT: 30;
67 #
68 # 4) This example is identical to example 2) above, but now we specify a
69 #    regular expression which any remote command must match before being
70 #    executed:
71 #
72 #   SOURCE: ANY;
73 #   DATA_COLLECT_MODE: PCAP;
74 #   ENABLE_CMD_EXEC;
75 #   CMD_REGEX: /sbin/iptables.*ACCEPT;
76 #   KEY: myencryptkey;
77 #   FW_ACCESS_TIMEOUT: 30;
78 #
79 # 5) This example is similar to example 1) above, but this time instruct
80 #    fwknop to read packets from a file that is written to by a sniffer
81 #    process or by something like the ulogd pcap writer (use ULOG_PCAP for
82 #    this).  The specific file path is defined by the PCAP_FILE keyword in
83 #    /etc/fwknop/fwknop.conf).  We also require that the username on the
84 #    system that generates the authorization packet is "mbr":
85 #
86 #   SOURCE: ANY;
87 #   DATA_COLLECT_MODE: FILE_PCAP;
88 #   KEY: myencryptkey;
89 #   FW_ACCESS_TIMEOUT: 30;
90 #   REQUIRE_USERNAME: mbr;
91 #
92 # 6) OLD STRATEGY: define parameters for accepting an encrypted knock
93 #    sequence from any source IP address.  Note that the specific port that
94 #    will be opened is sent within the encrypted sequence (see the -p and -P
95 #    options when running fwknop in client mode) since the OPEN_PORTS
96 #    variable is not defined.
97 #
98 #   SOURCE: ANY;
99 #   DATA_COLLECT_MODE: ENCRYPT_SEQUENCE;
100 #   KEY myencryptkey;
101 #
102 # 7) OLD STRATEGY: Define parameters for an encrypted sequence that requires
103 #    the operating system from which the encrypted sequence originates be
104 #    identified as a Linux system (any kernel version).  In addition, define
105 #    the firewall access timeout to be 10 minutes instead of the default of
106 #    5 minutes, and restrict access for only those source IP addresses that
107 #    are within a specific subnet:
108 #
109 #   SOURCE: 192.168.10.0/24;
110 #   DATA_COLLECT_MODE: ENCRYPT_SEQUENCE;
111 #   KEY myencryptkey;
112 #   FW_ACCESS_TIMEOUT: 600;
113 #   REQUIRE_OS_REGEX: linux;
114 #
115 # 8) OLD STRATEGY: Define parameters for a shared knock sequence originating
116 #    from any source IP address, and use the tcp, udp, and icmp protocols in
117 #    the knock sequence.  The sequence consists of a total of four ports:
118 #
119 #   SOURCE: ANY;
120 #   SHARED_SEQUENCE: tcp/65531, udp/65533, tcp/65532, udp/65530;
121 #
122 # 9) OLD STRATEGY: Define parameters for a shared knock sequence identical
123 #    to 7) above, but require the operating system from which the sequence
124 #    originates to be exactly "OpenBSD:3.0-3.5::OpenBSD 3.0-3.5" (see the
125 #    file /etc/fwknop/pf.os):
126 #
127 #   SOURCE: ANY;
128 #   SHARED_SEQUENCE: tcp/65531, udp/65533, tcp/65532, udp/65530;
129 #   REQUIRE_OS: OpenBSD:3.0-3.5::OpenBSD 3.0-3.5;
130 #
131 ##############################################################################
132 #
133 # $Id$
134 #
135
136 ### default Single Packet Authorization (SPA) via libpcap:
137 SOURCE: ANY;
138 DATA_COLLECT_MODE: PCAP;
139 KEY: _CHANGEME_;
140 FW_ACCESS_TIMEOUT: 30;
Note: See TracBrowser for help on using the browser.