Skip to contentSkip to conversation

Question regarding meta skuid

DISCUSSION J Doe 1 participant 2 messages Aug 8, 2017 – Aug 13, 2017

lore
Share & tools
lore

J Doe

author
#0 lore raw

Hello,

I am currently experimenting with nftables syntax for a LAMP web server.

Initially I used the following rules:

add rule filter input tcp dport { http, https } ct state new,established,related accept add rule filter output tcp sport { http, https } ct state established,related accept

I then though it would be good to limit traffic to processes with specific user ids. In the case of the webserver this would be "root" as well as "www-data".

This works on outbound traffic:

add rule filter output tcp sport { http, https } meta skuid { root, www-data } ct state established,related accept

...but when I attempt to limit inbound traffic to processes that are run on the *SERVER* as either "root" or "www-data":

add rule filter input tcp dport { http, https } meta skuid { root, www-data } ct state new,established,related accept

...a web client cannot complete the connection.

When I remove the "meta skuid { root, www-data }" from the inbound rule, everything is ok.

I am assuming this is because nftables cannot determine what process was the originator of the inbound traffic. That makes sense, but what I'd like to know is there a way to limit *INBOUND* traffic to only specific processes ? In that case, allow inbound HTTP/S traffic *ONLY* to processes running under "root" or "www-data" as opposed to knowing that the traffic originated from the *CLIENT* as "root" or "www-data" ?

Thanks,

- J

author
#1 lore raw

Hello,

I was wondering if anyone had feedback regarding limiting which accounts on a host can receive traffic.

I initially attempted to use the following rule to allow inbound traffic on port 80/443 to be handled only by processes on the server that were root or www-data:

add rule filter input tcp dport { http, https } meta skuid { root, www-data } ct state new,established,related accept

...I have since learned that a better approach for this rule would be abstracting the connection states out, but I have repeated the rule from my original post.

This did not work as nftables is attempting to limit the skuid to root or www-data based on the client account that created the traffic - which is not included in the traffic.

Is there a way to restrict this so only processes owned by root or www-data on the server will receive HTTP/S traffic (either with nftables or another means) ?

Thanks,

- J