The chain of dependencies in development makes it complicated to know if you have been hacked.
So you need to be able to know:
If you use Codecov directly or indirectly;
If you have been a victim of the attack;
Which secrets have been stolen in order to change them.
1. If you use...
In order to know if you use Codecov directly, the easiest way seems to me to be to search in your source codes... if not in your documentation ๐. A big "grep -i -a -n https://codecov.io/bash" should be enough
On the other hand, to know if you are using Codecov indirectly, if it is used by a dependency that you download when building your application or installing it, you need to... build or install. Therefore, you have to deploy your different solutions completely and then look for the presence of the Codecov script. You can also look for the script on the already deployed environments. It's a long work ๐ฅ.
You also have Yara rules here: https://github.com/Neo23x0/signature-base/blob/master/yara/mal_codecov_hack.yar
If you have other ideas or techniques, feel free to reply ๐, I will complete here.
2. If you have been a victim...
In order to know if you have been a victim, you can already look for the Codecov script and if you find it, in its malicious version, then... ๐.
You can also look in your proxy logs, firewal... if the ip 104.248.94.23 has been contacted. Provided you have this type of trace ๐.
You also have Yara rules here: https://github.com/Neo23x0/signature-base/blob/master/yara/mal_codecov_hack.yar
If you have other ideas or techniques, feel free to reply ๐, I will complete here.
3. What secrets...
To find out what might have been stolen, simply run the "git remote -v" command on your software factory (CI environment) and your deployment environments where you found the malicious script.
Once you have identified what could have been stolen and on which environment, you will need to change (and revoke) api tokens, passwords...
From there... you will have to investigate again to see if these passwords, tokens... have been used, what has been accessed, stolen... and good luck to untangle the ball of potential compromises!
In the Codecov press release, I love the answer to a particular question on the FAQ:
Is it safe to use Codecov systems and services?
Yes. Codecov takes the security of its systems and data very seriously and we have implemented numerous safeguards to protect them.
Yes, of course, they weren't going to say otherwise ๐ :