Menu

Notes on the technical choices behind glocker, a Linux blocker I can’t switch off
📰

Notes on the technical choices behind glocker, a Linux blocker I can’t switch off

DEV Community: go·Noufal Ibrahim·about 9 hours ago
#8Yrn1v0c
#devtogo#devto#dev#sudo#file
Reading 0:00
15s threshold

I spent some time creating a tool to block sites and apps based on schedules as well as to track behaviour. This is an overview of how it works.

The application is completely open source and available at the official site

Blocking

Blocking is done by putting domains into /etc/hosts, pointed at localhost, and the file is made immutable with chattr +i. A small server on 127.0.0.1 answers those requests with a blocked page and logs the hit. The domains are fetched from public blocklists. Domains which have web based proxies are also blocked. A Firefox/Chrome extension, force-installed through the browsers' enterprise policies, catches keywords in URLs and page content. Programs on a list are killed during their windows. Repeated violations run a command of your choice, usually a screen lock you can't dismiss until it times out.

Taking away sudo

If glocker is uninstalled, all protections are lifted.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.