<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>FirewallTool</title><revhistory><revision><revnumber>2</revnumber><date>2013-01-21 08:45:46</date><authorinitials>ClintonEbadi</authorinitials><revremark>perhaps what some firewall rules would look like</revremark></revision><revision><revnumber>1</revnumber><date>2013-01-21 08:34:07</date><authorinitials>ClintonEbadi</authorinitials><revremark>it turns out that I am actually going to write new domtool container types god help me</revremark></revision></revhistory></articleinfo><caution><para>The system described below does not yet exist and is only in the earliest planning stages. See <ulink url="https://wiki.hcoop.net/FirewallTool/FirewallRules#">FirewallRules</ulink> for how we manage firewalls today. </para></caution><section><title>Rationale</title><para>The current <ulink url="https://wiki.hcoop.net/FirewallTool/FirewallRules#">FirewallRules</ulink> system is a pretty thin abstraction over ferm, and has an ad-hoc parser with a number of built in limitations. Even after only having a dozen or so rules, it is becoming clear that managing firewall rules will quickly become burdensome both for members and admins. </para><para>Based on current patterns of requests, there a few things to consider: </para><itemizedlist><listitem><para>We need a way to define groups of rules that members can trivially request </para><itemizedlist><listitem><para>default ports for shell user (http, vcs software, mail, ssh, ...) </para></listitem><listitem><para>common rules for certain cgi applications or special uses (e.g. wordpress always needs to contact wordpress.org for full functionality) </para></listitem></itemizedlist></listitem><listitem><para>Don't want to tie configuration to physical nodes (e.g. moving to a new shell server) </para></listitem><listitem><para>Restrict users to having rules on certain nodes (statically enforced) </para></listitem><listitem><para>Members should be able to grant themselves &quot;safe&quot; rules without any admin intervention </para><itemizedlist><listitem><para>allowing members to grant themselves safely marked rule groups seems like a good start </para></listitem></itemizedlist></listitem></itemizedlist><para>A few wish list considerations: </para><itemizedlist><listitem><para>Want to store per-node firewall config for system services (apache, exim, imap, etc.) </para><itemizedlist><listitem><para>Ideally, also store common port config (afs, kerberos, domtool, etc.) </para></listitem></itemizedlist></listitem></itemizedlist><para>Conclusion: the current fwtool implementation would require duplicating a lot of functionality already present in the support machinery for the domtool <code>domain</code> type. A new syntax for user rule files would need to be created (or tons of hackish supporting code) so ...  </para><para>The only (in)sane way forward is to create a domtool container for firewalls to manage rules. This has distinct advantages: </para><itemizedlist><listitem><para>Takes advantage of current domtool infrastructure for pushing configs </para></listitem><listitem><para>The domtool language is quite nice and has the needed functionality for abstracting groups of users, common config, etc. </para></listitem><listitem><para>Lays the groundwork for using domtool to perform node management in addition to domain management </para></listitem></itemizedlist></section><section><title>Idea</title><para>My current thinking, expressed in pseudo-domtool @sig@ </para><screen><![CDATA[(* -*- domtool -*- *)
]]><![CDATA[
firewall "node" with
  userRules "user" with
    proxiedServer [port, ...] [host, ...];
    client [port, ...] [all_hosts];
    server ...;
  end;
end;
(* userRules could implicitly create group? *)
]]><![CDATA[
]]><![CDATA[
firewallGroup "name" with
  client ...;
end;
(* Groups would be independent of nodes? *)
(* How to differentiate between groups users can request and not? *)
]]><![CDATA[
firewallRules with
  addRules "group_name"; (* On DefaultFirewallHost? Or not support? *)
  addRulesAt "node" "group_name";
end;
]]><![CDATA[
(* In some user config file, let them grant themselves common ports on
   user nodes. Definitely provide bindings for web/shell nodes. *)]]></screen><!--rule (<hr>) is not applicable to DocBook--><para> <ulink url="https://wiki.hcoop.net/FirewallTool/CategorySystemAdministration#">CategorySystemAdministration</ulink> <ulink url="https://wiki.hcoop.net/FirewallTool/CategoryWorkInProgress#">CategoryWorkInProgress</ulink> </para></section></article>