4 ms·
why use a huge codebase like node for such a simple security critical task
by corndoge 9y ago
why use a huge codebase like node for such a simple security critical task
- jlgaddis 9y agoWhen all you have is a hammer...
- joshribakoff 9y agoHow else do you suggest you standup a sftp that cannot leak data even if the password is compromised? I'm all ears. Node is a runtime by the way and huge in what regard? The Linux codebase is also large.
- Karunamon 9y agoFirst thing that comes to my mind is a PAM plugin that generates a new root directory for the user when they log in, named something sane under a fixed hierarchy. A recursive walk can later pick them all up and clean up.
- kalleboo 9y agoCan't you just host a directory with -w- permissions? "Drop box" directories have been a staple of file sharing software for decades.
- Karrot_Kream 9y agoSeconding what kalleboo said, setting directory permissions has been a staple of file-sharing for decades. Setting up a node server to block read-access seems incredibly byzantine.
- joshribakoff 9y agoGood point but we also have to load balance this / have failover and provision users on the fly. I could have used messaging queues to provision PAM users on the whole cluster and this guy would have still complained because I used a non standard port. Not sure why that was a problem either but again we can't press back or question him. he would cancel the whole integration. Bottom line is our end user wanted real time data (presumably via an API)
- corndoge 9y agowhat's wrong with nonstandard ports?
- Karrot_Kream 9y agoA lot of FTP servers have provisions to essentially "ignore" the user and proxy into the directory. As far as load balancing is concerned, most FTP servers can handle very high throughput because of the simplicity of the protocol. If you really did want to load balance it, haproxy can do that just fine.
- le-mark 9y ago> we can't press back or question him. he would cancel the whole integration This attitude will not serve you well. There's saying no, and then there's getting more information (requirements!?!) to then guide people to better decisions.
- patmcc 9y agoYou use chmod on the directory...writing any code for this kind of task would be crazy overkill.
- notyourday 9y agoIt is a system administration problem, not write a new software problem. You: a) think about the scope of the problem and what you are trying to achive - you are blocking reads of the files by the uid/gid of the server. It is a known and solved problem. The tool is called chmod b) think about the surface area of the attack - it should only be the SFTP server. We have ones that are very well known. I recommend the one that comes with OpenSSH but there are others. c) think about business requirements - user's provisioning etc. That has been a solved problem for years - for the super-complex cases LDAP is used. For the simpler ones you can use PAM. After thinking about that you just write the needed glue.