Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Plants vs thieves: Automated Tests in the World...

Plants vs thieves: Automated Tests in the World of Web Security

Web security is crucial in a constantly evolving environment where potential threats are always present. To better understand this concept, we can imagine our web application as a garden or a home that needs to be protected from possible attacks. We can draw parallels with the popular game "Plants vs. Zombies," which aims to safeguard your garden from intruders.

Our automated tests function as diligent guardians whose primary objective is to identify and address potential vulnerabilities, much like the diverse plant arsenal in the game. Instead of framing the security process as a never-ending fight, we will explore how automated tests act as defenders against possible issues, whether they are zombies or intruders. Next to an overview of tools you can utilize, we emphasize the importance of fundamental testing types, such as unit or end-to-end tests, in securing your digital garden.

Join this session to understand how to create a secure environment for your web application through test automation. This approach ensures that your web applications can successfully navigate the challenges posed by cyber threats without the necessity of introducing entirely new dedicated tools.

Ramona Schwering

January 23, 2025
Tweet

More Decks by Ramona Schwering

Other Decks in Technology

Transcript

  1. ==

  2. it('injects XSS payload into search field’, () => { cy.get('.mat-search_icon-search').click();

    cy.get('.mat-toolbar-row .mat-form-field-infix') .type('<iframe src="javascript:alert(`xss`)">'); cy.get('.mat-toolbar-row .mat-form-field-infix’) .type('{enter}'); // Check if the payload is executed let spy = cy.spy(window, 'alert'); expect(spy).to.haveOwnProperty('callCount'); expect(spy).to.not.be.called; });
  3. it('injects XSS payload into search field’, () => { cy.get('.mat-search_icon-search').click();

    cy.get('.mat-toolbar-row .mat-form-field-infix') .type('<iframe src="javascript:alert(`xss`)">'); cy.get('.mat-toolbar-row .mat-form-field-infix’) .type('{enter}'); // Check if the payload is executed let spy = cy.spy(window, 'alert'); expect(spy).to.haveOwnProperty('callCount'); expect(spy).to.not.be.called; });
  4. it('injects XSS payload into search field’, () => { cy.get('.mat-search_icon-search').click();

    cy.get('.mat-toolbar-row .mat-form-field-infix') .type('<iframe src="javascript:alert(`xss`)">'); cy.get('.mat-toolbar-row .mat-form-field-infix’) .type('{enter}'); // Check if the payload is executed let spy = cy.spy(window, 'alert'); expect(spy).to.haveOwnProperty('callCount'); expect(spy).to.not.be.called; });
  5. Use faker.js for test data cy.sample by cypress map Cypress-map

    Cypress-map Use fixtures or helpers to store routes or input fields Helper
  6. Development Testing Staging Production Pre-Commit Hook SAST Linting Built time

    tests DAST / IAST Deploy Gates Pen Testing Runtime Monitoring Security Monitoring
  7. Development Testing Staging Production Pre-Commit Hook SAST Linting Built time

    tests DAST / IAST Deploy Gates Pen Testing Runtime Monitoring Security Monitoring OWASP Web Security Testing Guide
  8. Automation = great complement Intentional Test Cases as low hanging

    fruits Combine own test cases + Tools All testing types can be utilized, including property-based testing