5

The place where I work forces me to use a proxy to get to the Internet. As we know, setting a proxy is nothing but putting a string like export http_proxy=http://account:[email protected]:8080 into a config file such as .bashrc. I tried like this and it worked well.

I'm just thinking if there is another more secure way to do so? In my opinion, writing the password as plaintext into some config file is not secure.

6
  • Hmmm. Unless you suspect the system administrator (root) to spy on the users, it seems like the simplest way other than prompting you for the password every single time (with a shell script). Commented Feb 13, 2018 at 6:22
  • @JuliePelletier Hmm, I think you are right...
    – Yves
    Commented Feb 13, 2018 at 6:24
  • @JuliePelletier Not just root. Anyone having two seconds on your open shell while you turn around to your tea cup can do a echo $http_proxy. And any script or program you run has access to that environment variable. A small security hole in any software you run will leak your password. At least I'd limit the setting to the startup script of applications like the web browser that really need it.
    – Philippos
    Commented Feb 13, 2018 at 6:52
  • Do you have an ssh account with a normal user in the proxy server? Commented Feb 13, 2018 at 7:15
  • 1
    Your own processes can just read /proc/x/environ on many systems, so if you're concerned about protecting against them then you're out of luck. Commented Feb 13, 2018 at 7:58

1 Answer 1

6

Someone getting the password from your terminal is the least of your problems.

The bigger problem is that using the proxy via a non-encrypted protocol over the network, your login and password can be easily sniffed. BASIC HTTP password authentication encoding is too weak and is deencoded on the fly.

An immediate improvement is tunneling the proxy requests over SSH, using autossh to be always logged in the proxy server.

Over time, the requests to the proxy service should be made over TLS if possible.

As for the terminal, I always have a lock icon on it, and when I have to leave my desk I click the lock icon.

Back to protecting the password on your disk:

protect the password in an encrypted file, with OpenSSL for instance.

Write a login script that fills your http_proxy variable at login time asking you for a password. If you are using Gnome and are able to get the password from Gnome keyring to fill http_proxy is other interesting solution.

1
  • how do you use https proxy if 99% of software, including OpenVPN or firefox or any mozilla software, doesn't even support that? All these programs support only HTTP proxy, or SOCKS which is usually impossible given that most corporate firewalls block SSH connections
    – Petr
    Commented Jul 29, 2020 at 11:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .