Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Ravada-Mirror
Commits
21258cd9
Commit
21258cd9
authored
Nov 29, 2016
by
Francesc Guasch
Browse files
[#51] just open the port for the remote ip
parent
0830f6a9
Changes
2
Show whitespace changes
Inline
Side-by-side
docs/production.md
View file @
21258cd9
...
@@ -46,3 +46,14 @@ And the backend must run from root
...
@@ -46,3 +46,14 @@ And the backend must run from root
# ./bin/rvd_back.pl &
# ./bin/rvd_back.pl &
## Firewall
Ravada uses
`iptables`
to restrict the access to the virtual machines.
Thes iptables rules grants acess to the admin workstation to all the domains
and disables the access to everyone else.
When the users access through the web broker they are allowed to the port of
their virtual machines. Ravada uses its own iptables chain called 'ravada' to
do so:
-A INPUT -p tcp -m tcp -s ip.of.admin.workstation --dport 5900:7000 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 5900:7000 -j DROP
lib/Ravada/Domain.pm
View file @
21258cd9
...
@@ -795,13 +795,13 @@ sub _add_iptable {
...
@@ -795,13 +795,13 @@ sub _add_iptable {
$self
->
_log_iptable
(
iptables
=>
\
@iptables_arg
,
@
_
);
$self
->
_log_iptable
(
iptables
=>
\
@iptables_arg
,
@
_
);
@iptables_arg
=
(
'
0.0.0.0
'
#
@iptables_arg = ( '0.0.0.0'
,
$local_ip
,
'
filter
',
$IPTABLES_CHAIN
,
'
DROP
',
#
,$local_ip, 'filter', $IPTABLES_CHAIN, 'DROP',
,{'
protocol
'
=>
'
tcp
',
'
s_port
'
=>
0
,
'
d_port
'
=>
$local_port
});
#
,{'protocol' => 'tcp', 's_port' => 0, 'd_port' => $local_port});
#
(
$rv
,
$out_ar
,
$errs_ar
)
=
$ipt_obj
->
append_ip_rule
(
@iptables_arg
);
#
($rv, $out_ar, $errs_ar) = $ipt_obj->append_ip_rule(@iptables_arg);
#
$self
->
_log_iptable
(
iptables
=>
\
@iptables_arg
,
%args
);
#
$self->_log_iptable(iptables => \@iptables_arg, %args);
}
}
...
@@ -859,10 +859,10 @@ sub _obj_iptables {
...
@@ -859,10 +859,10 @@ sub _obj_iptables {
(
$rv
,
$out_ar
,
$errs_ar
)
=
$ipt_obj
->
chain_exists
('
filter
',
$IPTABLES_CHAIN
);
(
$rv
,
$out_ar
,
$errs_ar
)
=
$ipt_obj
->
chain_exists
('
filter
',
$IPTABLES_CHAIN
);
if
(
!
$rv
)
{
if
(
!
$rv
)
{
$ipt_obj
->
create_chain
('
filter
',
$IPTABLES_CHAIN
);
$ipt_obj
->
create_chain
('
filter
',
$IPTABLES_CHAIN
);
$ipt_obj
->
add_jump_rule
('
filter
','
INPUT
',
0
,
$IPTABLES_CHAIN
);
$ipt_obj
->
add_jump_rule
('
filter
','
INPUT
',
1
,
$IPTABLES_CHAIN
);
}
}
# set the policy on the FORWARD table to DROP
# set the policy on the FORWARD table to DROP
$ipt_obj
->
set_chain_policy
('
filter
',
'
FORWARD
',
'
DROP
');
#
$ipt_obj->set_chain_policy('filter', 'FORWARD', 'DROP');
return
$ipt_obj
;
return
$ipt_obj
;
}
}
...
...
Write
Preview
Supports
Markdown
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