chore(i18n,curriculum): update translations (#43033)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 587d8248367417b2b2512c3c
|
||||
title: Ask Browsers to Access Your Site via HTTPS Only with helmet.hsts()
|
||||
title: Pedir aos navegadores que acessem seu site somente via HTTPS com helmet.hsts()
|
||||
challengeType: 2
|
||||
forumTopicId: 301573
|
||||
dashedName: ask-browsers-to-access-your-site-via-https-only-with-helmet-hsts
|
||||
@@ -8,19 +8,19 @@ dashedName: ask-browsers-to-access-your-site-via-https-only-with-helmet-hsts
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on [Replit](https://replit.com/github/freeCodeCamp/boilerplate-infosec), or cloned from [GitHub](https://github.com/freeCodeCamp/boilerplate-infosec/).
|
||||
Lembrando que este projeto está sento construído a partir do [Replit](https://replit.com/github/freeCodeCamp/boilerplate-infosec), ou pose ser clonado no [GitHub](https://github.com/freeCodeCamp/boilerplate-infosec/).
|
||||
|
||||
HTTP Strict Transport Security (HSTS) is a web security policy which helps to protect websites against protocol downgrade attacks and cookie hijacking. If your website can be accessed via HTTPS you can ask user’s browsers to avoid using insecure HTTP. By setting the header Strict-Transport-Security, you tell the browsers to use HTTPS for the future requests in a specified amount of time. This will work for the requests coming after the initial request.
|
||||
HTTP Strict Transport Security (HSTS) é uma política de segurança na web que ajuda a proteger sites contra ataques com protocolo rebaixado e sequestro de cookies. Se seu site puder ser acessado via HTTPS, você pode pedir aos navegadores do usuário que evitem o uso de HTTP não seguro. Ao definir o cabeçalho Strict-Transport-Security, você avisa aos navegadores para usar HTTPS para futuras solicitações em um período de tempo específico. Isso funcionará para as solicitações que chegarem após o pedido inicial.
|
||||
|
||||
# --instructions--
|
||||
|
||||
Configure `helmet.hsts()` to use HTTPS for the next 90 days. Pass the config object `{maxAge: timeInSeconds, force: true}`. You can create a variable `ninetyDaysInSeconds = 90*24*60*60;` to use for the `timeInSeconds`. Replit already has hsts enabled. To override its settings you need to set the field "force" to true in the config object. We will intercept and restore the Replit header, after inspecting it for testing.
|
||||
Configure `helmet.hsts()` para usar HTTPS pelos próximos 90 dias. Passe o objeto de configuração `{maxAge: timeInSeconds, force: true}`. Você pode criar uma variável `ninetyDaysInSeconds = 90*24*60*60;` para usar para `timeInSeconds`. O Replit já tem uma versão hsts habilitada. Para sobrescrever suas configurações, você precisa definir o campo "force" como true no objeto de configuração. Nós vamos interceptar e restaurar o cabeçalho do Replit, depois de inspecioná-lo para testes.
|
||||
|
||||
Note: Configuring HTTPS on a custom website requires the acquisition of a domain, and a SSL/TLS Certificate.
|
||||
Observação: a configuração de HTTPS em um site personalizado requer a aquisição de um domínio e um certificado SSL/TLS.
|
||||
|
||||
# --hints--
|
||||
|
||||
helmet.hsts() middleware should be mounted correctly
|
||||
O middleware helmet.hsts() deve ser montado corretamente
|
||||
|
||||
```js
|
||||
(getUserInput) =>
|
||||
@@ -35,7 +35,7 @@ helmet.hsts() middleware should be mounted correctly
|
||||
);
|
||||
```
|
||||
|
||||
maxAge should be equal to 7776000 s (90 days)
|
||||
A propriedade maxAge deve ser igual a 7776000 s (90 dias)
|
||||
|
||||
```js
|
||||
(getUserInput) =>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 587d8248367417b2b2512c3a
|
||||
title: Avoid Inferring the Response MIME Type with helmet.noSniff()
|
||||
title: Evitar inferências da resposta de MIME Type com helmet.noSniff()
|
||||
challengeType: 2
|
||||
forumTopicId: 301574
|
||||
dashedName: avoid-inferring-the-response-mime-type-with-helmet-nosniff
|
||||
@@ -8,15 +8,15 @@ dashedName: avoid-inferring-the-response-mime-type-with-helmet-nosniff
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on [Replit](https://replit.com/github/freeCodeCamp/boilerplate-infosec), or cloned from [GitHub](https://github.com/freeCodeCamp/boilerplate-infosec/). Browsers can use content or MIME sniffing to override response `Content-Type` headers to guess and process the data using an implicit content type. While this can be convenient in some scenarios, it can also lead to some dangerous attacks. This middleware sets the X-Content-Type-Options header to `nosniff`, instructing the browser to not bypass the provided `Content-Type`.
|
||||
Lembrando que este projeto está sento construído a partir do [Replit](https://replit.com/github/freeCodeCamp/boilerplate-infosec), ou pose ser clonado no [GitHub](https://github.com/freeCodeCamp/boilerplate-infosec/). Os navegadores podem usar detecção de conteúdo ou de MIME para substituir os cabeçalhos de resposta `Content-Type` de modo a adivinhar e processar os dados usando um tipo de conteúdo implícito. Embora isso possa ser conveniente em alguns cenários, também pode levar a alguns ataques perigosos. Este middleware define o cabeçalho X-Content-Type-Options para `nosniff`, instruindo o navegador a não ignorar o `Content-Type` fornecido.
|
||||
|
||||
# --instructions--
|
||||
|
||||
Use the `helmet.noSniff()` method on your server.
|
||||
Use o método `helmet.noSniff()` no seu servidor.
|
||||
|
||||
# --hints--
|
||||
|
||||
helmet.noSniff() middleware should be mounted correctly
|
||||
O middleware helmet.noSniff() deve ser montado corretamente
|
||||
|
||||
```js
|
||||
(getUserInput) =>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 587d8249367417b2b2512c40
|
||||
title: Configure Helmet Using the ‘parent’ helmet() Middleware
|
||||
title: Configurar o Helmet usando o middleware 'pai' helmet()
|
||||
challengeType: 2
|
||||
forumTopicId: 301575
|
||||
dashedName: configure-helmet-using-the-parent-helmet-middleware
|
||||
@@ -8,11 +8,11 @@ dashedName: configure-helmet-using-the-parent-helmet-middleware
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on [Replit](https://replit.com/github/freeCodeCamp/boilerplate-infosec), or cloned from [GitHub](https://github.com/freeCodeCamp/boilerplate-infosec/).
|
||||
Lembrando que este projeto está sento construído a partir do [Replit](https://replit.com/github/freeCodeCamp/boilerplate-infosec), ou pose ser clonado no [GitHub](https://github.com/freeCodeCamp/boilerplate-infosec/).
|
||||
|
||||
`app.use(helmet())` will automatically include all the middleware introduced above, except `noCache()`, and `contentSecurityPolicy()`, but these can be enabled if necessary. You can also disable or configure any other middleware individually, using a configuration object.
|
||||
`app.use(helmet())` incluirá automaticamente todo o middleware apresentado acima, exceto `noCache()` e `contentSecurityPolicy()`, mas estes podem ser habilitados, se necessário. Você também pode desativar ou configurar qualquer outro middleware individualmente, usando um objeto de configuração.
|
||||
|
||||
**Example:**
|
||||
**Exemplo:**
|
||||
|
||||
```js
|
||||
app.use(helmet({
|
||||
@@ -29,11 +29,11 @@ app.use(helmet({
|
||||
}))
|
||||
```
|
||||
|
||||
We introduced each middleware separately for teaching purposes and for ease of testing. Using the ‘parent’ `helmet()` middleware is easy to implement in a real project.
|
||||
Apresentamos cada middleware separadamente para fins didáticos e para facilitar os testes. Usar o middleware 'pai' `helmet()` é de fácil implementação em um projeto real.
|
||||
|
||||
# --hints--
|
||||
|
||||
no tests - it's a descriptive challenge
|
||||
sem testes - esse é um desafio descritivo
|
||||
|
||||
```js
|
||||
assert(true);
|
||||
|
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 587d8249367417b2b2512c3e
|
||||
title: Disable Client-Side Caching with helmet.noCache()
|
||||
title: Desativar o cache do lado do client com helmet.noCache()
|
||||
challengeType: 2
|
||||
forumTopicId: 301576
|
||||
dashedName: disable-client-side-caching-with-helmet-nocache
|
||||
@@ -8,17 +8,17 @@ dashedName: disable-client-side-caching-with-helmet-nocache
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on [Replit](https://replit.com/github/freeCodeCamp/boilerplate-infosec), or cloned from [GitHub](https://github.com/freeCodeCamp/boilerplate-infosec/).
|
||||
Lembrando que este projeto está sento construído a partir do [Replit](https://replit.com/github/freeCodeCamp/boilerplate-infosec), ou pose ser clonado no [GitHub](https://github.com/freeCodeCamp/boilerplate-infosec/).
|
||||
|
||||
If you are releasing an update for your website, and you want the users to always download the newer version, you can (try to) disable caching on client’s browser. It can be useful in development too. Caching has performance benefits, which you will lose, so only use this option when there is a real need.
|
||||
Se estiver lançando uma atualização para o seu site, e quiser que os usuários façam o download da versão mais recente, você pode (tentar) desabilitar o cache no navegador do client. Isso também pode ser útil para o desenvolvimento. O caching tem benefícios de desempenho, que você vai perder. Então, use esta opção apenas quando houver uma necessidade real.
|
||||
|
||||
# --instructions--
|
||||
|
||||
Use the `helmet.noCache()` method on your server.
|
||||
Use o método `helmet.noCache()` no seu servidor.
|
||||
|
||||
# --hints--
|
||||
|
||||
helmet.noCache() middleware should be mounted correctly
|
||||
O middleware helmet.noCache() deve ser montado corretamente
|
||||
|
||||
```js
|
||||
(getUserInput) =>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 587d8248367417b2b2512c3d
|
||||
title: Disable DNS Prefetching with helmet.dnsPrefetchControl()
|
||||
title: Desativar o DNS Prefetching com helmet.dnsPrefetchControl()
|
||||
challengeType: 2
|
||||
forumTopicId: 301577
|
||||
dashedName: disable-dns-prefetching-with-helmet-dnsprefetchcontrol
|
||||
@@ -8,17 +8,17 @@ dashedName: disable-dns-prefetching-with-helmet-dnsprefetchcontrol
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on [Replit](https://replit.com/github/freeCodeCamp/boilerplate-infosec), or cloned from [GitHub](https://github.com/freeCodeCamp/boilerplate-infosec/).
|
||||
Lembrando que este projeto está sento construído a partir do [Replit](https://replit.com/github/freeCodeCamp/boilerplate-infosec), ou pose ser clonado no [GitHub](https://github.com/freeCodeCamp/boilerplate-infosec/).
|
||||
|
||||
To improve performance, most browsers prefetch DNS records for the links in a page. In that way the destination ip is already known when the user clicks on a link. This may lead to over-use of the DNS service (if you own a big website, visited by millions people…), privacy issues (one eavesdropper could infer that you are on a certain page), or page statistics alteration (some links may appear visited even if they are not). If you have high security needs you can disable DNS prefetching, at the cost of a performance penalty.
|
||||
Para melhorar o desempenho, a maioria dos navegadores registra antes do fetching o DNS dos links de uma página. Desta maneira, o IP de destino já é conhecido quando o usuário clica em um link. Isso pode levar a um uso excessivo do serviço de DNS (se você possui um site grande, visitado por milhões de pessoas…), problemas de privacidade (uma escuta pode inferir que você está em uma determinada página), ou em alterações das estatísticas da página (alguns links podem aparecer visitados, mesmo que não sejam). Se você tem elevadas necessidades de segurança, pode desativar a pré-busca de DNS, ao custo de uma penalização de desempenho.
|
||||
|
||||
# --instructions--
|
||||
|
||||
Use the `helmet.dnsPrefetchControl()` method on your server.
|
||||
Use o método `helmet.dnsPrefetchControl()` no seu servidor.
|
||||
|
||||
# --hints--
|
||||
|
||||
helmet.dnsPrefetchControl() middleware should be mounted correctly
|
||||
O middleware helmet.dnsPrefetchControl() deve ser montado corretamente
|
||||
|
||||
```js
|
||||
(getUserInput) =>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 58a25bcff9fc0f352b528e7d
|
||||
title: Hash and Compare Passwords Asynchronously
|
||||
title: Fazer o hash e comparar senhas de modo assíncrono
|
||||
challengeType: 2
|
||||
forumTopicId: 301578
|
||||
dashedName: hash-and-compare-passwords-asynchronously
|
||||
@@ -8,9 +8,9 @@ dashedName: hash-and-compare-passwords-asynchronously
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on [Replit](https://replit.com/github/freeCodeCamp/boilerplate-bcrypt), or cloned from [GitHub](https://github.com/freeCodeCamp/boilerplate-bcrypt/).
|
||||
Lembrando que este projeto está sento construído a partir do [Replit](https://replit.com/github/freeCodeCamp/boilerplate-bcrypt), ou pose ser clonado no [GitHub](https://github.com/freeCodeCamp/boilerplate-bcrypt/).
|
||||
|
||||
As hashing is designed to be computationally intensive, it is recommended to do so asynchronously on your server as to avoid blocking incoming connections while you hash. All you have to do to hash a password asynchronous is call
|
||||
Como o hashing é projetado para ser computacionalmente intensivo, é recomendável fazê-lo de maneira assíncrona em seu servidor para evitar o bloqueio de conexões de entrada enquanto você faz o hash. Tudo o que você precisa fazer para fazer o hash de uma senha de modo assíncrona é a chamada
|
||||
|
||||
```js
|
||||
bcrypt.hash(myPlaintextPassword, saltRounds, (err, hash) => {
|
||||
@@ -20,9 +20,9 @@ bcrypt.hash(myPlaintextPassword, saltRounds, (err, hash) => {
|
||||
|
||||
# --instructions--
|
||||
|
||||
Add this hashing function to your server(we've already defined the variables used in the function for you to use) and log it to the console for you to see! At this point you would normally save the hash to your database.
|
||||
Adicione esta função de hashing ao seu servidor (nós já definimos as variáveis usadas na função para você usar) e registramos no console para você ver! Neste momento, você normalmente salvaria o hash no seu banco de dados.
|
||||
|
||||
Now when you need to figure out if a new input is the same data as the hash you would just use the compare function.
|
||||
Agora, quando você precisar descobrir se uma nova entrada é a mesma que o hash, você usaria a função de comparação.
|
||||
|
||||
```js
|
||||
bcrypt.compare(myPlaintextPassword, hash, (err, res) => {
|
||||
@@ -30,7 +30,7 @@ bcrypt.compare(myPlaintextPassword, hash, (err, res) => {
|
||||
});
|
||||
```
|
||||
|
||||
Add this into your existing hash function(since you need to wait for the hash to complete before calling the compare function) after you log the completed hash and log 'res' to the console within the compare. You should see in the console a hash then 'true' is printed! If you change 'myPlaintextPassword' in the compare function to 'someOtherPlaintextPassword' then it should say false.
|
||||
Adicione isso à sua função de hash existente (já que você precisa esperar que o hash termine antes de chamar a função de comparação) depois de registrar o hash completo e registra 'res' para o console dentro da comparação. Você deve ver um hash no console. Em seguida, 'true' é impresso! Se você mudar 'myPlaintextPassword' na função de comparação para 'someOtherPlaintextPassword', então ela deve dizer false.
|
||||
|
||||
```js
|
||||
bcrypt.hash('passw0rd!', 13, (err, hash) => {
|
||||
@@ -43,11 +43,11 @@ bcrypt.hash('passw0rd!', 13, (err, hash) => {
|
||||
|
||||
```
|
||||
|
||||
Submit your page when you think you've got it right.
|
||||
Envie sua página quando você achar que ela está certa.
|
||||
|
||||
# --hints--
|
||||
|
||||
Async hash should be generated and correctly compared.
|
||||
O hash assíncrono deve ser gerado e comparado corretamente.
|
||||
|
||||
```js
|
||||
(getUserInput) =>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 58a25bcff9fc0f352b528e7e
|
||||
title: Hash and Compare Passwords Synchronously
|
||||
title: Fazer o hash e comparar senhas de modo síncrono
|
||||
challengeType: 2
|
||||
forumTopicId: 301579
|
||||
dashedName: hash-and-compare-passwords-synchronously
|
||||
@@ -8,31 +8,31 @@ dashedName: hash-and-compare-passwords-synchronously
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on [Replit](https://replit.com/github/freeCodeCamp/boilerplate-bcrypt), or cloned from [GitHub](https://github.com/freeCodeCamp/boilerplate-bcrypt/).
|
||||
Lembrando que este projeto está sento construído a partir do [Replit](https://replit.com/github/freeCodeCamp/boilerplate-bcrypt), ou pose ser clonado no [GitHub](https://github.com/freeCodeCamp/boilerplate-bcrypt/).
|
||||
|
||||
Hashing synchronously is just as easy to do but can cause lag if using it server side with a high cost or with hashing done very often. Hashing with this method is as easy as calling
|
||||
Fazer o hashing de forma síncrona é muito fácil de fazer, mas pode causar lag ao usar o lado do servidor com um alto custo ou com o hashing sendo feito com muita frequência. Com este método, o hashing é tão fácil quanto fazer chamadas
|
||||
|
||||
```js
|
||||
var hash = bcrypt.hashSync(myPlaintextPassword, saltRounds);
|
||||
```
|
||||
|
||||
Add this method of hashing to your code and then log the result to the console. Again, the variables used are already defined in the server so you won't need to adjust them. You may notice even though you are hashing the same password as in the async function, the result in the console is different- this is due to the salt being randomly generated each time as seen by the first 22 characters in the third string of the hash. Now to compare a password input with the new sync hash, you would use the compareSync method:
|
||||
Adicione este método de hashing ao seu código e, em seguida, registre o resultado no console. Mais uma vez, as variáveis usadas já estão definidas no servidor para que você não precise ajustá-las. Você pode perceber que, apesar de estar fazendo o hashing da mesma senha que na função async, o resultado no console é diferente - isso é devido ao salt gerado aleatoriamente em cada vez, conforme vimos em função dos primeiros 22 caracteres na terceira sequência de hash. Agora, para comparar uma entrada de senha com o novo hash de sincronização, você usaria o método compareSync:
|
||||
|
||||
```js
|
||||
var result = bcrypt.compareSync(myPlaintextPassword, hash);
|
||||
```
|
||||
|
||||
with the result being a boolean true or false.
|
||||
com o resultado sendo um booleano true ou false.
|
||||
|
||||
# --instructions--
|
||||
|
||||
Add the function in and log the result to the console to see it working.
|
||||
Adicione a função e registre o resultado no console para vê-la funcionando.
|
||||
|
||||
Submit your page when you think you've got it right.
|
||||
Envie sua página quando você achar que ela está certa.
|
||||
|
||||
# --hints--
|
||||
|
||||
Sync hash should be generated and correctly compared.
|
||||
O hash de sincronização deve ser gerado e comparado corretamente.
|
||||
|
||||
```js
|
||||
(getUserInput) =>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 587d8247367417b2b2512c37
|
||||
title: Hide Potentially Dangerous Information Using helmet.hidePoweredBy()
|
||||
title: Esconder informações potencialmente perigosas usando o helmet.hidePoweredBy()
|
||||
challengeType: 2
|
||||
forumTopicId: 301580
|
||||
dashedName: hide-potentially-dangerous-information-using-helmet-hidepoweredby
|
||||
@@ -8,13 +8,13 @@ dashedName: hide-potentially-dangerous-information-using-helmet-hidepoweredby
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on [Replit](https://replit.com/github/freeCodeCamp/boilerplate-infosec), or cloned from [GitHub](https://github.com/freeCodeCamp/boilerplate-infosec/).
|
||||
Lembrando que este projeto está sento construído a partir do [Replit](https://replit.com/github/freeCodeCamp/boilerplate-infosec), ou pose ser clonado no [GitHub](https://github.com/freeCodeCamp/boilerplate-infosec/).
|
||||
|
||||
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. Use the `helmet.hidePoweredBy()` middleware to remove the X-Powered-By header.
|
||||
Os hackers podem explorar vulnerabilidades conhecidas no Express/Node se verem que seu site usa o Express. `X-Powered-By: Express` é enviado em todas as solicitações vindas do Express por padrão. Use o middleware `helmet.hidePoweredBy()` para remover o cabeçalho X-Powered-By.
|
||||
|
||||
# --hints--
|
||||
|
||||
helmet.hidePoweredBy() middleware should be mounted correctly
|
||||
O middleware helmet.hidePoweredBy() deve ser montado corretamente
|
||||
|
||||
```js
|
||||
(getUserInput) =>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 587d8247367417b2b2512c36
|
||||
title: Install and Require Helmet
|
||||
title: Instalar e solicitar o Helmet
|
||||
challengeType: 2
|
||||
forumTopicId: 301581
|
||||
dashedName: install-and-require-helmet
|
||||
@@ -8,25 +8,25 @@ dashedName: install-and-require-helmet
|
||||
|
||||
# --description--
|
||||
|
||||
Working on these challenges will involve you writing your code using one of the following methods:
|
||||
Trabalhar nesses desafios irá fazer com que você escreva seu código usando um dos seguintes métodos:
|
||||
|
||||
- Clone [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-infosec/) and complete these challenges locally.
|
||||
- Use [our Replit starter project](https://replit.com/github/freeCodeCamp/boilerplate-infosec) to complete these challenges.
|
||||
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.
|
||||
- Clone [este repositório do GitHub](https://github.com/freeCodeCamp/boilerplate-infosec/) e complete esses desafios localmente.
|
||||
- Use [nosso projeto inicial do Replit](https://replit.com/github/freeCodeCamp/boilerplate-infosec) para completar esses desafios.
|
||||
- Use um construtor de site de sua escolha para completar o projeto. Certifique-se de incorporar todos os arquivos do nosso repositório no GitHub.
|
||||
|
||||
When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the `Solution Link` field.
|
||||
Quando terminar, certifique-se de que uma demonstração funcional do seu projeto está hospedada em algum lugar público. Em seguida, envie o URL para ela no campo `Solution Link`.
|
||||
|
||||
Helmet helps you secure your Express apps by setting various HTTP headers.
|
||||
O Helmet ajuda você a proteger seus aplicativos do Express, definindo vários cabeçalhos HTTP.
|
||||
|
||||
# --instructions--
|
||||
|
||||
All your code for these lessons goes in the `myApp.js` file between the lines of code we have started you off with. Do not change or delete the code we have added for you.
|
||||
Todo o código para estas aulas vai para o arquivo `myApp.js` entre as linhas de código que fornecemos para você começar. Não altere nem exclua o código que adicionamos para você.
|
||||
|
||||
Install Helmet version `3.21.3`, then require it. You can install a specific version of a package with `npm install --save-exact package@version`, or by adding it to your `package.json` directly.
|
||||
Instale a versão `3.21.3` do Helmet e, em seguida, solicite-a. Você pode instalar uma versão específica de um pacote com o `npm install --save-exact package@version` ou adicionando-a ao seu `package.json` diretamente.
|
||||
|
||||
# --hints--
|
||||
|
||||
`helmet` version `3.21.3` should be in `package.json`
|
||||
A versão do `helmet` `3.21.3` deve estar no `package.json`
|
||||
|
||||
```js
|
||||
(getUserInput) =>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 587d8247367417b2b2512c38
|
||||
title: Mitigate the Risk of Clickjacking with helmet.frameguard()
|
||||
title: Reduzir o risco de clickjacking com o helmet.frameguard()
|
||||
challengeType: 2
|
||||
forumTopicId: 301582
|
||||
dashedName: mitigate-the-risk-of-clickjacking-with-helmet-frameguard
|
||||
@@ -8,19 +8,19 @@ dashedName: mitigate-the-risk-of-clickjacking-with-helmet-frameguard
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on [Replit](https://replit.com/github/freeCodeCamp/boilerplate-infosec), or cloned from [GitHub](https://github.com/freeCodeCamp/boilerplate-infosec/).
|
||||
Lembrando que este projeto está sento construído a partir do [Replit](https://replit.com/github/freeCodeCamp/boilerplate-infosec), ou pose ser clonado no [GitHub](https://github.com/freeCodeCamp/boilerplate-infosec/).
|
||||
|
||||
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.
|
||||
Sua página pode ser colocada em um `<frame>` ou `<iframe>` sem o seu consentimento. Isso pode resultar em ataques de clickjacking, entre outras coisas. Clickjacking é uma técnica de enganar um usuário para que ele interaja com uma página diferente da que o usuário pensa que é. Isso pode ser feito ao executar sua página em um contexto malicioso, por meio de iframing. Nesse contexto, um hacker pode colocar uma camada oculta sobre sua página. Botões ocultos podem ser usados para executar scripts maliciosos. Este middleware define o cabeçalho X-Frame-Options. Ele restringe quem pode colocar seu site em um frame. Ele tem três modos: DENY, SAMEORIGIN, e ALLOW-FROM.
|
||||
|
||||
We don’t need our app to be framed.
|
||||
Não precisamos que nosso aplicativo seja posto em um frame.
|
||||
|
||||
# --instructions--
|
||||
|
||||
Use `helmet.frameguard()` passing with the configuration object `{action: 'deny'}`.
|
||||
Use `helmet.frameguard()` passando o objeto de configuração `{action: 'deny'}`.
|
||||
|
||||
# --hints--
|
||||
|
||||
helmet.frameguard() middleware should be mounted correctly
|
||||
O middleware helmet.frameguard() deve ser montado corretamente
|
||||
|
||||
```js
|
||||
(getUserInput) =>
|
||||
@@ -38,7 +38,7 @@ helmet.frameguard() middleware should be mounted correctly
|
||||
);
|
||||
```
|
||||
|
||||
helmet.frameguard() 'action' should be set to 'DENY'
|
||||
A 'action' do helmet.frameguard() deve ser definida como 'DENY'
|
||||
|
||||
```js
|
||||
(getUserInput) =>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
---
|
||||
id: 587d8247367417b2b2512c39
|
||||
title: >-
|
||||
Mitigate the Risk of Cross Site Scripting (XSS) Attacks with helmet.xssFilter()
|
||||
Reduzir o risco de ataques de Cross Site Scripting (XSS) com o helmet.xssFilter()
|
||||
challengeType: 2
|
||||
forumTopicId: 301583
|
||||
dashedName: mitigate-the-risk-of-cross-site-scripting-xss-attacks-with-helmet-xssfilter
|
||||
@@ -9,23 +9,23 @@ dashedName: mitigate-the-risk-of-cross-site-scripting-xss-attacks-with-helmet-xs
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on [Replit](https://replit.com/github/freeCodeCamp/boilerplate-infosec), or cloned from [GitHub](https://github.com/freeCodeCamp/boilerplate-infosec/).
|
||||
Lembrando que este projeto está sento construído a partir do [Replit](https://replit.com/github/freeCodeCamp/boilerplate-infosec), ou pose ser clonado no [GitHub](https://github.com/freeCodeCamp/boilerplate-infosec/).
|
||||
|
||||
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.
|
||||
O cross-site scripting (XSS) é um tipo frequente de ataque, onde scripts maliciosos são injetados em páginas vulneráveis com o objetivo de roubar dados confidenciais, como cookies de sessão ou senhas.
|
||||
|
||||
The basic rule to lower the risk of an XSS attack is simple: “Never trust user’s input”. As a developer you should always sanitize all the input coming from the outside. This includes data coming from forms, GET query urls, and even from POST bodies. Sanitizing means that you should find and encode the characters that may be dangerous e.g. <, >.
|
||||
A regra básica para diminuir o risco de um ataque de XSS é simples: "Nunca confie na entrada do usuário". Como desenvolvedor, você deve sempre sanitizar todas as entradas vindas de fora. Isso inclui dados provenientes de formulários, URLs de consultas GET e até mesmo de bodies com POST. Sanitizar significa encontrar e codificar os caracteres que podem ser perigosos, como <, >.
|
||||
|
||||
Modern browsers can help mitigating the risk by adopting better software strategies. Often these are configurable via http headers.
|
||||
Navegadores modernos podem ajudar a reduzir o risco, adotando melhores estratégias de software. Elas muitas vezes são configuráveis através de cabeçalhos de http.
|
||||
|
||||
The X-XSS-Protection HTTP header is a basic protection. The browser detects a potential injected script using a heuristic filter. If the header is enabled, the browser changes the script code, neutralizing it. It still has limited support.
|
||||
O cabeçalho de HTTP X-XSS-Protection é uma proteção básica. O navegador detecta um script potencialmente injetado usando um filtro heurístico. Se o cabeçalho estiver ativado, o navegador altera o código de script, neutralizando-o. Ele ainda tem um suporte limitado.
|
||||
|
||||
# --instructions--
|
||||
|
||||
Use `helmet.xssFilter()` to sanitize input sent to your server.
|
||||
Use `helmet.xssFilter()` para sanitizar a entrada enviada para o servidor.
|
||||
|
||||
# --hints--
|
||||
|
||||
helmet.xssFilter() middleware should be mounted correctly
|
||||
O middleware helmet.xssFilter() deve ser montado corretamente
|
||||
|
||||
```js
|
||||
(getUserInput) =>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 587d8248367417b2b2512c3b
|
||||
title: Prevent IE from Opening Untrusted HTML with helmet.ieNoOpen()
|
||||
title: Impedir que o IE abra HTML não confiável com helmet.ieNoOpen()
|
||||
challengeType: 2
|
||||
forumTopicId: 301584
|
||||
dashedName: prevent-ie-from-opening-untrusted-html-with-helmet-ienoopen
|
||||
@@ -8,17 +8,17 @@ dashedName: prevent-ie-from-opening-untrusted-html-with-helmet-ienoopen
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on [Replit](https://replit.com/github/freeCodeCamp/boilerplate-infosec), or cloned from [GitHub](https://github.com/freeCodeCamp/boilerplate-infosec/).
|
||||
Lembrando que este projeto está sento construído a partir do [Replit](https://replit.com/github/freeCodeCamp/boilerplate-infosec), ou pose ser clonado no [GitHub](https://github.com/freeCodeCamp/boilerplate-infosec/).
|
||||
|
||||
Some web applications will serve untrusted HTML for download. Some versions of Internet Explorer by default open those HTML files in the context of your site. This means that an untrusted HTML page could start doing bad things in the context of your pages. This middleware sets the X-Download-Options header to noopen. This will prevent IE users from executing downloads in the trusted site’s context.
|
||||
Alguns aplicativos da web servirão HTML não confiável para download. Algumas versões do Internet Explorer abrem esses arquivos HTML no contexto do seu site. Isto significa que uma página HTML não confiável pode começar a fazer coisas ruins no contexto de suas páginas. Este middleware define o cabeçalho X-Download-Options como noopen. Isto impedirá que usuários do IE executem downloads no contexto dos sites confiáveis.
|
||||
|
||||
# --instructions--
|
||||
|
||||
Use the `helmet.ieNoOpen()` method on your server.
|
||||
Use o método `helmet.ieNoOpen()` no seu servidor.
|
||||
|
||||
# --hints--
|
||||
|
||||
helmet.ieNoOpen() middleware should be mounted correctly
|
||||
O middleware helmet.ieNoOpen() deve ser montado corretamente
|
||||
|
||||
```js
|
||||
(getUserInput) =>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 587d8249367417b2b2512c3f
|
||||
title: Set a Content Security Policy with helmet.contentSecurityPolicy()
|
||||
title: Definir uma política de segurança de conteúdo com helmet.contentSecurityPolicy()
|
||||
challengeType: 2
|
||||
forumTopicId: 301585
|
||||
dashedName: set-a-content-security-policy-with-helmet-contentsecuritypolicy
|
||||
@@ -8,21 +8,21 @@ dashedName: set-a-content-security-policy-with-helmet-contentsecuritypolicy
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on [Replit](https://replit.com/github/freeCodeCamp/boilerplate-infosec), or cloned from [GitHub](https://github.com/freeCodeCamp/boilerplate-infosec/).
|
||||
Lembrando que este projeto está sento construído a partir do [Replit](https://replit.com/github/freeCodeCamp/boilerplate-infosec), ou pose ser clonado no [GitHub](https://github.com/freeCodeCamp/boilerplate-infosec/).
|
||||
|
||||
This challenge highlights one promising new defense that can significantly reduce the risk and impact of many type of attacks in modern browsers. By setting and configuring a Content Security Policy you can prevent the injection of anything unintended into your page. This will protect your app from XSS vulnerabilities, undesired tracking, malicious frames, and much more. CSP works by defining an allowed list of content sources which are trusted. You can configure them for each kind of resource a web page may need (scripts, stylesheets, fonts, frames, media, and so on…). There are multiple directives available, so a website owner can have a granular control. See HTML 5 Rocks, KeyCDN for more details. Unfortunately CSP is unsupported by older browser.
|
||||
Este desafio destaca um novo defensor promissor que pode reduzir significativamente o risco e o impacto de muitos tipos de ataques em navegadores modernos. Ao definir e configurar uma política de segurança de conteúdo, você pode evitar a injeção de qualquer coisa indesejada na sua página. Isso protegerá seu aplicativo de vulnerabilidades de XSS, rastreamento indesejado, frames maliciosos e muito mais. O CSP funciona definindo uma lista permitida de fontes de conteúdo confiáveis. Você pode configurá-las para cada tipo de recurso que uma página da web pode precisar (scripts, stylesheets, fontes, frames, mídia e assim por diante…). Há várias diretivas disponíveis. Por isso, o proprietário do site pode ter um controle granular. Veja HTML 5 Rocks, KeyCDN para mais detalhes. Infelizmente, o CSP não é suportado por navegadores mais antigos.
|
||||
|
||||
By default, directives are wide open, so it’s important to set the defaultSrc directive as a fallback. Helmet supports both defaultSrc and default-src naming styles. The fallback applies for most of the unspecified directives.
|
||||
Por padrão, as diretivas são abertas. Por isso, é importante definir a diretiva defaultSrc como regra. O helmet suporta estilos de nomeação defaultSrc e default-src. A regra aplica-se à maior parte das diretivas não especificadas.
|
||||
|
||||
# --instructions--
|
||||
|
||||
In this exercise, use `helmet.contentSecurityPolicy()`. Configure it by adding a `directives` object. In the object, set the `defaultSrc` to `["'self'"]` (the list of allowed sources must be in an array), in order to trust only your website address by default. Also set the `scriptSrc` directive so that you only allow scripts to be downloaded from your website (`'self'`), and from the domain `'trusted-cdn.com'`.
|
||||
Neste exercício, use `helmet.contentSecurityPolicy()`. Configure-o adicionando um objeto `directives`. No objeto, defina o `defaultSrc` como `["'self'"]` (a lista de fontes permitidas deve estar em um array). Por padrão, para confiar apenas no endereço do seu site. Defina também a diretiva `scriptSrc` para que você só permita que os scripts sejam baixados do seu site (`'self'`), e do domínio `'trusted-cdn.com'`.
|
||||
|
||||
Hint: in the `'self'` keyword, the single quotes are part of the keyword itself, so it needs to be enclosed in double quotes to be working.
|
||||
Dica: na palavra-chave `'self'`, as aspas simples são parte da própria palavra-chave. Por isso, é preciso que ele esteja envolvido em aspas duplas para poder funcionar.
|
||||
|
||||
# --hints--
|
||||
|
||||
helmet.contentSecurityPolicy() middleware should be mounted correctly
|
||||
O middleware helmet.contentSecurityPolicy() deve ser montado corretamente
|
||||
|
||||
```js
|
||||
(getUserInput) =>
|
||||
@@ -36,7 +36,7 @@ helmet.contentSecurityPolicy() middleware should be mounted correctly
|
||||
);
|
||||
```
|
||||
|
||||
Your csp config is not correct. defaultSrc should be ["'self'"] and scriptSrc should be ["'self'", 'trusted-cdn.com']
|
||||
A configuração do csp não está correta. defaultSrc deve ser ["'self'"] e scriptSrc deve ser ["self'", 'trusted-cdn.com']
|
||||
|
||||
```js
|
||||
(getUserInput) =>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 58a25bcef9fc0f352b528e7c
|
||||
title: Understand BCrypt Hashes
|
||||
title: Compreender hashes do BCrypt
|
||||
challengeType: 2
|
||||
forumTopicId: 301586
|
||||
dashedName: understand-bcrypt-hashes
|
||||
@@ -8,23 +8,23 @@ dashedName: understand-bcrypt-hashes
|
||||
|
||||
# --description--
|
||||
|
||||
For the following challenges, you will be working with a new starter project that is different from the previous one. You can find the new starter project on [Replit](https://replit.com/github/freeCodeCamp/boilerplate-bcrypt), or clone it from [GitHub](https://github.com/freeCodeCamp/boilerplate-bcrypt/).
|
||||
Para os próximos desafios, você estará trabalhando com um novo projeto inicial diferente do anterior. Você pode encontrar o novo projeto inicial em [Replit](https://replit.com/github/freeCodeCamp/boilerplate-bcrypt), ou cloná-lo no [GitHub](https://github.com/freeCodeCamp/boilerplate-bcrypt/).
|
||||
|
||||
BCrypt hashes are very secure. A hash is basically a fingerprint of the original data- always unique. This is accomplished by feeding the original data into an algorithm and returning a fixed length result. To further complicate this process and make it more secure, you can also *salt* your hash. Salting your hash involves adding random data to the original data before the hashing process which makes it even harder to crack the hash.
|
||||
Os hashes do BCrypt são muito seguros. Um hash é basicamente uma impressão digital do dado original, sempre exclusivo. Isso é realizado alimentando os dados originais em um algoritmo e retornando um resultado de comprimento fixo. Para complicar ainda mais esse processo e torná-lo mais seguro, você também pode usar *salt* seu hash. O salting do seu hash envolve a adição de dados aleatórios aos dados originais antes do processo de hashing, o que torna ainda mais difícil quebrar o hash.
|
||||
|
||||
BCrypt hashes will always looks like `$2a$13$ZyprE5MRw2Q3WpNOGZWGbeG7ADUre1Q8QO.uUUtcbqloU0yvzavOm` which does have a structure. The first small bit of data `$2a` is defining what kind of hash algorithm was used. The next portion `$13` defines the *cost*. Cost is about how much power it takes to compute the hash. It is on a logarithmic scale of 2^cost and determines how many times the data is put through the hashing algorithm. For example, at a cost of 10 you are able to hash 10 passwords a second on an average computer, however at a cost of 15 it takes 3 seconds per hash... and to take it further, at a cost of 31 it would takes multiple days to complete a hash. A cost of 12 is considered very secure at this time. The last portion of your hash `$ZyprE5MRw2Q3WpNOGZWGbeG7ADUre1Q8QO.uUUtcbqloU0yvzavOm`, looks like one large string of numbers, periods, and letters but it is actually two separate pieces of information. The first 22 characters is the salt in plain text, and the rest is the hashed password!
|
||||
Os hashes do BCrypt terão sempre essa aparência: `$2a$13$ZyprE5MRw2Q3WpNOGZWGbeG7ADUre1Q8QO.uUUtcbqloU0yvzavOm`, o que mostra uma estrutura. O primeiro dados`$2a` está definindo que tipo de algoritmo de hash foi usado. A próxima porção `$13` define o *custo*. Custo tem a ver com a força necessária para calcular o hash. Está em escala logarítmica de 2^custo e determina quantas vezes os dados são colocados através do algoritmo de hash. Por exemplo, com um custo de 10, você consegue o hash de 10 senhas por segundo em um computador médio. No entanto, a um custo de 15, leva 3 segundos por hash... e, chegando um pouco mais longe, a um custo de 31 dias, levaria vários dias para completar um hash. Neste momento, considera-se muito seguro um custo de 12. A última parte do seu hash `$ZyprE5MRw2Q3WpNOGZWGbeG7ADUre1Q8QO.uUUtcbqloU0yvzavOm`, parece com uma linha grande de números, pontos e letras, mas, na verdade, são duas informações separadas. Os primeiros 22 caracteres são o salt em texto simples. O resto é a senha com hash!
|
||||
|
||||
# --instructions--
|
||||
|
||||
To begin using BCrypt, add it as a dependency in your project and require it as 'bcrypt' in your server.
|
||||
Para começar a usar o BCrypt, adicione-o como uma dependência em seu projeto e solicite como 'bcrypt' no seu servidor.
|
||||
|
||||
Add all your code for these lessons in the `server.js` file between the code we have started you off with. Do not change or delete the code we have added for you.
|
||||
Adicione todo o código para estas aulas no arquivo `server.js` entre o código que fornecemos para você começar. Não altere nem exclua o código que adicionamos para você.
|
||||
|
||||
Submit your page when you think you've got it right.
|
||||
Envie sua página quando você achar que ela está certa.
|
||||
|
||||
# --hints--
|
||||
|
||||
BCrypt should be a dependency.
|
||||
O BCrypt deve ser uma dependência.
|
||||
|
||||
```js
|
||||
(getUserInput) =>
|
||||
@@ -43,7 +43,7 @@ BCrypt should be a dependency.
|
||||
);
|
||||
```
|
||||
|
||||
BCrypt should be properly required.
|
||||
O BCrypt deve ser devidamente solicitado.
|
||||
|
||||
```js
|
||||
(getUserInput) =>
|
||||
|
Reference in New Issue
Block a user