-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Web 开发者安全清单 #1686
Web 开发者安全清单 #1686
Conversation
校对认领 @sqrthree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我也是第一次校对,校对地有点任性呢。只是一些小意见,仅供参考。
|
||
If you have drunk the [MVP](https://en.wikipedia.org/wiki/Minimum_viable_product) cool-aid and believe that you can create a product in one month that is both valuable and secure — think twice before you launch your “proto-product”. After you review the checklist below, acknowledge that you are skipping many of these critical security issues. At the very minimum, be *honest* with your potential users and let them know that you don’t have a complete product yet and are offering a prototype without full security. | ||
倘若你已经接受 [MVP(最小化可行产品)](https://en.wikipedia.org/wiki/Minimum_viable_product) 的开发理念,并且相信能在一个月内创造既有价值又安全的产品 —— 在发布你的“原型产品”之前请再三考虑。在你检查下面列出的安全清单后,承认你在开发过程中忽视了很多极其重要的安全问题。至少要对你潜在的用户坦诚,让他们知道你并没有真正完成产品,而仅仅只是提供没有充分考虑安全问题的原型。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
承认 => 意识到
- 如果数据库支持在休息状态进行低消耗的数据加密 (如 [AWS Aurora](https://aws.amazon.com/about-aws/whats-new/2015/12/amazon-aurora-now-supports-encryption-at-rest/)),那么请激活此功能以加强磁盘数据安全。确保所有的备份文件也都被加密存储。 | ||
- 对访问数据库的用户帐号使用最小权限原则,禁止使用数据库 root 帐号。 | ||
- 使用精心设计的密钥库存储和分发密钥,不要对应用中使用的密钥进行硬编码。 | ||
- 仅使用 SQL 预备语句以彻底阻止 SQL 注入。例如,如果使用 NPM 开发应用,连接数据库时不使用 npm-mysql ,而是使用支持预备语句的 npm-mysql2 。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
以=>就可以
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zaraguo 我认为这里不需要修改,改完意思会变成只要使用了Prepared statements就安全,而原文是说"只使用Prepared statements才能安全"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yzgyyang 我之前对这里 only 的理解有点问题,应该是你理解的这样子。
- Store and distribute secrets using a key store designed for the purpose. Don’t hard code in your applications. | ||
- Fully prevent SQL injection by only using SQL prepared statements. For example: if using NPM, don’t use npm-mysql, use npm-mysql2 which supports prepared statements. | ||
- 对识别用户身份的数据和诸如访问令牌、电子邮箱地址或账单明细等敏感数据进行加密。 | ||
- 如果数据库支持在休息状态进行低消耗的数据加密 (如 [AWS Aurora](https://aws.amazon.com/about-aws/whats-new/2015/12/amazon-aurora-now-supports-encryption-at-rest/)),那么请激活此功能以加强磁盘数据安全。确保所有的备份文件也都被加密存储。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
休息=>空闲
- Ensure all passwords are hashed using appropriate crypto such as bcrypt. Never write your own crypto and correctly initialize crypto with good random data. | ||
- Implement simple but adequate password rules that encourage users to have long, random passwords. | ||
- Use multi-factor authentication for your logins to all your service providers. | ||
- 确保所有密码都使用适当的加密算法(例如 bcrypt )进行哈希。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
确保所有密码都使用适当的加密算法(例如 bcrypt )进行哈希。
确保所有的密码都使用例如 bcrypt 之类的合适的加密算法进行哈希。
后面貌似少翻译了一句话:绝对不要使用自己写的加密算法,并且正确使用合适的随机数作为初向量。
这里的 initialize crypto 我理解为初向量不知是否正确。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
正确地使用合适的随机数初始化加密算法
- Implement simple but adequate password rules that encourage users to have long, random passwords. | ||
- Use multi-factor authentication for your logins to all your service providers. | ||
- 确保所有密码都使用适当的加密算法(例如 bcrypt )进行哈希。 | ||
- 实现简单但充分的密码规则以激励用户使用长的随机密码。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
实现=>使用
- Cookies 必须添加 httpOnly 和 secure 属性,且由属性 path 和 domain 限定作用范围。 | ||
- 使用 [CSP(内容安全策略)](https://en.wikipedia.org/wiki/Content_Security_Policy) 以禁止不安全的后门操作。策略的配置很繁琐,但是值得。 | ||
- 使用 X-Frame-Option 和 X-XSS-Protection 响应头。 | ||
- 使用 HSTS(HTTP Strict Transport Security) 响应强迫客户端仅使用 TLS 访问服务器。将所有 HTTP 请求重定向到服务器上的 HTTPS 作为后备。??? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
将所有 HTTP 请求重定向到服务器上的 HTTPS 作为后备。
同时服务端需要将所有 HTTP 请求重定向为 HTTPS。
这里的 backup 应该是支持的意思,表示要实现 HSTS 还需要服务端重定向 HTTP 请求。
- Regularly rotate passwords and access keys according to a schedule. | ||
- 确保所有服务开放最少的端口。尽管是通过模糊的安全性不受保护的,使用非标准端口将使得黑客的攻击更加困难。 | ||
- 在对任何公有网络都不可见的私有 VPC 上部署后台数据库和服务。配置 AWS 安全组和对等 VPC 务必谨慎(可能无意间使服务对外部可见)。 | ||
- 在独立的 VPC 和对等的 VPC 隔离逻辑服务,以提供内部服务交流。??? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在独立的 VPC 和对等的 VPC 隔离逻辑服务,以提供内部服务交流。
不同逻辑的服务部署在不同的 VPC 上,VPC 之间通过对等连接进行内部服务的访问。
or: 通过分离的多个 VPC 来隔离逻辑服务,VPC 之间通过对等连接进行内部服务的访问。
- 确保所有服务开放最少的端口。尽管是通过模糊的安全性不受保护的,使用非标准端口将使得黑客的攻击更加困难。 | ||
- 在对任何公有网络都不可见的私有 VPC 上部署后台数据库和服务。配置 AWS 安全组和对等 VPC 务必谨慎(可能无意间使服务对外部可见)。 | ||
- 在独立的 VPC 和对等的 VPC 隔离逻辑服务,以提供内部服务交流。??? | ||
- 确保所有服务仅接收来自最小的IP地址集合的数据。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这句这么翻译是不是有点难理解,是否可翻译为:让连接服务的 IP 地址个数竟可能的小。
- 为所有服务使用集中化的日志记录,不该再利用 SSH 访问或检索日志。 | ||
- 除了一次性诊断以外,不要使用 SSH 登录进服务。 经常使用 SSH ,意味着你还没有将执行重要任务的操作自动化。??? | ||
- 不要长期开放任何AWS服务组的22号端口。 | ||
- 创建 [immutable hosts(不可变主机)](http://chadfowler.com/2013/06/23/immutable-deployments.html) 而不是创建需要提交补丁和更新的服务器。(详情请看博客 [Immutable Infrastructure Can Be More Secure](https://simplesecurity.sensedeep.com/immutable-infrastructure-can-be-dramatically-more-secure-238f297eca49))。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
创建需要提交补丁和更新的服务器。
使用一个经过你长期提交补丁和更新产生的服务器。
- Create [immutable hosts](http://chadfowler.com/2013/06/23/immutable-deployments.html) instead of long-lived servers that you patch and upgrade. (See [Immutable Infrastructure Can Be More Secure](https://simplesecurity.sensedeep.com/immutable-infrastructure-can-be-dramatically-more-secure-238f297eca49)). | ||
- Use an [Intrusion Detection System](https://en.wikipedia.org/wiki/Intrusion_detection_system) like [SenseDeep](https://www.sensedeep.com/) or service to minimize [APTs](https://en.wikipedia.org/wiki/Advanced_persistent_threat) . | ||
- 确保在不停机的情况下对基础架构进行升级,确保以全自动的方式快速更新软件。 | ||
- 利用 Terraform 等工具创建所有的基础架构,而不是通过云端命令行窗口。基础架构应该定义为“代码”,仅需一个按钮的功夫即可重建。对云端任何亲手创建的资源零容忍 —— Terraform 能审查你的所有配置。??? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
定义为“代码”
代码化
后一句:请不要手动在云端创建资源,因为使用 Terraform 就可以通过配置自动创建它们。
@GangsterHyj @zaraguo 两位辛苦啦 |
@sqrthree 认领 |
@yzgyyang 好哒 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sqrthree @GangsterHyj 校对完成。翻译很棒!
|
||
If you have drunk the [MVP](https://en.wikipedia.org/wiki/Minimum_viable_product) cool-aid and believe that you can create a product in one month that is both valuable and secure — think twice before you launch your “proto-product”. After you review the checklist below, acknowledge that you are skipping many of these critical security issues. At the very minimum, be *honest* with your potential users and let them know that you don’t have a complete product yet and are offering a prototype without full security. | ||
倘若你已经接受 [MVP(最小化可行产品)](https://en.wikipedia.org/wiki/Minimum_viable_product) 的开发理念,并且相信能在一个月内创造既有价值又安全的产品 —— 在发布你的“原型产品”之前请再三考虑。在你检查下面列出的安全清单后,承认你在开发过程中忽视了很多极其重要的安全问题。至少要对你潜在的用户坦诚,让他们知道你并没有真正完成产品,而仅仅只是提供没有充分考虑安全问题的原型。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MVP 建议改为"最简可行产品"
- 如果数据库支持在休息状态进行低消耗的数据加密 (如 [AWS Aurora](https://aws.amazon.com/about-aws/whats-new/2015/12/amazon-aurora-now-supports-encryption-at-rest/)),那么请激活此功能以加强磁盘数据安全。确保所有的备份文件也都被加密存储。 | ||
- 对访问数据库的用户帐号使用最小权限原则,禁止使用数据库 root 帐号。 | ||
- 使用精心设计的密钥库存储和分发密钥,不要对应用中使用的密钥进行硬编码。 | ||
- 仅使用 SQL 预备语句以彻底阻止 SQL 注入。例如,如果使用 NPM 开发应用,连接数据库时不使用 npm-mysql ,而是使用支持预备语句的 npm-mysql2 。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zaraguo 我认为这里不需要修改,改完意思会变成只要使用了Prepared statements就安全,而原文是说"只使用Prepared statements才能安全"
|
||
- Ensure that all components of your software are scanned for vulnerabilities for every version pushed to production. This means O/S, libraries and packages. This should be automated into the CI-CD process. | ||
- Secure development systems with equal vigilance to what you use for production systems. Build the software from secured, isolated development systems. | ||
- 确保检查软件所有组件的每个投入生存环境使用的版本漏洞,包括操作系统、库和软件包。此操作应该以自动化的方式注入 CI/CD 过程。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议改为 "确保已经检查过软件投入生存环境使用的每个版本中所有组件的漏洞"
"注入" -> "加入"
CI/CD可以适当翻译。
- Use multi-factor authentication for your logins to all your service providers. | ||
- 确保所有密码都使用适当的加密算法(例如 bcrypt )进行哈希。 | ||
- 实现简单但充分的密码规则以激励用户使用长的随机密码。 | ||
- 使用多因素身份验证方式实现对服务提供商的登录操作。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应该是“多步验证”吧?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
维基百科是说:Multi-factor authentication (MFA) is a method of computer access control in which a user is granted access only after successfully presenting several separate pieces of evidence to an authentication mechanism – typically at least two of the following categories: knowledge (something they know), possession (something they have), and inherence (something they are).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯嗯,你是对的
- Make sure that DOS attacks on your APIs won’t cripple your site. At a minimum, have rate limiters on your slower API paths like login and token generation routines. | ||
- Enforce sanity limits on the size and structure of user submitted data and requests. | ||
- Use [Distributed Denial of Service](https://en.wikipedia.org/wiki/Denial-of-service_attack) (DDOS) mitigation via a global caching proxy service like [CloudFlare](https://www.cloudflare.com/). This can be turned on if you suffer a DDOS attack and otherwise function as your DNS lookup. | ||
- 确保对 API 进行 DOS 攻击不会让你的网站崩溃。至少在执行时间较长的 API 路径(例如登录、令牌生成等程序)使用速度限制器。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rate应该指使用频率?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
其实应该是速率限制器- - 速度限制的话就有歧义了...
|
||
### **Web Traffic** ### | ||
### **网络交通** ### |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
网络流量
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
额,其实刚开始我也是想翻译成流量的,但是我觉得里面的内容并不是讲流量、而是传输相关的,所以翻译成了交通...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 确保在不停机的情况下对基础架构进行升级,确保以全自动的方式快速更新软件。 | ||
- 利用 Terraform 等工具创建所有的基础架构,而不是通过云端命令行窗口。基础架构应该定义为“代码”,仅需一个按钮的功夫即可重建。对云端任何亲手创建的资源零容忍 —— Terraform 能审查你的所有配置。??? | ||
- 为所有服务使用集中化的日志记录,不该再利用 SSH 访问或检索日志。 | ||
- 除了一次性诊断以外,不要使用 SSH 登录进服务。 经常使用 SSH ,意味着你还没有将执行重要任务的操作自动化。??? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
。???
@GangsterHyj 两位校对者都已经校对好了~ 可以来根据校对意见进行调整了哈 ┏ (゜ω゜)=☞ |
- Use [Distributed Denial of Service](https://en.wikipedia.org/wiki/Denial-of-service_attack) (DDOS) mitigation via a global caching proxy service like [CloudFlare](https://www.cloudflare.com/). This can be turned on if you suffer a DDOS attack and otherwise function as your DNS lookup. | ||
- 确保对 API 进行 DOS 攻击不会让你的网站崩溃。至少在执行时间较长的 API 路径(例如登录、令牌生成等程序)使用速度限制器。 | ||
- 对用户提交的数据和请求在大小和结构上增强完整性限制。 | ||
- 通过类似 [CloudFlare](https://www.cloudflare.com/) 的全局缓存代理服务应用缓解 [Distributed Denial of Service](https://en.wikipedia.org/wiki/Denial-of-service_attack) (DDOS)对网站带来的影响。如果你遭受 DDOS 攻击,或者用于 DNS 查找,可以考虑开启此服务。??? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CloudFlare 可以用来防微小的 DDOS。
所以不是 缓解 DDOS 对网站带来的影响 ?
@sqrthree 根据校对意见修改。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
辛苦啦~
@@ -5,96 +5,97 @@ | |||
> * 校对者: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
译者和校对者的信息可以加一下哈~ 可以参考其他文章的做法。
@GangsterHyj 已经 merge 啦~ 快快麻溜发布到掘金专栏然后给我发下链接,方便及时添加积分哟。 |
这是小弟第一次翻译文章,有点紧张。
这篇文章的专业术语好多...翻译有一些地方求各位大佬一起探讨。
打???的地方都是个人觉得翻译得不太好但不知道怎么表达才好的= =...