summaryrefslogtreecommitdiff
path: root/manifests/rules/torify/user.pp
blob: 5caccfd6131b497a6e0dd657cbd3ceda314bf435 (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
define shorewall::rules::torify::user(
  $originaldest = '-',
  $allow_rfc1918 = true
){

  $user = $name

  include shorewall::rules::torify::allow_tor_transparent_proxy

  if $originaldest == '-' and $user == '-' {
    include shorewall::rules::torify::allow_tor_user
  }

  shorewall::rules::torify::redirect_tcp_to_tor {
    "redirect-to-tor-user=${user}-to=${originaldest}":
      user         => $user,
      originaldest => $originaldest
  }

  shorewall::rules::torify::reject_non_tor {
    "reject-non-tor-user=${user}-to=${originaldest}":
      user          => "$user",
      originaldest  => $originaldest,
      allow_rfc1918 => $allow_rfc1918;
  }

}