News for hackers. Stuff that matters.
Re:Show HN: Ultimate Plumber – a tool for writing Linux pipe... by twanvl on Wednesday October 24, 2018 @01:45PM (#18294678)
Another solution is to only allow commands from a whitelist to be run. If the user types something not on the list you say "rm is not on the list of allowed commands, press enter to run and add it".
Re:Show HN: Ultimate Plumber – a tool for writing Linux pipe... by ElijahLynn on Wednesday October 24, 2018 @03:06PM (#18295398)
++

And rather a blacklist, since a blacklist would be much smaller than a potentially an infinite amount of programs to manage for a whitelist.

Re:Show HN: Ultimate Plumber – a tool for writing Linux pipe... by chrisshroba on Wednesday October 24, 2018 @03:32PM (#18295607)
I think the whitelist makes more sense, since you can never say for sure that you've added every potentially harmful program to the blacklist. If it's easy to add things to the whitelist, as the parent comment proposed, I think the idea would work very well, especially considering most people have a relatively small number of commands they pipe other commands into.

Btw, if you want to see all the commands you've ever piped data into, sorted by frequency, you can use this command (which I put together using `up`!)

    history | grep -o '| \w\w*' | sort | uniq -c | sort -n | nl