freeCodeCamp/curriculum/challenges/spanish/06-information-security-and.../information-security-with-h.../mitigate-the-risk-of-clickj...

2.3 KiB

id title challengeType videoUrl localeTitle
587d8247367417b2b2512c38 Mitigate the Risk of Clickjacking with helmet.frameguard() 2 Mitigue el riesgo de clickjacking con helmet.frameguard ()

Description

Como recordatorio, este proyecto se está construyendo sobre el siguiente proyecto de inicio en Glitch , o clonado desde GitHub . Su página podría colocarse en un <frame> o <iframe> sin su consentimiento. Esto puede resultar en ataques de clickjacking, entre otras cosas. Clickjacking es una técnica para engañar a un usuario para que interactúe con una página diferente de lo que el usuario cree que es. Esto se puede obtener ejecutando su página en un contexto malicioso, mediante iframing. En ese contexto, un hacker puede poner una capa oculta sobre su página. Los botones ocultos se pueden utilizar para ejecutar scripts incorrectos. Este middleware establece el encabezado X-Frame-Options. Se restringe quién puede poner su sitio en un marco. Tiene tres modos: DENY, SAMEORIGIN y ALLOW-FROM. No necesitamos que nuestra aplicación sea enmarcada. Debería usar el uso de helmet.frameguard() pasa con el objeto de configuración {action: 'deny'} .

Instructions

Tests

tests:
  - text: El middleware helmet.frameguard () debe ser montado correctamente
    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' se debe establecer en 'DENY'
    testString: 'getUserInput => $.get(getUserInput("url") + "/_api/app-info").then(data => { assert.property(data.headers, "x-frame-options"); assert.equal(data.headers["x-frame-options"], "DENY");}, xhr => { throw new Error(xhr.responseText); })'

Challenge Seed

Solution

// solution required