Skip to content

Translate information-security-with-helmet #4

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

Merged
merged 5 commits into from
Jul 28, 2018

Conversation

stanleyyylau
Copy link
Contributor

@stanleyyylau stanleyyylau commented Jul 19, 2018

翻译章节

《信息安全和质量保证——Helmet》

变更文件

  • information-security-with-helmet.json

  • information-security-with-helmet.md

翻译进度

  • 20%

  • 0%

Copy link
Contributor

@S1ngS1ng S1ngS1ng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

先谢谢你的翻译,请看一下我的 comments。

另外,如果你后续还打算继续添加翻译,本地继续弄,弄好了之后 commit,然后直接 push 到你 fork 里的这个 branch 就可以了。为什么要现在 merge

@@ -26,12 +26,12 @@
"id": "587d8247367417b2b2512c37",
"title": "Hide Potentially Dangerous Information Using helmet.hidePoweredBy()",
"description": [
"As a reminder, this project is being built upon the following starter project on <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-infosec/'>Glitch</a>, or cloned from <a href='https://github.com/freeCodeCamp/boilerplate-infosec/'>GitHub</a>.",
"Hackers can exploit known vulnerabilities in Express/Node if they see that your site is powered by Express. X-Powered-By: Express is sent in every request coming from Express by default. The helmet.hidePoweredBy() middleware will remove the X-Powered-By header. You can also explicitly set the header to something else, to throw people off. e.g. app.use(helmet.hidePoweredBy({ setTo: 'PHP 4.2.0' }))"
"温馨提醒,这个项目是建立在下面这个模版之上的 <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-infosec/'>Glitch模版地址</a>, 你也可以从 <a href='https://github.com/freeCodeCamp/boilerplate-infosec/'>GitHub</a> 上克隆。",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请注意翻译后的显示效果:
image

这样读起来就很不通顺了对吧?建议:
注意,本项目在 <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-infosec/'>这个 Glitch 项目</a> 的基础上进行开发。
或者,注意,本项目以 <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-infosec/'>这个 Glitch 项目</a> 为基础。

个人比较 prefer 第一种。

顺便,请把 Glitch 链接之后的逗号换成全角的,并删除全角符号之后的空格。对比一下:
image

"As a reminder, this project is being built upon the following starter project on <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-infosec/'>Glitch</a>, or cloned from <a href='https://github.com/freeCodeCamp/boilerplate-infosec/'>GitHub</a>.",
"Hackers can exploit known vulnerabilities in Express/Node if they see that your site is powered by Express. X-Powered-By: Express is sent in every request coming from Express by default. The helmet.hidePoweredBy() middleware will remove the X-Powered-By header. You can also explicitly set the header to something else, to throw people off. e.g. app.use(helmet.hidePoweredBy({ setTo: 'PHP 4.2.0' }))"
"温馨提醒,这个项目是建立在下面这个模版之上的 <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-infosec/'>Glitch模版地址</a>, 你也可以从 <a href='https://github.com/freeCodeCamp/boilerplate-infosec/'>GitHub</a> 上克隆。",
"黑客们可能会利用 Express/Node 的安全问题对你的网站做破坏如果他们知道你的网站是用 Express 搭建的. X-Powered-By: Express 默认情况下会被添加到所有响应的头部。不过 helmet.hidePoweredBy() 中间件可以帮你移除 X-Powered-By 头. 你甚至可以把头设置成其它的值。 如 app.use(helmet.hidePoweredBy({ setTo: 'PHP 4.2.0' }))"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

翻译时,请注意调整语序,中英文的语序习惯是不同的。
另外,注意统一全角标点

建议:如果黑客发现你的网站是用 Express 搭建的,那么他们就可以利用 Express 或 Node 现存的漏洞来攻击你的网站。

@huluoyang @wudifeixue 这里,虽然原文没有,但我觉得给 X-Powered-By: Expresshelmet.hidePoweredBy() 以及后面的 app.use 都加上 <code></code> 比较好。你们认为呢?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我觉得建议很不错,这个章节就是突出安全性的,所以隐藏 PoweredBy 是很有必要的。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stanleyyylau 你要认真看翻译规范啊,中英文的语序习惯是完全不同的。

Copy link
Contributor

@S1ngS1ng S1ngS1ng Jul 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@huluoyang

所以隐藏 PoweredBy 是很有必要的。

不会隐藏这个,加 <code></code> 的意思是改变显示的格式。

对比:
image

上面是没加 <code></code> 的效果,下面的是加了的

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

了解了,谢谢两位,后续会注意。

@huluoyang
Copy link
Contributor

huluoyang commented Jul 20, 2018

@S1ngS1ng 关于你的疑问:为什么要现在 merge?其实是提交 PR 就会自动显示 merge。
翻译指南中提倡任务分解,哪怕翻译完了一个章节的一个小节,我们也希望提交 PR 快速获得评注,如果 翻译 OK,我们应立即 Merge。这样 GitHub 才会给到翻译者一个 contribution的认可,也是一种鼓励。

刚仔细去看了 GitHub 对 contribution 的定义,只要 PR 就会给 contribution,不需要 merge。
为了减少 Review 的工作量,每个章节只允许一个 PR,该章节后续的更新都基于该 PR。

@S1ngS1ng
Copy link
Contributor

S1ngS1ng commented Jul 20, 2018

@huluoyang 我的问题不是为什么会显示 merge 😂 我是问为什么要现在合并。

我明白任务分解的必要性。但我个人的理解是,分批的前提是不同的人 work on 不同的 part。对于一个人在同一个 task 上的 work,我比较建议提交的时候 squash and merge,这样我们最后的 commit history 不会那么乱。

但你说的 contribution 确实是 make sense 的。那就这么弄吧。

顺便,我们需不需要新建一个 label,让大家可以标记 “Ready to review” 的 PR?

@S1ngS1ng S1ngS1ng added the ready for review Use when a translation (?) PR is ready for review label Jul 20, 2018
@S1ngS1ng S1ngS1ng requested a review from wudifeixue July 20, 2018 16:41
@S1ngS1ng S1ngS1ng removed the ready for review Use when a translation (?) PR is ready for review label Jul 21, 2018
@stanleyyylau
Copy link
Contributor Author

完成前三小节翻译并修正之前的错误。

@S1ngS1ng
Copy link
Contributor

@stanleyyylau 请更新,fix 一下 conflicts

@S1ngS1ng S1ngS1ng added the need update Use when a translation (?) PR has been reviewed and needs to address comments label Jul 22, 2018
@stanleyyylau
Copy link
Contributor Author

求救,我不知道在这里怎么处理冲突。我之前只处理过本地合并的冲突,在 Pull Request 里面的冲突还是没处理过。我在网上找了些资料。

https://github.com/AgileVentures/MetPlus_PETS/wiki/Resolving-Pull-Request-merge-conflicts

但是我的 Upstream 是我 Clone 的 Repo,所以我 git pull origin translate 的时候没有显示有冲突。
咋办。求救。真的没办法了。

@huluoyang
Copy link
Contributor

我已在微信单独联系你。
这里说明一点:origin 才是你 clone 的仓库,upstream 是上游仓库,translate是 默认分支。
所以你 git pull origin translate == git pull 当然没有冲突。

@huluoyang
Copy link
Contributor

Conflicting files
06-information-security-and-quality-assurance/helmetjs.json
已经很清楚了,你应该先 git remote add upstream *** ,然后 git pull upstream translate,最后在 vim 界面退出。

@stanleyyylau
Copy link
Contributor Author

stanleyyylau commented Jul 23, 2018

感谢,又学会一招。I believe it's ready to be merged now.

Copy link
Contributor

@S1ngS1ng S1ngS1ng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

看下 comments。改好之后就可以 merge 了

个人建议:
function 翻译成“函数”,method 翻译成“方法”。
其中,“方法”是绑定在对象上的函数。
@huluoyang 如果你觉得合适,可以添加到 wiki

"As a reminder, this project is being built upon the following starter project on <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-infosec/'>Glitch</a>, or cloned from <a href='https://github.com/freeCodeCamp/boilerplate-infosec/'>GitHub</a>.",
"Hackers can exploit known vulnerabilities in Express/Node if they see that your site is powered by Express. X-Powered-By: Express is sent in every request coming from Express by default. The helmet.hidePoweredBy() middleware will remove the X-Powered-By header. You can also explicitly set the header to something else, to throw people off. e.g. app.use(helmet.hidePoweredBy({ setTo: 'PHP 4.2.0' }))"
"温馨提醒,本项目在 <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-infosec/'>这个 Glitch 项目</a> 的基础上进行开发。你也可以从 <a href='https://github.com/freeCodeCamp/boilerplate-infosec/'>GitHub</a> 上克隆。",
"如果黑客发现你的网站是用 Express 搭建的,那么他们就可以利用 Express 或 Node 现存的漏洞来攻击你的网站。<code>X-Powered-By: Express</code> 默认情况下会被添加到所有响应的头部。不过 helmet.hidePoweredBy() 中间件可以帮你移除 X-Powered-By 头. 你甚至可以把头设置成其它的值。 如 <code>app.use(helmet.hidePoweredBy({ setTo: 'PHP 4.2.0' }))</code>"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

移除 X-Powered-By 头. 标点!


设置成其它的值。 如 去掉句号之后的空格。

"Your page could be put in a <frame> or <iframe> without your consent. This can result in clickjacking attacks, among other things. Clickjacking is a technique of tricking a user into interacting with a page different from what the user thinks it is. This can be obtained executing your page in a malicious context, by mean of iframing. In that context a hacker can put a hidden layer over your page. Hidden buttons can be used to run bad scripts. This middleware sets the X-Frame-Options header. It restricts who can put your site in a frame. It has three modes: DENY, SAMEORIGIN, and ALLOW-FROM.",
"We don’t need our app to be framed. You should use helmet.frameguard() passing with the configuration object {action: 'deny'}."
"温馨提醒,本项目在 <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-infosec/'>这个 Glitch 项目</a> 的基础上进行开发。你也可以从 <a href='https://github.com/freeCodeCamp/boilerplate-infosec/'>GitHub</a> 上克隆。",
"你的页面有可能会在未经你允许的情况下被放在 <frame> 或者 <iframe> 标签里面。其中一个风险就会导致 clickjacking 攻击。Clickjacking 这个小技巧可以在用户与网站 A 进行交互的时候,欺骗用户让用户以为他是在与网站 B 进行交互。通过 iframing 就可以恶意地执行你的页面。这种情况下,黑客可以在你的页面上再加一层隐藏的层。隐藏的按钮可以用来执行恶意的脚本。helmet 这个中间件可以设置 X-Frame-Options 这个头部。这样就能限制谁可以通过 iframe 引入你的页面了。 有三个模式可供配置: DENY, SAMEORIGIN, 和 ALLOW-FROM.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你的页面有可能会在未经你允许的情况下被放在 <frame> 或者 <iframe> 标签里面。其中一个风险就会导致 clickjacking 攻击。 =>
黑客可能会不经过你的允许,把你的页面嵌套在 <frame> 或者 <iframe> 标签里,用以实现“点击劫持”。

clickjacking 有翻译的,参考:https://zh.wikipedia.org/wiki/%E7%82%B9%E5%87%BB%E5%8A%AB%E6%8C%81


Clickjacking 这个小技巧可以在用户与网站 A 进行交互的时候,欺骗用户让用户以为他是在与网站 B 进行交互。 =>
点击劫持是一种视觉上的欺骗手段,让用户误以为自己在与所看到的网页交互。

这个叫“技巧”不合适吧。。 😂


通过 iframing 就可以恶意地执行你的页面。这种情况下,黑客可以在你的页面上再加一层隐藏的层。隐藏的按钮可以用来执行恶意的脚本。 =>
通过 iframe,黑客可以在你的页面上添加一个透明的“层”,然后把自己的恶意代码放在一个用户看不到的按钮中。这样一来,你的网站的执行环境就被黑客设置成了他想要的效果。

  1. “执行页面” 显然说不通
  2. 不存在 iframing 这种技术,原文那样写是出于语法考虑
  3. 我觉得 隐藏 可以换成 看不见的,因为这里强调的是用户看不到,而不是客观的“隐藏”

helmet 这个中间件可以设置 X-Frame-Options 这个头部。 去掉“这个”

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have my respect.

"We don’t need our app to be framed. You should use helmet.frameguard() passing with the configuration object {action: 'deny'}."
"温馨提醒,本项目在 <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-infosec/'>这个 Glitch 项目</a> 的基础上进行开发。你也可以从 <a href='https://github.com/freeCodeCamp/boilerplate-infosec/'>GitHub</a> 上克隆。",
"你的页面有可能会在未经你允许的情况下被放在 <frame> 或者 <iframe> 标签里面。其中一个风险就会导致 clickjacking 攻击。Clickjacking 这个小技巧可以在用户与网站 A 进行交互的时候,欺骗用户让用户以为他是在与网站 B 进行交互。通过 iframing 就可以恶意地执行你的页面。这种情况下,黑客可以在你的页面上再加一层隐藏的层。隐藏的按钮可以用来执行恶意的脚本。helmet 这个中间件可以设置 X-Frame-Options 这个头部。这样就能限制谁可以通过 iframe 引入你的页面了。 有三个模式可供配置: DENY, SAMEORIGIN, ALLOW-FROM.",
"我们不需要我们的应用被 iframe 引用。只需要 helmet.frameguard() 这个函数,然后传入配置对象 {action: 'deny'} 就可以了。"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我们不需要我们的应用被 iframe 引用。 =>
我们的应用不需要被 iframe 引用。


只需要 helmet.frameguard() 这个函数, =>
你可以调用 <code>helmet.frameguard()</code> 这个方法,


{action: 'deny'} 也建议用 <code> 包起来

"testString": "getUserInput => $.get(getUserInput('url') + '/_api/app-info').then(data => { assert.include(data.appStack, 'frameguard', 'helmet.frameguard() middleware is not mounted correctly'); }, xhr => { throw new Error(xhr.responseText); })"
},
{
"text": "helmet.frameguard() 'action' should be set to 'DENY'",
"text": "helmet.frameguard() 'action' 应该被设置成 'DENY'",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

helmet.frameguard() 'action' 应该被设置成 'DENY' =>
<code>helmet.frameguard()</code> 中的 <code>action</code> 属性的值应该为 'DENY'

@@ -67,7 +67,7 @@
"id": "587d8247367417b2b2512c39",
"title": "Mitigate the Risk of Cross Site Scripting (XSS) Attacks with helmet.xssFilter()",
"description": [
"As a reminder, this project is being built upon the following starter project on <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-infosec/'>Glitch</a>, or cloned from <a href='https://github.com/freeCodeCamp/boilerplate-infosec/'>GitHub</a>.",
"温馨提醒,本项目在 <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-infosec/'>这个 Glitch 项目</a> 的基础上进行开发。你也可以从 <a href='https://github.com/freeCodeCamp/boilerplate-infosec/'>GitHub</a> 上克隆。",
"Cross-site scripting (XSS) is a frequent type of attack where malicious scripts are injected into vulnerable pages, with the purpose of stealing sensitive data like session cookies, or passwords.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这些剩下的部分重新开 PR 吧。现在的这个 PR 就先翻译到这儿,你觉得如何?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯,可以。剩下的我翻译完再继续提 RP

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stanleyyylau 好的。有空的话,先把这个 PR 里的更新了吧。谢谢

Copy link
Contributor Author

@stanleyyylau stanleyyylau Jul 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我可能理解错你的意思了。你是指现在这个 PR 先合并,然后我继续翻译。把 helmetjs.json 全部翻译完了,然后另外再提 PR。是这个意思吗?我没太理解 “先把这个 PR 里的更新了吧” 具体是指?

Copy link
Contributor Author

@stanleyyylau stanleyyylau Jul 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@S1ngS1ng Never mind, I just saw your reviews. Will update and let you know. @huluoyang Thanks for your edit, It reads much better now.

Copy link
Contributor

@S1ngS1ng S1ngS1ng Jul 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stanleyyylau 先按 comment 更新当前的翻译(如果你觉得有必要改的话,不过标点是真的要改)。
然后你可以本地创建个新的 branch 继续弄后续的翻译,后续的翻译开个新的 PR

Copy link
Contributor Author

@stanleyyylau stanleyyylau Jul 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

了解,标点和你提的建议都改了。thanks again

@huluoyang huluoyang changed the title 完成helmet第一小节翻译 Translate information-security-with-helmetjs Jul 24, 2018
@huluoyang huluoyang changed the title Translate information-security-with-helmetjs Translate information-security-with-helmet Jul 24, 2018
@S1ngS1ng S1ngS1ng added :shipit: ship it Use when a translation (?) PR is ready for shipping and removed need update Use when a translation (?) PR has been reviewed and needs to address comments labels Jul 26, 2018
@huluoyang
Copy link
Contributor

🎉 恭喜霆霆成功完成第一个PR,Mission is impossible!

@huluoyang huluoyang merged commit a4fc342 into FreeCodeCampChina:translate Jul 28, 2018
demongodYY pushed a commit to demongodYY/challenges that referenced this pull request Jul 30, 2018
* 完成helmet第一小节翻译

* Finish 10%

* Remove IDE generated files

* Update according to comments
LynnLian pushed a commit to LynnLian/challenges that referenced this pull request Jul 30, 2018
* 完成helmet第一小节翻译

* Finish 10%

* Remove IDE generated files

* Update according to comments
S1ngS1ng added a commit to S1ngS1ng/challenges that referenced this pull request Aug 4, 2018
SSShooter pushed a commit to SSShooter/challenges that referenced this pull request Sep 7, 2018
* 完成helmet第一小节翻译

* Finish 10%

* Remove IDE generated files

* Update according to comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:shipit: ship it Use when a translation (?) PR is ready for shipping
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants