9,867 karma · joined Aug 20, 2015 (11y ago) · 5,528 submissions
comment 3mo ago · link · parent
- Linux is too complicated and requires lot of knowledge to build a reliable sandbox. If you do not believe me, try reading man capabilities, man user_namespaces (and man clone) and remembering all the rules from the first time. Probably that is because namespaces were implemented in the late stages of development and not since the start.
- it is always better to write your own tools instead of downloading some random project from Github written by amateurs full of vulnerabilities.
- never write shell scripts - they cannot handle spaces and special characters in variables. Just use Python. Shell scripts are worse than PHP4.
- avoid building complex infrastructure with microservices, kubernetes and VMs - if the monolith solves the problem, just use it, you will never properly setup permission on your cloud services.
Also I wish I had some capable model to test my DYI sandboxes.
comment 3mo ago · link · parent
[1] https://huggingface.co/blog/agent-intrusion-technical-timeli...
comment 3mo ago · link · parent
comment 3mo ago · link · parent
Some paragraphs or articles might be temporary amended/repelled by a Constitutional court, or have some related case law, so there must be links or notes.
Just to give you an idea, here is an example of a "proper" commercial law search system with notes and hyperlinks (in Russian, but Firefox translates it without issues): [1]. I noticed that the German system has no markup, so the German site feels like working with code in a notepad, without coloring and "go to definition" after using an IDE. Or like trying to read law from a gazette/journal of legislative acts.
[1] https://www.consultant.ru/document/cons_doc_LAW_37119/823a1b...
comment 3mo ago · link · parent
I am not sure if I can set ACL or ownership on /proc files, it is not a disk-based filesystem.
> You don't get the ability to mount just because you created an unprivileged user namespace.
Please consult "man user_namespaces", section "Effect of capabilities within a user namespace". It clearly says that one can mount /proc inside a mount namespace governed by a user namespace without being root. The reason why you weren't aware is probably because the rules related to namespaces and capabilities are extremely complicated.
> Vim is a text editor, but you can e.g. have it make a call with ssh to get info from wherever and put that info into the buffer.
I definitely do not want proprietary applications running ssh on my system without me knowing.
comment 3mo ago · link · parent
Also, I might want to provide some fake data, for example, if app relies on reading /proc/cmdline or /proc/cpuinfo. So the app should be able to read the files, but not the real data.
> And most sandboxes disallow unprivileged CLONE_NEWUSER with seccomp
I ma worried that some applications (like Chrome, Electron-based apps) might not work without user namespaces. GTK uses "glycin" library, it launches subprocesses for handling images in a bwrap-based sandbox, and it broke inside my sandbox, so I had to do quick fixes for it.
No, sandboxing in Linux is not easy. Just look at "man capabilities" or "man user_namespaces" and see how many rules and exceptions from rules are there. You need to understand it if you write a sandbox, but it is so complicated. And obviously AI cannot be trusted with such a responsible task.
comment 4mo ago · link · parent
So I want to follow the principle of minimal privileges and only grant access to files needed for running a program. Sadly many programs cannot run without /proc. For example, poorly coded Apple's Grand Central Dispatch library crashes the application (for example, Telegram) if it cannot enumerate the information about threads or processes. It needs this information to calculate how many additional worker threads need to be created, and if it cannot calculate the number, it terminates the application for reasons I do not understand.
There is also a catch that the program can create a new unprivileged user namespace and mount /proc there thus bypassing my daemon completely. Anyone can create a user namespace nowadays.
> Another option may be to set up a container or PID namespace and give your tool direct access to that /proc.
/proc contains information not only about processes, but a lot of extra information.
comment 4mo ago · link · parent
comment 4mo ago · link · parent
It is a poor idea to use blockchain for government registries. If you want transparency, simply publish signed daily updates and that's enough. Just use simple DB with backups, and optionally, a printer printing changes on a paper.