social code scanning

30
Social Code Scanning 2017-05-24 Barcelona Maurizio Pillitu Devops Director, Symphony Software Foundation @maoo [email protected] Analysing code, together

Upload: symphony-software-foundation

Post on 23-Jan-2018

52 views

Category:

Business


0 download

TRANSCRIPT

Page 1: Social Code Scanning

Social Code Scanning2017-05-24 Barcelona

Maurizio PillituDevops Director, Symphony Software Foundation

@maoo [email protected]

Analysing code, together

Page 2: Social Code Scanning

Social Code Scanning - our first event!

✓ What is it

Hands-on-code Workshop to analyse quality, security and legal aspects of your

code

Quick intro on how to analyse and measure

Networking, pizza and beers are on us

✓ Who’s behind

Organised by the Symphony Software Foundation

Hosted by CodeWorks Barcelona

✓ Requirements - none

1/23

Page 3: Social Code Scanning

The Symphony Software Foundation

✓ Non-profit organisation to foster an open source community and

developer ecosystem for the financial services

✓ Leverages Symphony* and other open source platforms to drive

inter-firm collaboration

✓ Open

Governance - Board of Directors, Engineering Steering Committee

Standards - Working Groups

Source - github.com/symphonyoss

2/23

Page 4: Social Code Scanning

Today’s takeaways

1. Understand

If/when to analyse your code

Common scenarios

2. Try

Analysing your code

Commonly adopted tools

3. Ask

Share doubts, questions

3/23

Page 5: Social Code Scanning

Why analyze code?

1. To know your codebase

Your code is a puzzle, few tiles are actually made by you

Code modularity constantly increases (more, smaller tiles)

Platforms and technologies (ie runtimes) evolve fast, opening to new potential exploits

Open source constitutes a massive tile repository, publicly available

2. Your customers (or consumers) deserve to know

Nobody wants to consume unsecure/buggy code

Highly-regulated (ie financial services) and mission-critical (ie aerospace) industries

cannot afford quality/security/legal exposure #dealbreaker

4/23

Page 6: Social Code Scanning

Security

Page 7: Social Code Scanning

Why measure security?

1. Protect your data #atrest #intransit

2. Protect your servers

3. ...

5/23

Page 8: Social Code Scanning

What to measure

1. Query CVE databases

http://cve.mitre.org/

https://www.exploit-db.com/ #offsec #kalilinux #mrrobot

https://nvd.nist.gov/ #usgov

2. Code patterns

http VS https

Hardcoded keys and passwords

Anti-patterns

3. Guidelines (manual)

6/23

Page 9: Social Code Scanning

How to measure

1. One-off (manual) scanning

Read your code

Know your libraries

Follow guidelines

2. Automated/continuous scanning

BlackDuck

WhiteSource

SonarQube

NodeSecurity

7/23

Page 10: Social Code Scanning

Quality

Page 11: Social Code Scanning

Why measure quality?

1. Know when quality lowers (and where)

2. Say bye to regressions

3. Focus on (new) code #boostproductivity

4. ....

8/23

Page 12: Social Code Scanning

What to measure

1. Project

Activity

Commits (codebase activity)

Bugs - Opened VS Fixed

Inter-firm collaboration #bus-factor

Documentation

User manual

Installation manual

Roadmap

9/23

Page 13: Social Code Scanning

How to measure

1. One-off (manual) scanning

Read your code

Know your libraries

Follow guidelines

2. Automated/continuous scanning

BlackDuck

WhiteSource

SonarQube

CodeClimate

10/23

Page 14: Social Code Scanning

Legal

Page 15: Social Code Scanning

Why care about legal compliance?

1. Respect the rights of open source contributors

a. Appropriate attribution

b. Reciprocal (copyleft) licensing requirements

2. Avoid intellectual property infringement

a. Copyrights

b. Patents

3. Demonstrate due diligence (aka build trust)

a. Targeted for highly regulated industries #consumption #contribution

b. Avoid concerns in event of acquisition

11/23

Page 16: Social Code Scanning

What to measure

1. Outbound - choose the right license

a. Proprietary

b. Open source

i. Permissive

ii. Copyleft

iii. Weak copyleft

iv. Public domain

2. Dependencies Inbound (for bundled software)

a. Look for licenses included in the codebase

12/23

Page 17: Social Code Scanning

How to measure

1. One-off (manual) scanning

Read your code

Know your libraries

2. Automated/continuous scanning

BlackDuck / OpenHub

Fossa

WhiteSource

VersionEye

FOSSology

13/23

Page 18: Social Code Scanning

Open source common misunderstandings

1. It’s public in github, no license is defined, ergo it’s open source

■ Quite the opposite, as no license defaults to "all rights reserved", including use and

redistribution for personal and commercial purposes

2. No license is defined… contributions are welcome!

■ Without a contribution policy, license sets the terms for collaboration

3. I defined a LICENSE file, I’m fine

■ If you use dependencies, you must check their licenses and make sure it doesn’t

conflict with your outbound license

4. I have 2 direct dependencies and their license is ok, I’m fine

■ Careful about transitive dependencies!

14/23

Page 19: Social Code Scanning

Wrapping up

Page 20: Social Code Scanning

General remarks

1. Keep it simple

2. Understand requirements

3. Manage expectations

4. Use the right tool….

Useful resources

symphonyoss.atlassian.net/wiki

choosealicense.com

15/23

Page 21: Social Code Scanning

16/23

Page 22: Social Code Scanning

17/23

Page 23: Social Code Scanning

Let’s see some action!

Page 24: Social Code Scanning

Google Map Polygon Filter

React component allows to draw a draggable polygon on a Google

Map and extract locations within that area.

18/23

Page 25: Social Code Scanning

Google Map Polygon Filter

Scanning with VersionEye

19/23

Page 26: Social Code Scanning

Google Map Polygon Filter

bcrypt-pbkdf - upgrade to 1.0.1

20/23

Page 27: Social Code Scanning

Traffic Alarm

ReactNative alarm that adapts to traffic situation

21/23

Page 28: Social Code Scanning

Traffic Alarm

Scanning with VersionEye

https://stackoverflow.com/questions/28756017/about-googlemaps-sdk-for-ios-licenses

22/23

Page 29: Social Code Scanning

Traffic Alarm

Reading GoogleMaps Terms of Service

23/23

Page 30: Social Code Scanning

Thanks!

Maurizio PillituDevops Director, Symphony Software Foundation

@maoo [email protected]