Slide 1

Slide 1 text

Automated Tests in the World of Web Security

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

What does that have to do with web development?

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

Garden

Slide 11

Slide 11 text

Garden House = Protected parts

Slide 12

Slide 12 text

Garden Garden = our defenses House = Protected parts

Slide 13

Slide 13 text

==

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

What’s our game plan?

Slide 16

Slide 16 text

What’s our game plan?

Slide 17

Slide 17 text

Know your house application

Slide 18

Slide 18 text

What to automate first?

Slide 19

Slide 19 text

Priority

Slide 20

Slide 20 text

Priority Risk Level

Slide 21

Slide 21 text

Priority Risk Level Automation Difficulty

Slide 22

Slide 22 text

Priority Risk Level Automation Difficulty Business Value

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

Broken Access Control

Slide 26

Slide 26 text

Broken Access Control Cryptographic Failures

Slide 27

Slide 27 text

Broken Access Control Cryptographic Failures Injection

Slide 28

Slide 28 text

How do we “cover” our garden?

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

Garden Attackers arrive here

Slide 31

Slide 31 text

Garden House = Infrastructure Attackers arrive here

Slide 32

Slide 32 text

Garden House = Infrastructure Frontend Attackers arrive here

Slide 33

Slide 33 text

Garden House = Infrastructure Frontend API Attackers arrive here

Slide 34

Slide 34 text

Garden House = Infrastructure Frontend API Backend Attackers arrive here

Slide 35

Slide 35 text

Test Cases

Slide 36

Slide 36 text

Test Cases

Slide 37

Slide 37 text

Injection

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

-> “Frame” -> “Test”

Slide 44

Slide 44 text

Sample repo

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

it('injects XSS payload into search field’, () => { cy.get('.mat-search_icon-search').click(); cy.get('.mat-toolbar-row .mat-form-field-infix') .type(''); 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; });

Slide 48

Slide 48 text

it('injects XSS payload into search field’, () => { cy.get('.mat-search_icon-search').click(); cy.get('.mat-toolbar-row .mat-form-field-infix') .type(''); 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; });

Slide 49

Slide 49 text

it('injects XSS payload into search field’, () => { cy.get('.mat-search_icon-search').click(); cy.get('.mat-toolbar-row .mat-form-field-infix') .type(''); 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; });

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

No content

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

Broken Access Control

Slide 55

Slide 55 text

Cover protected areas

Slide 56

Slide 56 text

No content

Slide 57

Slide 57 text

No content

Slide 58

Slide 58 text

No content

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

CSRF via API Testing

Slide 61

Slide 61 text

No content

Slide 62

Slide 62 text

No content

Slide 63

Slide 63 text

No content

Slide 64

Slide 64 text

No content

Slide 65

Slide 65 text

No content

Slide 66

Slide 66 text

No content

Slide 67

Slide 67 text

OpenFGA

Slide 68

Slide 68 text

Cryptographic Failures

Slide 69

Slide 69 text

HTTPS!?

Slide 70

Slide 70 text

HTTPS!?

Slide 71

Slide 71 text

Get better sample by randomizing

Slide 72

Slide 72 text

No content

Slide 73

Slide 73 text

Use fixtures or helpers to store routes or input fields Helper

Slide 74

Slide 74 text

cy.sample by cypress map Cypress-map Cypress-map Use fixtures or helpers to store routes or input fields Helper

Slide 75

Slide 75 text

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

Slide 76

Slide 76 text

Utilize API Schema Docs

Slide 77

Slide 77 text

How… or well, does it fit into our life(cycle)? Garden

Slide 78

Slide 78 text

Development Testing Staging Production

Slide 79

Slide 79 text

Development Testing Staging Production

Slide 80

Slide 80 text

Development Testing Staging Production Pre-Commit Hook SAST Linting

Slide 81

Slide 81 text

Development Testing Staging Production Pre-Commit Hook SAST Linting Built time tests DAST / IAST

Slide 82

Slide 82 text

Development Testing Staging Production Pre-Commit Hook SAST Linting Built time tests DAST / IAST Deploy Gates Pen Testing

Slide 83

Slide 83 text

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

Slide 84

Slide 84 text

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

Slide 85

Slide 85 text

No content

Slide 86

Slide 86 text

Fast check Testing JSVerify

Slide 87

Slide 87 text

No content

Slide 88

Slide 88 text

Shall we waive tool support?

Slide 89

Slide 89 text

The unknown thread?!

Slide 90

Slide 90 text

Cypress + OWASP ZAP ZAP as a proxy

Slide 91

Slide 91 text

Recommendations

Slide 92

Slide 92 text

SAST Tools Recommendations

Slide 93

Slide 93 text

SAST Tools DAST Tools Recommendations

Slide 94

Slide 94 text

SAST Tools DAST Tools IAST Tools Recommendations

Slide 95

Slide 95 text

SAST Tools DAST Tools IAST Tools Static Code Quality Analysis Recommendations

Slide 96

Slide 96 text

SAST Tools Keeping dependencies up-to-date DAST Tools IAST Tools Static Code Quality Analysis Recommendations

Slide 97

Slide 97 text

No content

Slide 98

Slide 98 text

No content

Slide 99

Slide 99 text

Only saving money and less of a learning curve?

Slide 100

Slide 100 text

Great messenger!!

Slide 101

Slide 101 text

Regression Tests

Slide 102

Slide 102 text

Building trust

Slide 103

Slide 103 text

Use Test Runner / Tracer for Reproducability

Slide 104

Slide 104 text

Learn what external tools do

Slide 105

Slide 105 text

No content

Slide 106

Slide 106 text

No content

Slide 107

Slide 107 text

No content

Slide 108

Slide 108 text

No content

Slide 109

Slide 109 text

Automation = great complement

Slide 110

Slide 110 text

Automation = great complement Intentional Test Cases as low hanging fruits

Slide 111

Slide 111 text

Automation = great complement Intentional Test Cases as low hanging fruits Combine own test cases + Tools

Slide 112

Slide 112 text

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

Slide 113

Slide 113 text

Auth0

Slide 114

Slide 114 text

Additional

Slide 115

Slide 115 text

Iframe!? - clickjacking

Slide 116

Slide 116 text

Rate limiter testing

Slide 117

Slide 117 text

Web vitals for performace topics?