Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
puppet-shorewall
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chris
puppet-shorewall
Commits
0c28fa63
Commit
0c28fa63
authored
Jan 07, 2012
by
intrigeri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow redirecting DNS requests to Tor for specific users or globally.
parent
911cc18e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
1 deletion
+56
-1
README
README
+12
-1
manifests/init.pp
manifests/init.pp
+6
-0
manifests/rules/torify/redirect_dns_to_tor.pp
manifests/rules/torify/redirect_dns_to_tor.pp
+38
-0
No files found.
README
View file @
0c28fa63
...
...
@@ -107,7 +107,18 @@ rejected. This is intentional: it does not make sense leaking -via DNS
requests- network activity that would otherwise be torified. In that
case you probably want to read proper documentation about such
matters, enable the Tor DNS resolver and redirect DNS requests through
it.
it,
either globally:
shorewall::rules::torify::redirect_dns_to_tor { '-': }
or for specific users:
shorewall::rules::torify::redirect_dns_to_tor { ['bob', 'alice' ]: }
The $tor_dns_host and $tor_dns_port variables must be set before
these defines are setup.
Example
-------
...
...
manifests/init.pp
View file @
0c28fa63
...
...
@@ -28,6 +28,12 @@ class shorewall {
case
$tor_transparent_proxy_port
{
''
:
{
$tor_transparent_proxy_port
=
'9040'
}
}
case
$tor_dns_host
{
''
:
{
$tor_dns_host
=
'127.0.0.1'
}
}
case
$tor_dns_port
{
''
:
{
$tor_dns_port
=
'8853'
}
}
if
$tor_user
==
''
{
$tor_user
=
$dist_tor_user
?
{
''
=>
'tor'
,
...
...
manifests/rules/torify/redirect_dns_to_tor.pp
0 → 100644
View file @
0c28fa63
define
shorewall::rules::torify::redirect_dns_to_tor
()
{
$user
=
$name
$destzone
=
$shorewall::tor_dns_host
?
{
'127.0.0.1'
=>
'$FW'
,
default
=>
'net'
}
$tcp_rule
=
"redirect-tcp-dns-to-tor-user=
${user}
"
if
!
defined
(
Shorewall
::
Rule
[
"
$tcp_rule
"
])
{
shorewall::rule
{
"
$tcp_rule
"
:
source
=>
'$FW'
,
destination
=>
"
${destzone}
:
${shorewall::tor_dns_host}
:
${shorewall::tor_dns_port}
"
,
proto
=>
'tcp'
,
destinationport
=>
'domain'
,
user
=>
$user
,
order
=>
108
,
action
=>
'DNAT'
;
}
}
$udp_rule
=
"redirect-udp-dns-to-tor-user=
${user}
"
if
!
defined
(
Shorewall
::
Rule
[
"
$udp_rule
"
])
{
shorewall::rule
{
"
$udp_rule
"
:
source
=>
'$FW'
,
destination
=>
"
${destzone}
:
${shorewall::tor_dns_host}
:
${shorewall::tor_dns_port}
"
,
proto
=>
'udp'
,
destinationport
=>
'domain'
,
user
=>
$user
,
order
=>
108
,
action
=>
'DNAT'
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment