JetBrain's TeamCity May Be Entry Point for U.S. Hack
nytimes.com
nytimes.com
It sounds like the execution was skilled, but I haven't heard anything yet that seems technically novel or extraordinary.
Maybe I haven't read the right articles, but it sounds like solarwinds got pwned, and all these big targets loaded the malware onto their own networks...
Again, skillful execution, but it's not like they cracked an encryption algorithm or even did known-but-still-awesome exploits like rowhammer/spectre
1. The actual malicious payload that was installed on the compromised networks was very sophisticated. It was discussed in the HN post when the news first went live, but the payload went to great and pretty ingenious lengths to hide its tracks and prevent detection. I remember a bunch of HN comments along the lines of "Wow, how did the companies ever even find that?!"
2. How SolarWinds was originally breached hasn't been released, and while the "solarwinds123" password is an unrelated issue, it does point to a pretty shocking lack of security culture at SolarWinds.
I'm going to put my chips down on the original breach being quite simple and mundane, but SolarWinds will go (and has already gone) to great lengths to emphasize the sophistication of the attackers to try to deflect blame.
I'd call that sophisticated even if just in terms of organizational efforts. Additionally, doing this and not getting caught for 6 months or whatever takes significant discipline from every single person involved. You don't see that level of size, discipline and organization outside a handful of top companies.
It is non-trivial to write secure deployment scripts/configs and ensure that access keys and credentials can't be leaked to anyone with dev access.
Any developer tools company worth their salt should be dogfooding their own build system, so they likely build IDEs with this tool. In the worst case, IntelliJ/GoLand/etc could be compromised as a result. This would be unlikely to mean there's malicious source code floating around, but it could mean lots of privileged access to software companies' networks. If the attacks are as targeted as the NY Times article makes it out to be, discovering the full extent of the damage may take quite some time ...
As a former pen tester/red teamer, your favorite CI/CD tool is also my favorite way to gain access to a large footprint within the org.
There's no reason why a merge request on a small tool repository needs access to the AWS keys for production for example.
Splitting instances into different needs. The CI/CD pipeline used for deployment shouldn't be the same one that runs tests for developers.
Especially if that CI/CD pipeline allows for the docker socket to be mounted inside of the CI/CD pipeline so that it can spin up more docker containers (as an example).
It's all about limiting scope. Far too many of these systems are not appropriately configured setup, or are exposed with far too many secrets as environment variables and the like.
Where possible also provide time limited scoped tokens. So a deployment takes ~10 minutes? The AWS creds for that deployment are scoped to 15 minutes. This way if an attacker were able to get those creds in logs or they were copied and pasted into a public paste bin, they were no longer valid by the time someone came across them.
It's all about reducing scope.
The other thing I've noticed is that the team that sets up the CI/CD tooling usually is someone that set it up in their spare time to complete a goal and suddenly it is infrastructure that is weight bearing. You want to make sure that it is maintained like the infrastructure it actually is. That means dedicated system administrators, looping security in, understanding the flows, understanding who has access and how, and what ACL's exist, how execution happens, understanding what kind of access it has.
The lack of dedicated team/updates after it has been configured is killer. Old Jenkins versions are vulnerable to various issues that allow remote code execution in the context of Jenkins itself, so even if your pipelines only have time limited tokens, generally Jenkins itself has access to the keys to the kingdom (or runs on EC2 and now I've got access to the IAM instance profile keys).
Regularly updating means that pipelines will likely break, someone is relying on that old feature that is now gone in the new version. It requires dedicated engineering time to feed the CI/CD system. That is ignored far too often.
Here's ways that the team I was on broke in using CI/CD:
- Pipeline logs were sent to an S3 bucket, which was public and we found a URL an engineer pasted into an open source ticket (the team had helpfully base64 encoded all the secrets in a debugging build, which was also in the open bucket)
- CI/CD service was outdated and we could bypass the authentication it required giving us access to update pipelines
- We could create a new pull request on an open source project that was using an internal CI/CD tool, and steal all the secrets
- Found credentials for CI/CD in the source code to trigger a build on a downstream project (creds were not scoped, and had full access)
- Figured out CI/CD tooling was not tied to corporate AD, so guessed user accounts based upon devs commenting on open source and one of them re-used a password found in a previous breach
- Found creds for a Docker registry, uploaded our own build containers that exfiltrated all of the secrets based upon their own container so they didn't even notice
- CI/CD re-used the same host for executing privileged builds as un-privileged builds, and branches were automatically built. Found an abandoned branch, pushed to it, and broke out of the container due it being privileged, and then waited for the privileged build to start to steal the environment variables for that container
CI/CD literally is remote code execution as a service. Treat it as such.
That sums it up. The code in question is just doing the job it claims to do. CI/CD services literally have forms that allow you to run direct shell commands. If a highly paid engineer doesn't understand the code they are running, then it's time to fire them and get someone in place who does.
It's laughable that we still use base64 in any sort of security context (username:password), because the only people interested in decoding it can do it effortlessly. It almost feels like a weird form of procrastination, where we know what we're doing is wrong, but we're just too damn lazy to do anything about it.
So to bypass that devs base64 encode the secrets (in this case the output from env) so that it is displayed and they can use it to debug that the right environment variables are set...
So meant it more as treat it like you do pulling in a dependency: a black box that constantly requires validation and may break your whole stack of boxes at any point
p.s. its dumb, but, thanks for coming back here and conversating. at a real low this week for sundry reasons outside the news headlines, having a small, normal, discussion where someone assumed good faith even after I failed to make a full effort to participate positively, was a ray of sunshine.
> Compromising and introducing a back door into a build environment such as TeamCity is the holy grail of a supply chain hack. It can allow an adversary to have thousands of SolarWinds-style back doors in all sorts of products in use by victims all over the world. This is a very big deal.
it read like this was much more widespread than I'm hearing now. The NY Times has even gone back and edited the title, replacing "Russian" with "widely used." I hope the editors have another take at this before it gets republished on all the other news sites ...
First, there's a WSJ article out now with some more details that appears to back him up[0]:
> Investigators believe that the SolarWinds hackers gained access to a TeamCity server used by SolarWinds to build its software products, but it is unclear how this system was accessed, according to people familiar with the matter.
Further, some rudimentary OSINT reserach indicates he is, in fact, a JetBrains employee. People can do their own sleuthing if they're inclined to verify this; I have no desire to dox the guy publicly.
[0]: https://www.wsj.com/articles/solarwinds-hack-breached-justic...
This is a very big "may". Reads like they are simply basing these allegations on the Russian founders part.
The lack of evidence feels like they got fingers pointed at them just for being... Russian?
They may not have formally asked JetBrains for assistance with their investigation yet, but that doesn't mean they aren't being investigated.
freedom of the press is important to me, but they also need to hold up their end of the bargain and have integrity and responsibility for their platform.
Edit: To be clear, I don't think the solution is to silence an entity's publications. They do have the right to speak, but when they make unfounded accusations they shouldn't be surprised when they get sued to kindom come. We all have the right to speak, but the rest of us also have the right to defend ourselves and kick your fucking ass if you've misrepresented us with your speech in a public way, because that's libel.
Case in point, I have used TC to gain AD administrative privileges before because the idiot who set it up ran a build agent as a domain admin so it could get access to a locked down signing cert. I just created a new build to add me to the right group and ran it on that agent.
These things are really trivial to find and exploit. Also the build agents will obtain and run almost any untrusted software and leave it on disk quite happily for when a later build comes along.
https://www.extremetech.com/computing/318430-security-resear...
If high-end security firms and fairly diligent government agencies were infiltrated, why would we think that smaller dev toolchain organisations not founded as security organisations will somehow be less likely to be targeted and become a vector for introducing supply chain attacks. Sophisticated attackers will go after any soft underbelly or pore they can find, and there's no reason not to believe they'd put significant effort into quietly abusing Jetbrains security just like they did with Solarwinds. I'm less worried about the "Russian" red scare mention other than it may give non-US organizations a few more opportunities to inject badness that we can't get visibility on.
Bottom-line is that it would be the holy grail and are we treating it as the high priority target it is? Having worked for dev tool companies in the past, I know they are a lot more worried about innovation than about their own internal processes.
Russian-Owned Software Company May Be Entry Point for Huge U.S. Hacking
Russian hackers may have piggybacked on a tool developed by JetBrains, which is based in the Czech Republic, to gain access to federal government and private sector systems in the United States.
The original title:
> Russian Software Company May Be Entry Point for Huge U.S. Hack
Which was changed to:
> Russian-Owned Software Company May Be Entry Point for Huge U.S. Hacking
Then later changed to:
> Widely Used Software Company May Be Entry Point for Huge U.S. Hacking
> The company is not owned by the Russian state and has never been.
This is true however, and NYT did (predictably) poor job here. Unless there is any indication that JetBrains were involved in the hack, mentioning "Russian-owned" in the title is misleading.
Well, then, suddenly all those fines on some obscure Russian (alright, alright, half-Russian) company called Google all make sense now! Just another part of the sanctions!
> Widely Used Software Company May Be Entry Point for Huge U.S. Hacking
Seems the reporter got a fair bit of flack from folks on twitter.
[1] https://twitter.com/nicoleperlroth/status/134690958021993676...
There may well have been an issue emanating from jetbrains. I don’t know.
But when you combine these insinuations with the fact that the company is run by Russian nationals (quite different from the Russian government!) you simply get stronger insinuations, not facts.
Just because a software company isn’t a household name doesn’t make it obscure.
> The characterization really, truly, does not matter.
I don't think that's a fair sentiment. Within the niche that Jetbrains occupies it is one of the most well known players out there, and so it truly is not obscure. It was an unfair characterization. Furthermore, the reporting provides no evidence to support its very damaging claim. To those of us who are familiar with configuring these types of systems, we know very well how easy it is to leave a single permission unattended to. The damage done by this type of irresponsible reporting is serious. Personally, I hope they get their pants sued off for their complete lack of discretion and disregard for journalistic integrity.
Doesn't matter. I'll repeat that it's still amazing how many programmers get shook to the core when something that seems so obviously important to them is actually not a big deal to the rest of the world.
> Furthermore [...]
Unrelated to my post :). But I hope investigations show that TeamCity was indeed misconfigured and that nothing nefarious is at play w.r.t. their tools.
Yeah, you're right. My diatribe near the end was something I had to get off my chest, but looking back there was nothing in your comment that it was responding to. I should be more mindful where I tote my baggage around, lol.
Obscure company? Ain’t that some bullshit.
Jetbrains is an obscure software company for most people, despite a number of people using their software daily.
Like "some idiot, edoceo" seeds that I'm a fool vs "my CTO, edoceo" (of course the truth is in the middle)
I wish tech reporting is written by technical folks, or at least proof read by tech experts.
This comes up for journalism of every single industry.
“Briefly stated, the Gell-Mann Amnesia effect is as follows. You open the newspaper to an article on some subject you know well. In Murray's case, physics. In mine, show business. You read the article and see the journalist has absolutely no understanding of either the facts or the issues. Often, the article is so wrong it actually presents the story backward—reversing cause and effect. I call these the "wet streets cause rain" stories. Paper's full of them.
In any case, you read with exasperation or amusement the multiple errors in a story, and then turn the page to national or international affairs, and read as if the rest of the newspaper was somehow more accurate about Palestine than the baloney you just read. You turn the page, and forget what you know.”
― Michael Crichton
Disclosure: I own a bunch of JetBrains products and love them (even though sometimes there's a lag during typing).
Really hoping I don't have to go back to Eclipse.
At this point I trust armature software developers more than commercial ones.