20210717-Re_GSoC Port Forwarding-14008.html 5.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <html>
  2. <head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  3. <title>Re: GSoC Port Forwarding</title>
  4. <link rel="important stylesheet" href="">
  5. <style>div.headerdisplayname {font-weight:bold;}
  6. </style></head>
  7. <body>
  8. <table border=0 cellspacing=0 cellpadding=0 width="100%" class="header-part1"><tr><td><div class="headerdisplayname" style="display:inline;">Oggetto: </div>Re: GSoC Port Forwarding</td></tr><tr><td><div class="headerdisplayname" style="display:inline;">Mittente: </div>Frédéric Pierret &lt;frederic.pierret@qubes-os.org&gt;</td></tr><tr><td><div class="headerdisplayname" style="display:inline;">Data: </div>17/07/2021, 21:07</td></tr></table><table border=0 cellspacing=0 cellpadding=0 width="100%" class="header-part2"><tr><td><div class="headerdisplayname" style="display:inline;">A: </div>Giulio <giulio@gmx.com></td></tr><tr><td><div class="headerdisplayname" style="display:inline;">CC: </div>Marek Marczykowski-Górecki &lt;marmarek@invisiblethingslab.com&gt;</td></tr></table><br>
  9. <div class="moz-text-flowed" style="font-family: -moz-fixed; font-size: 14px;" lang="x-unicode">Hi,
  10. <br>
  11. <br>Le 7/17/21 à 5:31 PM, Giulio a écrit :
  12. <br><blockquote type=cite style="color: #007cff;">Hi,
  13. <br>thank you for the positive feedback, I really appreciate it.
  14. <br>I spent the past couple of days digging into the "rules distribution"
  15. <br>mechanism in the various QubesDB. It really took some time to find a
  16. <br>better way to handle and separate the rules for each domain at every
  17. <br>'step' of their network path.
  18. <br>
  19. <br><a class="moz-txt-link-freetext" href="https://github.com/lsd-cat/qubes-core-admin/commit/0cf04fb290469340a59a013531bba6e06e8a0169">https://github.com/lsd-cat/qubes-core-admin/commit/0cf04fb290469340a59a013531bba6e06e8a0169</a>
  20. <br>
  21. <br>The idea here is that each appvm will have a separate QubesDB folder on
  22. <br>the untrusted qdb of each netvm. This is for easier cleaning and
  23. <br>reloading, and can be used in the future when displaying the forwarding
  24. <br>chain at each step like we were discussing with Marek in the first
  25. <br>emails. A practical example follows.
  26. <br>
  27. <br>Assume the following network path:
  28. <br>
  29. <br><b class="moz-txt-star"><span class="moz-txt-tag">*</span>internet/lan<span class="moz-txt-tag">*</span></b> &lt;-&gt; sys-net (10.137.0.5) &lt;-&gt; sys-firewall (10.137.0.6)
  30. <br>&lt;-&gt; sys-vpn (10.137.0.13) &lt;-&gt; sys-tor (10.137.0.14) &lt;-&gt; personal
  31. <br>(10.137.0.10)
  32. <br>
  33. <br>And the following rule:
  34. <br># qvm-firewall personal add action=forward forwardtype=external
  35. <br>proto=tcp srcports=443-443 dstports=8443-8443 srchost=192.168.0.1/24
  36. <br>
  37. <br>Here are the QubesDB entries that are automatically added, to be
  38. <br>consumed from the core-agent-linux:
  39. <br>
  40. <br>In sys-net:
  41. <br>key = /qubes-firewall-forward/personal/10.137.0.6/0000
  42. <br>value = action=forward forwardtype=external proto=tcp srcports=443-443
  43. <br>dstports=8443-8443 srchost=192.168.0.1/24
  44. <br>
  45. <br>In sys-firewall:
  46. <br>key = /qubes-firewall-forward/personal/10.137.0.13/0000
  47. <br>value = action=forward forwardtype=external proto=tcp srcports=443-443
  48. <br>dstports=8443-8443 srchost=192.168.0.1/24
  49. <br>
  50. <br>In sys-vpn:
  51. <br>key = /qubes-firewall-forward/personal/10.137.0.14/0000
  52. <br>value = action=forward forwardtype=external proto=tcp srcports=443-443
  53. <br>dstports=8443-8443 srchost=192.168.0.1/24
  54. <br>
  55. <br>In sys-tor:
  56. <br>key = /qubes-firewall-forward/personal/10.137.0.10/0000
  57. <br>value = action=forward forwardtype=external proto=tcp srcports=443-443
  58. <br>dstports=8443-8443 srchost=192.168.0.1/24
  59. <br>
  60. <br>Although this mechanism seems complex, I was not able to think of a
  61. <br>simpler solution. Furthermore I think it is important to know which
  62. <br>appvm is requesting the forwarding at every step, both for debugging and
  63. <br>auditing purposes. Lastly, the next hop ip address has to be determined
  64. <br>automatically anyway and writtem somewhere so there it is.
  65. <br></blockquote>
  66. <br>I've not an alternative idea yet but, I'm wondering if leaking appvm names in "higher" untrusted appvms is reasonable, especially for confidentiality. Maybe simply use the destination appvm ip, here in your example that would be personal ip. dom0/GuiVM has access to the info so getting appvm name from ip should be simple.
  67. <br>
  68. <br><blockquote type=cite style="color: #007cff;">I am also thinking about adding a couple of flags to let the nodes know
  69. <br>which one is the first and which one is the last since especially the
  70. <br>last needs additional rules for the external forwarding.
  71. <br></blockquote>
  72. <br>Here too, I'm not sure adding such info is a good idea for security. What exactly do you have in mind for the last needs additional rules?
  73. <br>
  74. <br><blockquote type=cite style="color: #007cff;">One more thing, maybe between internal hops it makes sense to randomize
  75. <br>the forwarded ports? This way we can prevent forwarding from different
  76. <br>appvm which shares the same network path or even just one hop from
  77. <br>overlapping, at least internally. Does it makes sense for you?
  78. <br></blockquote>
  79. <br>Yes that can be some kind of useful hardening or to prevent any conflict indeed.
  80. <br>
  81. <br><blockquote type=cite style="color: #007cff;">Cheers
  82. <br>Giulio
  83. <br></blockquote>
  84. <br>Best,
  85. <br>Frédéric
  86. <br>
  87. <br></div></body>
  88. </html>
  89. </table></div>