marcus67 / little_brother

Parental Control Application implemented in Python 3 packaged for Debian and Ubuntu to monitor and limit kids' play time on Linux hosts
GNU General Public License v3.0
59 stars 9 forks source link

Provide mechanism to activate filewall rules for devices of users who are over their time limit #169

Closed marcus67 closed 2 years ago

marcus67 commented 2 years ago

In case LittleBrother is setup to monitor extra devices it would come in handy to setup firewall rules to deactivate the network connection of all those devices to the outside world. This would represent at least some impact of being "over time limit" since LittleBrother cannot directly influence the extra devices.

The simplest approach would be using iptables. When a user is over budged all devices that are linked to him would be blocked by issuing commands such as

iptables -I FORWARD -s SOME.MONITORED.DEVICE.IP  -j DROP

The state could be verified using

iptables -n -L  FORWARD --line-numbers

When the user is permitted to use the computer again the rule identified in the list above could be deleted using

iptables -D FORWARD RULE_NUMBER
marcus67 commented 2 years ago

Closed in eaae776b56b0003ff7478d1d7fa5e0b4b6a8ba81