Slide 1

Slide 1 text

Frank S. Rietta, 
 M.S. Information Security rietta.com/blog @frankrietta on Twitter September 25, 2015 Defending Against Data Breaches, as a Practicing Ruby Developer

Slide 2

Slide 2 text

Slides on Speaker Deck 
 http://bit.ly/1NXuHk6 And the Paper At http://bit.ly/1iPQm0S

Slide 3

Slide 3 text

Two to Give Away Thanks to Yubico!

Slide 4

Slide 4 text

Security is not an On/Off switch

Slide 5

Slide 5 text

Application Security is the subset of Information Security focused on protecting data and privacy from abuse by adversaries who have access to the software system as a whole. Its purpose is to make software resilient to attack, especially when network defenses alone are insufficient.

Slide 6

Slide 6 text

Sensitive Data Means to 
 Read It + Unauthorized Person = Breach

Slide 7

Slide 7 text

Source: 
 McCandless (2015)

Slide 8

Slide 8 text

Photo Credit: johnjoh on Flicker, CC BY-SA 2.0.

Slide 9

Slide 9 text

Variety of hacking actions within Web App Attacks patterns (n=205) Source: Verizon DBIR (2015), p 41

Slide 10

Slide 10 text

Major Preventable Flaws • Compromised staff credentials, which would be preventable by two-factor authentication • Automated technical exploits, that are aggressively applied over a large number of sites, succeeded because basics are ignored • Poor security, including unencrypted backups, leading to an unauthorized person having access to both the data and the means to read it

Slide 11

Slide 11 text

Hoglund, Greg , and Gary McGraw. (2004) Exploiting Software, p 9. “Most outsourced software (software developed off-site by contractors) is full of backdoors…. Companies that commission this kind of software have not traditionally paid any attention to security at all” (2004).

Slide 12

Slide 12 text

“Security is not a functional requirement” - A graduate school professor

Slide 13

Slide 13 text

Security is not a functional requirement

Slide 14

Slide 14 text

Security-based Development Adapting heavy Security Enhanced Software Development Lifecycle to an Agile approach

Slide 15

Slide 15 text

Security is a Requirement

Slide 16

Slide 16 text

Commercial Information Classifications 1. Public: Public information 2. Internal Use: Confidential business information 3. Confidential: Information that customers consider confidential 4. Sensitive: Personal and Private Information (PII), information that THE LAW considers confidential 5. Highly Sensitive: Encryption keys, server secrets, staff/admin passwords

Slide 17

Slide 17 text

Users can feel a privacy breach even if the terms and conditions spell out in mouse print that they agree to such sharing. This is a yellow line violation.

Slide 18

Slide 18 text

User Stories 
 & Abuser Stories I want an easy login experience I want to obtain credentials and steal things

Slide 19

Slide 19 text

User Stories Are composed of three aspects: 1. a written description of the story used for planning and as a reminder 2. conversations about the story that serve to flesh out the details of the story 3. tests that convey and document details and that can be used to determine when a story is complete

Slide 20

Slide 20 text

The New Customer As a Visitor, I can create a new account by filling in my e-mail address and desired password Security Notes: • Can we verify that the user really has the email address on signup? • The password should be at least 12 characters long and should definitely allow for spaces and punctuation

Slide 21

Slide 21 text

The Customer Service Rep As a Staff member, I can choose the “Assist Customer” button to login as that customer to provide him or her with excellent service. Security Notes: • We need to have a ton of logging around this feature • Staff members should be required to have authenticated with two- factor so that we do not have an unauthorized person accessing this with just a staff credential • Let’s identify certain private fields that customer service does not need access to while helping the customer. Those should be restricted; can we use the database SQL permissions to raise an exception if any of those fields is accessed while using this feature?

Slide 22

Slide 22 text

The Lawyer As general counsel, when I have received a subpoena for all material records for a particular account and have exhausted my options to reject it, I work with a system administrator to produce the data while not pulling unnecessary records. Security Notes: • As a matter of policy, we push back on all Law enforcement requests. • Even when the government compels access, we have to protect privacy.

Slide 23

Slide 23 text

Abuser Stories

Slide 24

Slide 24 text

URL Tweaker As an Authenticated Customer, I see what looks like my account number in the URL, so I change it to another number to see what will happen

Slide 25

Slide 25 text

Curious Editor As an Authenticated Customer, I paste HTML that includes JavaScript into every field possible to see what happens.

Slide 26

Slide 26 text

Infrastructure Takeover As a Malicious Hacker, I want to gain access to this web application’s Cloud Hosting account so that I can lock out the legitimate owners and delete the servers and their backups, to destroy their entire business

Slide 27

Slide 27 text

It Happened to Code Spaces in 2014 http://arstechnica.com/security/2014/06/aws- console-breach-leads-to-demise-of-service-with- proven-backup-plan/

Slide 28

Slide 28 text

Disgruntled Employee As a disgruntled employee who will soon be fired, I want to permanently delete as much data as possible, so that I can cause chaos. Source: Fitzer, James R. Agile Information Security, p 37

Slide 29

Slide 29 text

Scam Artist / ID Thief As a scam artist, I want to obtain employee names, addresses, and social security numbers, so that I can steal their identity and finance a Corvette under their name. Source: Fitzer, James R. Agile Information Security, p 37

Slide 30

Slide 30 text

Hater As as Person with ill will towards a person I hate, I will seek to compromise any details about that person possible so that I can harm their reputation or endanger their life.

Slide 31

Slide 31 text

Clear Communication About Threats to Inform Development Decisions

Slide 32

Slide 32 text

Additional Practical Countermeasures • Read the OWASP Top 10 • Use Secure HTTP Headers and enable SSL-only with Strict-Transport Security on all production sites • Run automated audit tools, such as Brakeman, Bundler-audit, Code Climate, and Linters • Use GnuPG (or PGP) as part of your workflow • Practice on the OWASP Railsgoat!

Slide 33

Slide 33 text

Recap 1. Data breaches are a major concern that cannot be mitigated by wishful thinking alone 2. Application Security is about preventing abuse by adversaries who have access to the system, focusing on the app itself rather than just its environment 3. Have an Information Classification system 4. Treat security as a requirement by writing Abuse Stories along with your User Stories. 5. Apply practical technical countermeasures, such as including OWASP Top 10 and your abuse stories in your automated test suite

Slide 34

Slide 34 text

Thanks!

Slide 35

Slide 35 text

Frank S. Rietta, M.S. Information Security • My blog, where I write on security and other topics • https://rietta.com/blog • On Twitter • https://twitter.com/frankrietta • Learn more about Rietta’s community sponsorship, including the Atlanta Ruby Users’ Group videos • https://rietta.com/community

Slide 36

Slide 36 text

Rietta builds custom, secure code to automate business processes and web APIs. Unlike some other development shops, application security is actually our primary concern when we write code and build products. A Security-based Development Firm