Pruebas automatizadas de seguridad de aplicaciones

Rate this content
Bookmark

Con StackHawk, los equipos de ingeniería pueden realizar pruebas de seguridad en aplicaciones JS y las API subyacentes para encontrar y solucionar vulnerabilidades más rápido. Con pruebas automatizadas en cada PR, puedes tener la confianza de que tu aplicación es segura. Únete a Scott Gerlach, cofundador de StackHawk, para obtener una breve descripción de las pruebas de seguridad de aplicaciones JS con StackHawk.

9 min
18 Nov, 2021

Video Summary and Transcription

StackHawk es una herramienta dinámica de pruebas de seguridad de aplicaciones que te ayuda a encontrar, entender y solucionar errores de seguridad en tus aplicaciones HTTP en ejecución y puntos finales de API. Realiza pruebas de seguridad activas utilizando las mejores prácticas OWASP top 10 y se puede integrar en flujos de trabajo de CI/CD. El escáner proporciona resultados detallados de las pruebas, incluyendo hallazgos como inyección SQL y problemas de scripting entre sitios, y se puede configurar utilizando YAML. StackHawk se puede utilizar para clasificar y priorizar problemas de seguridad, y se puede integrar perfectamente en el flujo de trabajo de desarrollo.

Available in English

1. Introducción a StackHawk

Short description:

StackHawk es una herramienta de prueba de seguridad de aplicaciones dinámicas que te ayuda a encontrar, comprender y solucionar errores de seguridad en tus aplicaciones HTTP en ejecución y puntos finales de API. Fue diseñado para la automatización y CI/CD para ser parte de tu estrategia sólida de pruebas para el ciclo de vida de desarrollo de tu aplicación.

¿Qué tal TestJS Summit? Soy Scott Gerlach, Oficial Principal de Seguridad y Cofundador aquí en StackHawk. Gracias por tomarte el tiempo para conocer StackHawk y espero que estés teniendo una gran conferencia con TestJS Summit. En pocas palabras, StackHawk es una herramienta de prueba de seguridad de aplicaciones dinámicas. Puedes usarla para probar tus aplicaciones HTTP en ejecución y puntos finales de API en busca de errores de seguridad y evitar que se vuelvan vulnerables. Puedes usar StackHawk para realizar pruebas activas de seguridad en tu API REST en ejecución, API GraphQL, API SOAP, aplicación del lado del servidor y aplicaciones de una sola página. StackHawk fue diseñado para la automatización y CI/CD para ser parte de tu estrategia sólida de pruebas para el ciclo de vida de desarrollo de tu aplicación. También facilita encontrar, comprender

2. Cómo funciona StackHawk

Short description:

StackHawk realiza pruebas de seguridad activas en tus aplicaciones para asegurarse de que manejen de manera segura la entrada y salida del usuario. Implementa las mejores prácticas OWASP top 10 y se puede utilizar localmente o en flujos de trabajo de CI/CD. El escáner se configura mediante YAML, proporcionando descripciones simples y ejemplos de problemas de seguridad. La integración con plataformas de CI y herramientas de información es perfecta, y los resultados del escaneo se pueden enviar a varios canales o utilizar para interrumpir compilaciones. Ejecutar el escáner de StackHawk implica utilizar un comando de Docker, que realiza un rastreo y un ataque para identificar posibles problemas de seguridad. Los resultados incluyen un resumen de los hallazgos, como problemas de inyección SQL y scripting entre sitios.

y solucionar bugs de seguridad es fácil. ¿Cómo funciona StackHawk te preguntas? Excelente pregunta. StackHawk realiza pruebas de seguridad activas en tus aplicaciones en ejecución para asegurarse de que tu aplicación maneje de manera segura la entrada y salida del usuario, así como implementar las mejores prácticas OWASP top 10 para la seguridad de la aplicación. Podemos hacer esto en tu aplicación en ejecución en tu host local, en flujos de trabajo de CI CD y en aplicaciones que aún no se han publicado en Internet. También hemos agilizado las pruebas dinámicas al colocar el escáner lo más cerca posible de la aplicación y utilizando estándares abiertos para informar al escáner, especificación de API abierta, GraphQL, consultas de introspección de SOAP, WSDL, además de la sintonización del escáner que hemos realizado, la mayoría de las aplicaciones de los clientes de StackHawk se escanean en un promedio de menos de 10 minutos. Encontrar y solucionar problemas de seguridad es simple con StackHawk. Nuestro enfoque como empresa es ayudar a los desarrolladores a encontrar y, lo más importante, solucionar problemas de seguridad. El escáner y la plataforma de StackHawk están construidos en torno a este modelo de simplicidad. El escáner se configura mediante YAML que se encuentra junto con el código de la aplicación que estás probando. Cuando se clasifican los hallazgos de StackHawk, la plataforma intenta brindarte la versión más simple de la información necesaria para ayudarte a comprender rápidamente cuál es el problema con descripciones simples y ejemplos de patrones para ayudarte a identificar el antipatrón, poder recrear el problema con herramientas como el comando curl para repetir el ataque y ponerte en modo de depuración, recorriendo el código lo más rápido posible para ayudarte a solucionar problemas y volver a tu trabajo regular de crear valor para tus clientes. Todo esto está habilitado para CI-CD. Nuevamente, puedes integrar esto en tu proceso de CI y, lo que es más importante, obtener comentarios en el proceso de CI sobre los hallazgos del escaneo. Esta información se puede utilizar para interrumpir una compilación si así lo deseas, según la gravedad de los hallazgos no clasificados. La mayoría de los logotipos de los principales jugadores de CI se muestran aquí en esta diapositiva y aunque tu plataforma en particular no esté, es muy probable que StackHawk funcione en tu plataforma siempre que pueda ejecutar un contenedor Docker. Si puedes ejecutar Docker, puedes ejecutar StackHawk. También puedes ver aquí que StackHawk se integra con tu flujo de trabajo y herramientas de información. Podemos notificarte los resultados del escaneo en un canal de Slack, publicar esa información en Datadog o enviarte un mensaje simple de webhook que luego puedes utilizar para procesar y hacer con los datos lo que elijas. Echemos un vistazo a cómo se ve el escáner de StackHawk en funcionamiento. Como puedes ver aquí, tengo una aplicación del lado del servidor estándar. Esta es una aplicación de extracción de solicitudes que quiero probar en busca de problemas de seguridad. Así que aquí en mi línea de comandos, tengo un simple comando de Docker que ejecuté. Entonces Docker run StackHawk, le proporcioné el archivo YAML de StackHawk, lo veremos en un segundo. Como puedes ver, hizo un rastreo estándar, buscando todas las cosas interesantes en la página web que pudo encontrar, y luego hizo un ataque. Así que atacó activamente esta aplicación en busca de posibles problemas de seguridad. Cuando todo terminó, obtuvimos un resumen de estos hallazgos. De hecho, tengo un problema de inyección SQL que debo solucionar. Puedes ver que es nuevo. También tengo un problema de scripting entre sitios que ya he solucionado antes. De hecho, hice un ticket con esto. Así que ahora está en estado asignado. También tenemos muchas otras cosas que podemos ver, pero echemos un vistazo

3. Analyzing Scan Results and Configuring the Scanner

Short description:

En la parte inferior, hay un enlace al escaneo. La salida en un sistema CI/CD se vería similar. Podemos acceder al escaneo y examinar el problema de inyección SQL. El escaneo proporciona detalles sobre lo que hizo el escáner, la solicitud y la respuesta, e incluso un comando curl para reproducir el ataque. Se utiliza YAML de StackHawk para configurar el escáner, especificando la ubicación de la aplicación, el entorno y el ID de la aplicación. También hay opciones de configuración adicionales disponibles para la autenticación, el manejo de cookies y tokens CSRF, y la exclusión de ciertos escaneos. Si no hay tiempo para solucionar el problema, se puede enviar a un ticket de Jira.

también. Aquí, en la parte inferior, tenemos un enlace a este escaneo. Así que podemos tomar este enlace y pegarlo en un navegador. Por cierto, la salida en un sistema CI/CD se vería muy similar a esto porque esta es la salida estándar. Entonces, si eligieras interrumpir una compilación, tendrías este mismo enlace en la salida de CI/CD. Así que podemos ir aquí a nuestro navegador web y entrar directamente en el escaneo que estamos viendo. Estábamos viendo este mismo escaneo. Tenemos el problema de inyección SQL que podemos ver rápidamente. Puedes ver que tenemos un problema de inyección SQL. Estamos describiendo rápidamente qué es la inyección SQL, cómo remediarla, de qué se trata y qué riesgos puede representar para una aplicación. También tenemos enlaces a diferentes frameworks de lenguaje que muestran el patrón de cómo prevenir la inyección SQL en Spring, Laravel, Django y Rails, para que puedas ayudar a identificar el anti-patrón que estamos buscando. Echemos un vistazo a este problema en particular aquí. Podemos ver que en la ruta SQL de las encuestas, tenemos un método de envío que tiene algún tipo de problema. En nuestro panel derecho, tenemos una solicitud y una respuesta de lo que el escáner realmente hizo y luego regresó. Podemos ver que el escáner hizo una solicitud aquí contra la aplicación y esta respondió de alguna forma. De hecho, podemos ver que el escáner hizo una inyección de caso aquí, así que podríamos reproducir esto si quisiéramos. Todo esto ayuda a comprender lo que el escáner intenta hacer y qué problema cree que ha encontrado. Pero interesantemente, tenemos este botón de validación realmente genial aquí arriba. Como mencioné antes, este botón de validación te proporciona un comando curl de exactamente lo que el escáner hizo para identificar este problema en particular. Entonces, puedes copiar y repetir este ataque contra una aplicación.

Echemos un vistazo a ese YAML de StackHawk. Aquí puedes ver el código que he usado para construir mi aplicación de encuestas. Dentro de este repositorio, también he almacenado el YAML de StackHawk. El YAML de StackHawk es cómo se configura el escáner de StackHawk. Entonces, puedes ver la información importante que está aquí es ¿dónde encuentro la aplicación que necesito probar? En este caso, se está ejecutando en mi máquina local, en local-host 8020. ¿En qué entorno estoy y cuál es el ID de la aplicación? Esa es la cantidad mínima de información que necesitas para ejecutar un escaneo de StackHawk en tu aplicación. Hay otras piezas de información que ayudan a ajustar el escáner a tu aplicación, como la autenticación, cómo manejar cookies y tokens CSRF, así como cosas que no deseas que el escáner escanee. Si deseas agregar una especificación de Open API o GraphQL, se necesita una configuración adicional mínima para que eso suceda y apuntar el escáner a esas definiciones estándar de la industria de API REST y GraphQL.

Ahora, digamos que no tenemos tiempo para solucionar este problema en particular. Necesitamos lanzar esta función para nuestro cliente, pero queremos solucionarlo. Así que podemos enviar rápidamente esto a un Jira

4. Integrando StackHawk y Conclusión

Short description:

Puedes enviar el problema a Jira y priorizarlo para futuros sprint o épicas. Triagea los problemas para evitar notificaciones repetidas. StackHawk puede integrarse en tu flujo de trabajo de desarrollo para mejorar la calidad del desarrollo de software. Comienza una prueba gratuita en stackhawk.com.

ticket. Así que puedo enviar esto a un ticket de Jira Cloud o Jira data center ahora mismo desde esta pantalla en particular. Así que puedo enviar este problema directamente a Jira, y ahora puedo priorizarlo y sacarlo del backlog cuando esté listo para hacerlo en el próximo sprint o en la próxima épica. Como verás, esto ahora se ha convertido en un problema con estado de triaje. Entonces, cuando volvamos aquí a nuestro resumen de hallazgos, verás que nuestro cross-site scripting ha sido triajeado y nuestras inyecciones SQL también han sido triajeadas. La próxima vez que el escáner encuentre estas cosas, recordará que ya las has triajeado y dejará de intentar llamar tu atención sobre ellas. Si has configurado las compilaciones para que se interrumpan, esto deshará el mecanismo de interrupción de la compilación y tu compilación continuará normalmente. Espero que hayas disfrutado mi charla hoy y tal vez hayas aprendido algo nuevo sobre cómo StackHawk puede integrarse en tu flujo de trabajo de desarrollo. Si quieres probar StackHawk y ver cómo puedes integrarlo en tu proceso de desarrollo para seguir empujando los límites en la calidad del desarrollo de software, siempre puedes comenzar una prueba gratuita en stackhawk.com. Y StackHawk siempre es gratuito para usar en una sola aplicación. Gracias por ver. Disfruta del TestJS Summit.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

TestJS Summit 2021TestJS Summit 2021
33 min
Network Requests with Cypress
Top Content
Whether you're testing your UI or API, Cypress gives you all the tools needed to work with and manage network requests. This intermediate-level task demonstrates how to use the cy.request and cy.intercept commands to execute, spy on, and stub network requests while testing your application in the browser. Learn how the commands work as well as use cases for each, including best practices for testing and mocking your network requests.
TestJS Summit 2021TestJS Summit 2021
38 min
Testing Pyramid Makes Little Sense, What We Can Use Instead
Top Content
Featured Video
The testing pyramid - the canonical shape of tests that defined what types of tests we need to write to make sure the app works - is ... obsolete. In this presentation, Roman Sandler and Gleb Bahmutov argue what the testing shape works better for today's web applications.
TestJS Summit 2022TestJS Summit 2022
27 min
Full-Circle Testing With Cypress
Top Content
Cypress has taken the world by storm by brining an easy to use tool for end to end testing. It’s capabilities have proven to be be useful for creating stable tests for frontend applications. But end to end testing is just a small part of testing efforts. What about your API? What about your components? Well, in my talk I would like to show you how we can start with end-to-end tests, go deeper with component testing and then move up to testing our API, circ
TestJS Summit 2021TestJS Summit 2021
31 min
Test Effective Development
Top Content
Developers want to sleep tight knowing they didn't break production. Companies want to be efficient in order to meet their customer needs faster and to gain competitive advantage sooner. We ALL want to be cost effective... or shall I say... TEST EFFECTIVE!But how do we do that?Are the "unit" and "integration" terminology serves us right?Or is it time for a change? When should we use either strategy to maximize our "test effectiveness"?In this talk I'll show you a brand new way to think about cost effective testing with new strategies and new testing terms!It’s time to go DEEPER!
React Day Berlin 2022React Day Berlin 2022
29 min
Get rid of your API schemas with tRPC
Do you know we can replace API schemas with a lightweight and type-safe library? With tRPC you can easily replace GraphQL or REST with inferred shapes without schemas or code generation. In this talk we will understand the benefit of tRPC and how apply it in a NextJs application. If you want reduce your project complexity you can't miss this talk.

Workshops on related topic

React Summit 2023React Summit 2023
151 min
Designing Effective Tests With React Testing Library
Top Content
Featured Workshop
React Testing Library is a great framework for React component tests because there are a lot of questions it answers for you, so you don’t need to worry about those questions. But that doesn’t mean testing is easy. There are still a lot of questions you have to figure out for yourself: How many component tests should you write vs end-to-end tests or lower-level unit tests? How can you test a certain line of code that is tricky to test? And what in the world are you supposed to do about that persistent act() warning?
In this three-hour workshop we’ll introduce React Testing Library along with a mental model for how to think about designing your component tests. This mental model will help you see how to test each bit of logic, whether or not to mock dependencies, and will help improve the design of your components. You’ll walk away with the tools, techniques, and principles you need to implement low-cost, high-value component tests.
Table of contents- The different kinds of React application tests, and where component tests fit in- A mental model for thinking about the inputs and outputs of the components you test- Options for selecting DOM elements to verify and interact with them- The value of mocks and why they shouldn’t be avoided- The challenges with asynchrony in RTL tests and how to handle them
Prerequisites- Familiarity with building applications with React- Basic experience writing automated tests with Jest or another unit testing framework- You do not need any experience with React Testing Library- Machine setup: Node LTS, Yarn
TestJS Summit 2022TestJS Summit 2022
146 min
How to Start With Cypress
Featured WorkshopFree
The web has evolved. Finally, testing has also. Cypress is a modern testing tool that answers the testing needs of modern web applications. It has been gaining a lot of traction in the last couple of years, gaining worldwide popularity. If you have been waiting to learn Cypress, wait no more! Filip Hric will guide you through the first steps on how to start using Cypress and set up a project on your own. The good news is, learning Cypress is incredibly easy. You'll write your first test in no time, and then you'll discover how to write a full end-to-end test for a modern web application. You'll learn the core concepts like retry-ability. Discover how to work and interact with your application and learn how to combine API and UI tests. Throughout this whole workshop, we will write code and do practical exercises. You will leave with a hands-on experience that you can translate to your own project.
React Summit 2022React Summit 2022
117 min
Detox 101: How to write stable end-to-end tests for your React Native application
Top Content
WorkshopFree
Compared to unit testing, end-to-end testing aims to interact with your application just like a real user. And as we all know it can be pretty challenging. Especially when we talk about Mobile applications.
Tests rely on many conditions and are considered to be slow and flaky. On the other hand - end-to-end tests can give the greatest confidence that your app is working. And if done right - can become an amazing tool for boosting developer velocity.
Detox is a gray-box end-to-end testing framework for mobile apps. Developed by Wix to solve the problem of slowness and flakiness and used by React Native itself as its E2E testing tool.
Join me on this workshop to learn how to make your mobile end-to-end tests with Detox rock.
Prerequisites- iOS/Android: MacOS Catalina or newer- Android only: Linux- Install before the workshop
TestJS Summit 2023TestJS Summit 2023
48 min
API Testing with Postman Workshop
Top Content
WorkshopFree
In the ever-evolving landscape of software development, ensuring the reliability and functionality of APIs has become paramount. "API Testing with Postman" is a comprehensive workshop designed to equip participants with the knowledge and skills needed to excel in API testing using Postman, a powerful tool widely adopted by professionals in the field. This workshop delves into the fundamentals of API testing, progresses to advanced testing techniques, and explores automation, performance testing, and multi-protocol support, providing attendees with a holistic understanding of API testing with Postman.
1. Welcome to Postman- Explaining the Postman User Interface (UI)2. Workspace and Collections Collaboration- Understanding Workspaces and their role in collaboration- Exploring the concept of Collections for organizing and executing API requests3. Introduction to API Testing- Covering the basics of API testing and its significance4. Variable Management- Managing environment, global, and collection variables- Utilizing scripting snippets for dynamic data5. Building Testing Workflows- Creating effective testing workflows for comprehensive testing- Utilizing the Collection Runner for test execution- Introduction to Postbot for automated testing6. Advanced Testing- Contract Testing for ensuring API contracts- Using Mock Servers for effective testing- Maximizing productivity with Collection/Workspace templates- Integration Testing and Regression Testing strategies7. Automation with Postman- Leveraging the Postman CLI for automation- Scheduled Runs for regular testing- Integrating Postman into CI/CD pipelines8. Performance Testing- Demonstrating performance testing capabilities (showing the desktop client)- Synchronizing tests with VS Code for streamlined development9. Exploring Advanced Features - Working with Multiple Protocols: GraphQL, gRPC, and more
Join us for this workshop to unlock the full potential of Postman for API testing, streamline your testing processes, and enhance the quality and reliability of your software. Whether you're a beginner or an experienced tester, this workshop will equip you with the skills needed to excel in API testing with Postman.
TestJS Summit - January, 2021TestJS Summit - January, 2021
173 min
Testing Web Applications Using Cypress
WorkshopFree
This workshop will teach you the basics of writing useful end-to-end tests using Cypress Test Runner.
We will cover writing tests, covering every application feature, structuring tests, intercepting network requests, and setting up the backend data.
Anyone who knows JavaScript programming language and has NPM installed would be able to follow along.
GraphQL Galaxy 2021GraphQL Galaxy 2021
48 min
Building GraphQL APIs on top of Ethereum with The Graph
WorkshopFree
The Graph is an indexing protocol for querying networks like Ethereum, IPFS, and other blockchains. Anyone can build and publish open APIs, called subgraphs, making data easily accessible.

In this workshop you’ll learn how to build a subgraph that indexes NFT blockchain data from the Foundation smart contract. We’ll deploy the API, and learn how to perform queries to retrieve data using various types of data access patterns, implementing filters and sorting.

By the end of the workshop, you should understand how to build and deploy performant APIs to The Graph to index data from any smart contract deployed to Ethereum.