AUTOMATED APPLICATION SECURITY - European Testing … · Automated functional testing §Reoccurring...

25
AUTOMATED APPLICATION SECURITY Juha Kivekäs

Transcript of AUTOMATED APPLICATION SECURITY - European Testing … · Automated functional testing §Reoccurring...

Page 1: AUTOMATED APPLICATION SECURITY - European Testing … · Automated functional testing §Reoccurring (weekly, daily, commit) §Unit tests, Integration tests, etc. §Triggers Automated

AUTOMATED APPLICATION

SECURITYJuha Kivekäs

Page 2: AUTOMATED APPLICATION SECURITY - European Testing … · Automated functional testing §Reoccurring (weekly, daily, commit) §Unit tests, Integration tests, etc. §Triggers Automated

WHAT KIND OF

AUTOMATION2

Page 3: AUTOMATED APPLICATION SECURITY - European Testing … · Automated functional testing §Reoccurring (weekly, daily, commit) §Unit tests, Integration tests, etc. §Triggers Automated

SECURITY ASSESSMENTS§ Explorative, tester is seldom familiar with application

§ Time constrained

§ Partly automated, but mainly manual work

§ Point-in-time, often just before release

§ Finds issues late in the development lifecycle

3

Page 4: AUTOMATED APPLICATION SECURITY - European Testing … · Automated functional testing §Reoccurring (weekly, daily, commit) §Unit tests, Integration tests, etc. §Triggers Automated

Automated functional testing

§ Reoccurring (weekly, daily, commit)

§ Unit tests, Integration tests, etc.

§ Triggers

Automated security testing

§ Non-manual

§ Application scanning

§ Network scanning

4

AUTOMATION, TWO VIEWS

Page 5: AUTOMATED APPLICATION SECURITY - European Testing … · Automated functional testing §Reoccurring (weekly, daily, commit) §Unit tests, Integration tests, etc. §Triggers Automated

LEFT SHIFT SECURITY

§ Find issues early

§ Fix root causes before they propagate§ Don’t build technical debt

§ Bring security awareness to the developers

5

Page 6: AUTOMATED APPLICATION SECURITY - European Testing … · Automated functional testing §Reoccurring (weekly, daily, commit) §Unit tests, Integration tests, etc. §Triggers Automated

AUTOMATINGEXPLORATIVE

TESTING6

Page 7: AUTOMATED APPLICATION SECURITY - European Testing … · Automated functional testing §Reoccurring (weekly, daily, commit) §Unit tests, Integration tests, etc. §Triggers Automated

USE EXISTING TOOLS§ BSIMM [ST2.1: 22] Integrate black box security tools into the QA process.

§ Microsoft SDL Practice #12: Perform Fuzz Testing

§ Microsoft SDL Practice #8: Use Approved tools

§ Communicates what has been done

§ Industry standard

§ No detailed security knowledge needed

7

Page 8: AUTOMATED APPLICATION SECURITY - European Testing … · Automated functional testing §Reoccurring (weekly, daily, commit) §Unit tests, Integration tests, etc. §Triggers Automated

SECURITY TESTING TOOLS§ Network scanners

§ Application scanners

§ Proxies

§ Code analysis

§ Attack and exploitation tools

8

Page 9: AUTOMATED APPLICATION SECURITY - European Testing … · Automated functional testing §Reoccurring (weekly, daily, commit) §Unit tests, Integration tests, etc. §Triggers Automated

SCANNINGfoobar1'11 exec sp_ (or exec xp_)1 and 1=11' and 1=(select count(*) from tablenames); --1 or 1=11' or '1'='11or1=11'or'1'='1fake@ema'or'il.nl'='il.nl

9

Page 10: AUTOMATED APPLICATION SECURITY - European Testing … · Automated functional testing §Reoccurring (weekly, daily, commit) §Unit tests, Integration tests, etc. §Triggers Automated

SPIDER & SCANPoint and click!

1. Crawl the whole site

2. Test for known bad inputs on everything1. Look for typical bad files2. Enter known bad inputs3. Look for strings in responses (errors, versions, etc.)

3. Done

10

Page 11: AUTOMATED APPLICATION SECURITY - European Testing … · Automated functional testing §Reoccurring (weekly, daily, commit) §Unit tests, Integration tests, etc. §Triggers Automated

11

Page 12: AUTOMATED APPLICATION SECURITY - European Testing … · Automated functional testing §Reoccurring (weekly, daily, commit) §Unit tests, Integration tests, etc. §Triggers Automated

SPIDER & SCAN§ Burpsuite Pro, with Carbonator plugin

§ java -jar -Xmx2g -Djava.awt.headless=true burp.jar https www.example.com 80

§ ZAP quickscan§ ./zap.sh -cmd -quickurl https://www.exmaple.com -quickprogress

§ Arachni§ Highly customizable, if you run arch or gentoo, you're going to love it.

§ Lots of tools of varying quality

12

Page 13: AUTOMATED APPLICATION SECURITY - European Testing … · Automated functional testing §Reoccurring (weekly, daily, commit) §Unit tests, Integration tests, etc. §Triggers Automated

Pros

+Easy and fast

+Little setup needed

+Gets actual results

Cons

- Quiet malfunctions- Logout detection- Session invalidation- Fix: use a magic cookie in testing

- Limited coverage- Especially on responsive sites

13

SPIDER & SCAN

Page 14: AUTOMATED APPLICATION SECURITY - European Testing … · Automated functional testing §Reoccurring (weekly, daily, commit) §Unit tests, Integration tests, etc. §Triggers Automated

ACTIVE SCANScan whatever the user browses

1. User makes a request or sends a form

2. Form and URL gets scanned in a few hundred ways

3. Repeat

14

Page 15: AUTOMATED APPLICATION SECURITY - European Testing … · Automated functional testing §Reoccurring (weekly, daily, commit) §Unit tests, Integration tests, etc. §Triggers Automated

Pros

+Good support for manual testing

+Visibility of malfunctions

+Works well on AJAX as well

Cons

- Requires a human

15

ACTIVE SCAN

Page 16: AUTOMATED APPLICATION SECURITY - European Testing … · Automated functional testing §Reoccurring (weekly, daily, commit) §Unit tests, Integration tests, etc. §Triggers Automated

ACTIVE SCAN OF TEST CASESActive scanning, but replace human with functional tests

1. Run test case through proxy

2. Test request gets scanned

3. Repeat

16

Page 17: AUTOMATED APPLICATION SECURITY - European Testing … · Automated functional testing §Reoccurring (weekly, daily, commit) §Unit tests, Integration tests, etc. §Triggers Automated

ACTIVE SCAN OF TEST CASES

17

Scanner proxy ServerTest client

Test runner

Page 18: AUTOMATED APPLICATION SECURITY - European Testing … · Automated functional testing §Reoccurring (weekly, daily, commit) §Unit tests, Integration tests, etc. §Triggers Automated

MITTN§ Glue between:

§ Security testing tools§ Functional tests§ Findings database

§ "Engineers interface"

18

Page 19: AUTOMATED APPLICATION SECURITY - European Testing … · Automated functional testing §Reoccurring (weekly, daily, commit) §Unit tests, Integration tests, etc. §Triggers Automated

Pros

+Same coverage as the functional tests used

+No detailed security knowledge needed

Cons

- Harder to set up

- Reporting may not integrate

- Not a human

19

ACTIVE SCAN OF TEST CASES

Page 20: AUTOMATED APPLICATION SECURITY - European Testing … · Automated functional testing §Reoccurring (weekly, daily, commit) §Unit tests, Integration tests, etc. §Triggers Automated

POTENTIALHICCUPS

20

Page 21: AUTOMATED APPLICATION SECURITY - European Testing … · Automated functional testing §Reoccurring (weekly, daily, commit) §Unit tests, Integration tests, etc. §Triggers Automated

FALSE POSITIVES§ There will always be false positives

§ Ignore them§ Verify, flag, and store

§ Verification may need specialized security knowledge§ Ask your security team member§ Ask your local nerd

21

Page 22: AUTOMATED APPLICATION SECURITY - European Testing … · Automated functional testing §Reoccurring (weekly, daily, commit) §Unit tests, Integration tests, etc. §Triggers Automated

CONNECTING FINDINGSTO TEST CASES

§ Which functional test triggered an issue§ May be easily seen from the triggering request§ May not even matter

§ Could we fail a functional test if it causes a security issue?§ Requires tight integration of test framework and security tool

22

Page 23: AUTOMATED APPLICATION SECURITY - European Testing … · Automated functional testing §Reoccurring (weekly, daily, commit) §Unit tests, Integration tests, etc. §Triggers Automated

ARE YOU CYBER-SAFE NOW?§ Unfortunately, no

§ Automated tools can only do so much

§ Some security culture will seep into the team

§ Some easy-to-exploit issues will have been remediated

23

Page 24: AUTOMATED APPLICATION SECURITY - European Testing … · Automated functional testing §Reoccurring (weekly, daily, commit) §Unit tests, Integration tests, etc. §Triggers Automated

DO I STILL HAVE A JOB?§ Yes, tools are limited by complexity

§ Security is much larger than scanning§ Way

§ Way§ Way

§ Larger

24

Page 25: AUTOMATED APPLICATION SECURITY - European Testing … · Automated functional testing §Reoccurring (weekly, daily, commit) §Unit tests, Integration tests, etc. §Triggers Automated