Skip to contentSkip to conversation

Introduce minidlna policy

PATCH New Sven Vermeulen 2 participants 4 messages May 7, 2013 – May 9, 2013

lore
Share & tools
lore
#0 lore raw

v2 cover Introduce minidlna policy

Please find herein two patches (one for main repo to declare the trivnet1 port and one for the contrib submodule to provide the minidlna policy) to support minidlna in refpolicy.

The first draft was sent out on May 1st [1]; I've incorporated the changes that Dominick provided, hopefully it is ok now. The discussion sparked a bit of side-information on networking which I ignored for now: the corenet_{tcp,udp}_sendrecv_* calls are still in there, even though they should not be needed anymore. I left them in for consistency with existing policy, but if you prefer without I am more than happy to remove them.

[1] http://oss.tresys.com/pipermail/refpolicy/2013-May/006393.html

The patch for main repo (declaration of trivnet1) needs to go in before the contrib change can (as it uses interfaces defined in the first patch).

Wkr,
Sven Vermeulen

#1 lore raw

PATCH v2 1/2 Add trivnet1 port (8200)

Create the proper port types for trivnet1 (port 8200)

---
 policy/modules/kernel/corenetwork.te.in | 1 +
 1 file changed, 1 insertion(+)
policy/modules/kernel/corenetwork.te.in +1 -0
index e78ee3b..060c7fc 100644
@@ -261,6 +261,7 @@ network_port(tor, tcp,6969,s0, tcp,9001,s0, tcp,9030,s0, tcp,9050,s0, tcp,9051,s
 network_port(traceroute, udp,64000-64010,s0)
 network_port(transproxy, tcp,8081,s0)
 network_port(trisoap, tcp,10200,s0, udp,10200,s0)
+network_port(trivnet1, tcp, 8200, s0, udp, 8200, s0)
 network_port(ups, tcp,3493,s0)
 network_port(utcpserver) # no defined portcon
 network_port(uucpd, tcp,540,s0)
Signature · 1 line
1.8.1.5
#2 lore raw

PATCH v2 2/2 Add minidlna policy

In reply to Sven Vermeulen

The minidlna policy allows the minidla server to listen on the ssdp and trivnet1 ports (ssdp is for the discovery, trivnet1 for serving the files) and serve files marked as public_t.

If minidlna_read_generic_user_content is set, the server can also be used to serve user content.

Changes since v1
- Use minidlna_conf_t instead of minidlna_etc_t
- Add in directories used in fedora
- More descriptive booleans and general module summary
- Remove explicit node_bind permission as it is provided through other interface calls
- Allow creating minidlna_log_t entries
- Drop filetransitions for log file and /var/lib
- Use permission sets when combined pattern interfaces are not needed
- Introduce auth_use_nsswitch as minidlna interprets nsswitch.conf
- Drop *_client_packets interfaces (secmark), the domain does not act as a client

---
 minidlna.fc |  14 +++++++++
 minidlna.if |  64 ++++++++++++++++++++++++++++++++++++++
 minidlna.te | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 180 insertions(+)
 create mode 100644 minidlna.fc
 create mode 100644 minidlna.if
 create mode 100644 minidlna.te
minidlna.fc new file +14 -0
new file mode 100644
index 0000000..9d4cd52
@@ -0,0 +1,14 @@
+/etc/rc\.d/init\.d/minidlna	--	gen_context(system_u:object_r:minidlna_initrc_exec_t,s0)
+
+/etc/minidlna\.conf	--	gen_context(system_u:object_r:minidlna_conf_t,s0)
+
+/usr/sbin/minidlna	--	gen_context(system_u:object_r:minidlna_exec_t,s0)
+
+/var/cache/minidlna(/.*)?	gen_context(system_u:object_r:minidlna_db_t,s0)
+
+/var/lib/minidlna(/.*)?		gen_context(system_u:object_r:minidlna_db_t,s0)
+
+/var/log/minidlna(/.*)?		gen_context(system_u:object_r:minidlna_log_t,s0)
+/var/log/minidlna\.log.*	--	gen_context(system_u:object_r:minidlna_log_t,s0)
+
+/var/run/minidlna(/.*)?		gen_context(system_u:object_r:minidlna_var_run_t,s0)
minidlna.if new file +64 -0

64 lines not on this page · raw message

minidlna.te new file +102 -0

102 lines not on this page · raw message

Signature · 1 line
1.8.1.5
#3 lore raw

v2 cover Introduce minidlna policy

In reply to Sven Vermeulen
Quoted 3 lines · Sven Vermeulen

Please find herein two patches (one for main repo to declare the trivnet1 port and one for the contrib submodule to provide the minidlna policy) to support minidlna in refpolicy.

Merged.

Quoted 6 lines

The first draft was sent out on May 1st [1]; I've incorporated the changes that Dominick provided, hopefully it is ok now. The discussion sparked a bit of side-information on networking which I ignored for now: the corenet_{tcp,udp}_sendrecv_* calls are still in there, even though they should not be needed anymore. I left them in for consistency with existing policy, but if you prefer without I am more than happy to remove them.

I'm keeping them for now, though I'll eventually circle back to clean up the compat_net rules across the entire policy.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com