420 points · by azalemeth · 5y ago · 118 comments
One (perhaps mad) idea for more secure access to a machine deep behind many levels of NAT where you, the sysadmin, have lawful access but are fed up with having to have a 12 KB ~/.ssh/config file in order to access it because of your university's overbearing IT department^W^W^W^W network topology, would be to "just" run an onionsite with onion services authentication [1], preventing it being publicly accessed without the pre-shared key. If your onion service just redirects to ssh (presumably with certificate-only auth) I can't help but think that this is almost an example of security by obscurity done right.
[1] https://support.torproject.org/en-US/onionservices/client-au...
IT departments make their choices for reasons. The key is to help them understand your use-case, and they'll probably help you through the problem in a way that might limit collateral damage.
Source: have seen firewall bypasses (with a pre-shared key) get leveraged as a way to hack an entire university lab/department.
Shadow IT is a signal that the IT organization is doing things wrong. People use shadow IT because the IT department is not doing it's job properly, serving it's customer base based on the needs they show via their actions.
For example, if you see someone like azalemeth do the things he does, it shows that the IT department needs to become responsive enough and cooperative enough to not push him to do such things in the first place. You notice he's tried to do thing the IT department standard way first, and spent considerable effort before he started his shadow IT method.
Also known as “how to make the netsec team hate you 101”
I agree with you about why shadow IT exists, but most IT departments are spread so thin that expecting them to be super responsive to anything but the most critical business projects is often totally unreasonable.
Then they have to waste even more time hunting down idiots setting up Tor nodes on their internal networks.
Normally this is fine, but my job involves programming and controlling large, expensive, and strangely fragile lab equipment. There's a resilience problem, and it's got to the point where others have suggested putting a GSM modem on a pci-e card inside some of the boxes in question, as the relevant IT department decides on a whim to block ports with no warning or justification. Some manufacturers of the devices in question do this as standard if you have a support contract. Trying to complain results in responses like "you have been used to doing things one way and this change now prevents you from working as before."
I completely accept that this is a political problem and best solved as one, but ultimately SSH is an industry standard for a reason -- it's secure, and it's flexible. The machines in question are valuable, prone to breaking in the middle of the night, and we are an international bunch who cannot always connect from a well-defined ipv4 address, or from the university's VPN. (The latter is blocked by the IT department automatically, as it has too large a pool of potential users). The thing I find most frustrating is that this sort of political decision creates days worth of work instantaneously, for little benefit. All of the actually confidential or sensitive information is held in a completely separate network at any rate...
I am in network security. I have stopped shadow IT, and been a part of it.
Your situation seems so ungodly stupid and anathema to the point of IT, that the remaining courses of action should be the following.
Thoroughly document via email your attempts at explaining requirements to Netsec, to document in writing their objections, to do your best with what they provide you... and WHEN things catastrophically break, point the finger at them and thoroughly document how if you had the proper, industry-standard tooling, you could have prevented the loss of research/time/money.
I have tried so many times to help people understand security and the purpose of a security policy when it is designed correctly, but it doesn't work. The policy exist so people don't need to think, not to make people understand why it exist and what use-cases should be given exceptions.
It’s usually better to not make an exception.
In a perfect world, yes. But I've worked with/at places where ineptitude is rampant, and any attempts of understanding their reasoning is seen as insubordination.
"Hey, IT department...I was wondering..."
"No."
Our IT department goes out the of their way to help us stay sane and productive
- they're making sure most of us can continue to use our favourite Linux distro (I think most Debian/Ubuntu, Fedora and Arch is supported)
- make sure VPN etc works on Linux even if it is not officially supported
- taking time to sit down and debug hard problems (weird issues with WSL2 on one particular Windows laptop) instead of just blaming us engineers
I use Tor plenty to self-host services from my house that are reachable anywhere (and often have a web interface I can access via Orbot). No hole-punching necessary.
Point being, it's not foolproof. If some clever undergrad is thinking about dodging the suits, win by fooling them, not by fighting them.
If you do insist on fighting, though, start at https://www.whonix.org/wiki/Mental_Model and then read the entire Whonix wiki https://www.whonix.org/wiki/Documentation. It's what I used when I was serious about dodging the cartels, and that knowledge will protect you as much as anything will.
(You'll hopefully conclude that the protection is too brittle to risk your life, as I did.)
sometimes I wonder why IT departments and security in general get a bad wrap, then I see things like this.
Should someone send them a sternly worded email for them to ignore?
Or maybe they should be allowed to do whatever they want regardless of what risk it poses to the organization?
There is a tone of “I know what’s best and will do what I want” in this thread.
If you think that the way to get the IT department to implement something for you is to sidestep around policy instead of working with them, you will just piss them off.
[1] https://gitlab.torproject.org/legacy/trac/-/wikis/doc/meek
Note that while this is a handy tool, its use is apparent to anyone observing the connection.
You only need a bunch of jump hosts if your target server has no Internet connectivity, and should not, in which case all these levels of bastions do make sense.
I use an SSH session and SOCKS5 proxy on a VPS provider for almost all of those other circumstances. Including checking external access etc.
But the last one is a solid use case.
Two things that failed mieserably, fetching a file that was just shy of 5M, and a reverse SSH tunnel.
The SSH tunnel was unusable, it would only last for minutes at the most. I wish I could use mosh but that requires UDP.
The file transfer was actually done with curl and the file was often incomplete.
This was all done within Europe where we have the highest concentration of tor nodes.
So no, I don't think tor is appropriate for sysadmin tasks.
So Tor nodes take locality into account? Although, that would improve speeds, it seems like an information leak.
I've been using tor for shell access only and it worked reasonably well for me, but I havent't tried this mode and wonder if your issues persist if it is used.
Worked like a charm, and no regrets. My favorite part was telling my employer "We're using TOR for this" eyebrows.
An organisation that prevents itself from acting rationally is an organisation that should die Schumpter-style. Please don't prevent it.
DNS can be funky, its useful to test resolution externally and internally.
Traffic can be funky when routed, its useful to t-shoot sites through a proxy here and there as there have been times it works internally and is broken externally (often security appliances are inline that may need debugging).
Working in IT infra/ops means its our jobs to use some of these tools to troubleshoot these methods.
I'm also a little confused because preventing someone from using their abilities to problem solve would be a cause of dysfunction -- a seemingly avoidable one.
product page says it requires paid Argo (smart routing) subscription https://www.cloudflare.com/en-gb/products/tunnel/
the blog page says its free https://blog.cloudflare.com/tunnel-for-everyone/
and actually you can install and run it quite easily
brew uninstall cloudflare/cloudflare/cloudflared
cloudflared login
cloudflared tunnel
this will launch a tunnel with a random subdomain listening to http://localhost:8080I hosted the Nessus UI as a Tor Hidden Service, and it worked great. We just cycled the key every quarter for added security, and so that ex-employees wouldn't know where to find it.
NAT is the devil.
The latency of tor might be a bit too much though.
I see a lot of people also advocating ngrok, wireguard, etc. You all may not realize that actual threat actors use all of these same techniques and making yourself look like them could very well lead to your termination as this kind of circumvention of security controls is absolutely a threat to the org and a violation of security policy.
TLDR; If you need remote access, use the proper channels....pretty please. For everyone's sake.
Security will already be monitoring your traffic as a basic first step, which they will pipe straight into a SIEM or SOAR system. Doing this stuff will likely get you flagged for an audit.
Specifically, I've used Tor for connecting to GitHub Actions virtual machines over SSH. This is great for debugging Actions without running them over and over again. I also used this for a project that sets up an ephemeral, collaborative environment in one of the GitHub Actions VMs.
Society would be better if people took this view with all tools. They’re just tools. Unlike people they don’t have intent.