TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Accidental API Key Exposure is a Major Problem

19 点作者 RossPenman超过 11 年前

7 条评论

shadesandcolour超过 11 年前
I had this same issue when I started working on a side project. I quickly decided to store the Github API secret and client id in a property list, and then access it from there in the code. The keys are never exposed in the code and that&#x27;s great. The property list file was ignored by my github repository and all was well with the world.<p>Until I started using a CI server, which would fail to compile because that file was no longer present when it was described in the project configuration. To fix this, I added a blank copy of the configuration file to the repository, committed that so that the project would compile on Travis, then ran `git update-index --assume-unchanged` to never update that file again, so that I could fill in the correct configuration data again.
sigsergv超过 11 年前
API key of any downloadable application should be considered as “public”. Removing it from public source code just makes harvesting a bit harder, but it&#x27;s still possible. So if API key of such applications is so important — it&#x27;s just a bad service design.
eponeponepon超过 11 年前
I think there are two root problems here; the first is human error&#x2F;forgetfulness, and there&#x27;s only so much you can do about that.<p>The second, which I see on a daily basis from a small number of my colleagues, is a lack of understanding about security - by way of an example, we distribute a script to commercial partners that I&#x27;ve regularly had to expunge passwords for our Subversion repo from. Trying to explain the problem to the culprit gets nowhere because &#x27;well, they can&#x27;t access the repository without using our VPN&#x27;, which of course is <i>very far from</i> the point... but nearly impossible to argue against without lecturing.
评论 #7165859 未加载
PaulHoule超过 11 年前
It&#x27;s not just a problem for &quot;open source&quot; applications, it&#x27;s a problem for &quot;closed source&quot; applications too. In a large team you don&#x27;t want to give every developer the keeps to the jeep.
justincormack超过 11 年前
Bizarre that nowhere does this article say you must invalidate the key. Lots of people could well have pulled a branch with the key, and rewriting history will make this very obvious.
评论 #7166097 未加载
评论 #7166091 未加载
ShaneCurran超过 11 年前
Nice article, Ross. This is definitely a huge issue that many developers face. I did a similar search for Twilio keys and many of those accounts had hundreds if not thousands of dollars worth of Twilio credits ready for use by a malicious attacker. It just comes to show how simple most of these mistakes are while still being very serious
tlarkworthy超过 11 年前
If you develop a API that requires a key, is there any secure way of allowing third party developers to develop client applications that use your API?<p>It seems like a malicious party could just view the source of the client app and see the key and hijack it.
评论 #7165797 未加载
评论 #7166226 未加载