CCyberwiki

Penetration testing

In penetration testing (also pen testing or ethical hacking), people engaged by the owner of a system attack it with the tools and methods a real attacker would use, to find where its security controls can be bypassed.1 The attacks are often real ones, sent at real systems and data, and most tests hunt for several vulnerabilities that, chained together, give more access than any one of them alone.1

Description

For web applications, penetration testing sits beside threat modelling, code review and manual inspection. The tester reaches the application the way its users do and tries to find and exploit flaws, often signed in with accounts the owner created for the test.2

How much the testers are told sets the kind of test. In an open-box test they get full details of the target and can confirm known flaws and common misconfigurations. In a closed-box test they get nothing, which is closer to an unknown outside attacker, but some flaws may stay hidden in the days allowed.3 In web testing, black-box testing is almost another name for the method, though testers given the source code find flaws that an outside-only test misses.2 Sorted by goal, the usual type for web applications is vulnerability identification in custom software. Scenario tests start instead from an event such as a lost laptop, and some of them measure whether the organisation detects the attack at all.3

Engagement

The UK's National Cyber Security Centre (NCSC) splits an engagement into five stages: initial engagement, scoping, testing, reporting and follow-up. Scoping brings together the risk owners, technical staff who know the system and a member of the test team. Its output is a written plan with the technical boundaries of the test, the types of test, the effort in resource days, what the testers need beforehand (test accounts, for example), legal conditions and the report format.3 The boundaries in this plan are what the testers are permitted to attack.

During testing a technical contact stays reachable so that testers can report a critical finding at once, since no tester can promise that the system will not react in an unexpected way. When testers find systems outside the scope that affect it, the risk owner decides whether to widen the scope, at extra cost, or to record the gap as a limitation of the test.3

Report

The report lists each issue with its risk and a way to resolve it, and gives an opinion on how accurate the organisation's own vulnerability assessment was. Testers often rate severity with Common Vulnerability Scoring System; reports under the UK CHECK scheme must use HIGH, MEDIUM, LOW and INFORMATIONAL, with CVSS only as an addition. Testers do not see the full business context, so their ratings can differ from the owner's, and the decision on risk and fixes stays with the owner.3

Testing hosted systems

Cloud providers publish rules for tests of systems on their platforms. Amazon Web Services lets customers test their own resources on listed services, among them EC2 instances, RDS databases and load balancers, without asking first. It forbids testing AWS's own infrastructure and services, denial-of-service attacks and request flooding, S3 bucket takeover and subdomain takeover, and passes abuse reports about a test on to the customer.4

Limits

A test shows that the system resisted known issues on the day it ran. A year or more often passes before the next one, and flaws added in between go unseen if testing is the only check. No complete list of test cases can be written in advance, which ties the quality of a test to the skill of the testers.3

Network testing is mostly about known flaws in named products. Web applications are nearly all custom-built, so the method transfers poorly to them: testing one is closer to research, and automated penetration tools alone do poorly. Gary McGraw's description is that a test finds "a small representative sample" of the risks in a system. A test also comes late in development and sees only the outside of the application, from where code behind many nested conditions is hard to reach.2

Place among other tests

A penetration test works like a financial audit, in which an outside team checks that the internal team's processes work. In the ideal case the owner already knows what the testers will find, because routine internal checks have found it first.3 Testing belongs in every phase of development, with manual reviews, technical testing and tests in the build pipeline; a focused retest of flaws found earlier can confirm that their fixes reached the deployed code.2 The neighbouring methods are Threat modelling, Static application security testing and Security code review on the source, Software composition analysis on dependencies, DAST and Vulnerability scanning on the running application, and a Bug bounty program.

Notable incidents

IT staff of the Iowa Judicial Branch contracted Coalfire, a security company in Colorado, to test buildings and computer systems at county courthouses. After midnight on 11 September 2019, two of its testers entered the Dallas County Courthouse in Adel, set off an alarm and were arrested; the sheriff filed a complaint of third-degree burglary.5 The Iowa Supreme Court hired the law firm Faegre Baker Daniels to investigate.6 Its report of 10 October 2019 found the contract ambiguous on whether physical testing after business hours was allowed, found weak supervision of the programme and no ill intent, and named as the largest failure that nobody had considered the counties, which provide courthouse security. The court then banned break-ins and after-hours entry by testers and required a lawyer to review every testing contract.5

See also

References

  1. a b "penetration testing". CSRC Glossary, citing NIST SP 800-115 and SP 800-53 Rev. 5. NIST.
  2. a b c d "Introduction". OWASP Web Security Testing Guide, v4.2. OWASP Foundation.
  3. a b c d e f g "Penetration testing". NCSC guidance. UK National Cyber Security Centre.
  4. back "AWS Customer Support Policy for Penetration Testing". AWS Security. Amazon Web Services.
  5. a b Pitt, David (10 October 2019). "Supreme Court prohibits courthouse security test break-ins". Associated Press, in The Washington Times.
  6. back Iowa Judicial Branch (20 September 2019). "Iowa Supreme Court hires law firm for independent investigation". Iowa Courts newsroom.