Top Banner
© '13 SAMSUNG Electronics Co. 김영택 Young Taek Kim [email protected] Open Source Initiative. AA Lab. SE Team Piloting SPDX in Samsung : Case Studies and Experiences
31

Piloting SPDX in Samsung

Jan 02, 2017

Download

Documents

NguyễnKhánh
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Piloting SPDX in Samsung

© '13 SAMSUNG Electronics Co.

김영택 Young Taek Kim [email protected]

Open Source Initiative. AA Lab. SE Team

Piloting SPDX in Samsung : Case Studies and Experiences

Page 2: Piloting SPDX in Samsung

2/31

Table of Contents

1. SPDX Introduction

2. Piloting SPDX

1. Motivation in open source development process

1. Open source development process

2. Verification details and problem

3. Release detail and problem

2. Solutions with SPDX

1. Reducing the cost of verifying open source licenses

2. license notice web system

3. Future work

3. Feedback to SPDX

4. Q&A

Page 3: Piloting SPDX in Samsung

3/31

Introduction to SPDX

Page 4: Piloting SPDX in Samsung

4/31

Demands on introducing open source to enterprise side

Need a standardized, adopted format for a S/W Bill of Materials

software in

Our suppliers aren’t giving us complete

licensing information for

open source packages.

Every customer wants a bill of materials

in a different form.

I don’t mind vetting our code, but I’m sure

this imported package has been analyzed a dozen

times before.

software out

Page Content Copyright© 2010 by Linux Foundation

Page 5: Piloting SPDX in Samsung

5/31

License Complexity when adopting OSS (1)

Products have mixed code from many different sources…

YOUR COMPANY – TOOLS, PROCESSES

Your Application Open Source

Software

Internally Developed

Code

Outsourced Code Development

Code

Obligations

Commercial 3rd-Party Code

Page Content Copyright© 2010 by Linux Foundation

Page 6: Piloting SPDX in Samsung

6/31

License Complexity when adopting OSS (2)

An OSS Package can contain multiple OSS packages, multiple licenses.

OSS Package

OSS Package

OSS Package

OSS Package

License A License B License C

License D License E

License A License B License C License D License E

New code

One OSS Package = Many Licenses

License info for OSS is not provided in a consistent, easy-to-use format

Page Content Copyright© 2010 by Linux Foundation

Page 7: Piloting SPDX in Samsung

7/31

SPDX introduction (1)

Software Package Data eXchange

- A standard format for communicating the components, licenses and copyrights associated with a software package.

- Hosted at the Linux Foundation whose goal is to facilitate compliance with free/open source software licenses and the exchange of such information between companies.

- 30 participants

…and others

Systems OS Distributions

Applications

Integration & Services

Device OEMs

End-Users

Semiconductor Vendors

Open Source Organizations

Page Content Copyright© 2010 by Linux Foundation

Page 8: Piloting SPDX in Samsung

8/31

SPDX introduction (2)

SPDX as Software Bill of Materials

3rd party SW

Outsourced SW

OSS Package

OSS Package

Your code

Creating an accurate bill of

materials

Companies combine OSS with other

software

Software Bill of Materials

(BOM)

?

Page Content Copyright© 2010 by Linux Foundation

Page 9: Piloting SPDX in Samsung

9/31

Benefit

Benefits of standardizing

- Allows easy exchange of license information between companies, reducing the burden of both suppliers and consumers

- Avoids due diligence redundancy where the same source code package is analyzed multiple times by different receivers

- Provides a unified method for exchanging license information

Embedded & SW Supply Chains

Save Time/Money Better Compliance

Open Source Developers

Help Users Comply With Your Licenses

Consumers of SW & OSS

Understand Licensing of the Code You Use

Easy Exchange

• Unified Method • Avoid redundancy

Page Content Copyright© 2010 by Linux Foundation

Page 10: Piloting SPDX in Samsung

10/31

List of “Standard Licenses”

License repository

- List of most common licenses (100+)

- Include common exceptions

- Standardized license names

- Exact text of licenses

- Available on SPDX® website – URLs won’t change

- Short names adopted by OSI

Support permanent URL https://spdx.org/licenses/

Page Content Copyright© 2010 by Linux Foundation

Page 11: Piloting SPDX in Samsung

11/31

SPDX Specification (1)

Package identification, copyright and licensing

Text of licenses that are not in SPDX™ standard list

Log of 3rd party reviews

File is in RDF/XML or tag value form and can be converted to/from spreadsheets.

Document Information

Creation Information

Package Information

File Information

Licensing Information

Review Information

How and when created

File by file identification, copyright and licensing

SPDX Version and Licensing

Page Content Copyright© 2010 by Linux Foundation

Page 12: Piloting SPDX in Samsung

12/31

SPDX Specification (2)

Package identification, copyright and licensing

Text of licenses that are not in SPDX™ standard list

Log of 3rd party reviews

File is in RDF/XML or tag value form an dcan be converted to/from spreadsheets.

Document Information

Creation Information

Package Information

File Information

Licensing Information

Review Information

How and when created

File by file identification, copyright and licensing

SPDX Version and Licensing

Page Content Copyright© 2010 by Linux Foundation

File Name

File Type (source, binary, archive)

File CheckSum

Declared License

Concluded License (license determined by SPDX file creator)

License Text in File

Copyright Text

Artifact of Project Name (from which project it came)

Identification

- Formal Name of Package (Full name given by originator and version information)

- Unique ID (to unambiguously map a file to a package)

- Package Download Location (download URL)

Package Supplier and Originator

Licensing for Package

- Declared License- License that has been asserted for the package

- Concluded License- License that Creator concluded

- List of file licenses

Copyright Text

Page 13: Piloting SPDX in Samsung

13/31

Tools and Version of SPDX

Open Source Tools (hosted on SPDX Git Repo. http://spdx.org/tools)

- SPDX Compare Utility

- License RDFa Generator

- RDF to HTML Pretty Printer

- SPDX Viewer

- Spreadsheet to RDF/Tag Value xlator

- RDF/Tag Value to Spreadsheet xlator

- License file generator (from Spreadsheet)

- Spreadsheet template

Versions

- Current version: 1.1

- Working on version 2.0

Page 14: Piloting SPDX in Samsung

14/31

Piloting SPDX - Motivation through open source development

Page 15: Piloting SPDX in Samsung

15/31

Open source development process

#include <stdio.h> #include <stdlib.h> int main() { printf(“Hello, SPDX!”); funcA(); exit(0); } void funcA() { printf(“funcA called”); }

Open source Package

Check from * Hosting Site * License Notice file

Search proper OSS package

License checking

check out

#include <stdio.h> #include <stdlib.h> int main() { printf(“Hello, SPDX!”); funcA(); exit(0); } void funcA() { printf(“funcA called”); }

#include <stdio.h> #include <stdlib.h> int main() { printf(“Hello, SPDX!”); funcA(); exit(0); } void funcA() { printf(“funcA called”); }

#include <stdio.h> #include <stdlib.h> int main() { printf(“Hello, SPDX!”); funcA(); exit(0); } void funcA() { printf(“funcA called”); }

Develop using OSS packages

#include <stdio.h> #include <stdlib.h> int main() { printf(“Hello, SPDX!”); funcA(); exit(0); } void funcA() { printf(“funcA called”); }

#include <stdio.h>#include <stdlib.h>

intmain() {printf(“Hello, SPDX!”);funcA();exit(0);

}

voidfuncA() {printf(“funcA called”);

}

Open source Package

#include <stdio.h>#include <stdlib.h>

intmain() {printf(“Hello, SPDX!”);funcA();exit(0);

}

voidfuncA() {printf(“funcA called”);

}

#include <stdio.h>#include <stdlib.h>

intmain() {printf(“Hello, SPDX!”);funcA();exit(0);

}

voidfuncA() {printf(“funcA called”);

}

#include <stdio.h>#include <stdlib.h>

intmain() {printf(“Hello, SPDX!”);funcA();exit(0);

}

voidfuncA() {printf(“funcA called”);

}

Verify with Verification Tool

Verification Tool

Identify(Audit) by Reviewer

Source Code Disclosure

License Notice

#include <stdio.h>#include <stdlib.h>

intmain() {printf(“Hello, SPDX!”);funcA();exit(0);

}

voidfuncA() {printf(“funcA called”);

}

Open source Package

#include <stdio.h>#include <stdlib.h>

intmain() {printf(“Hello, SPDX!”);funcA();exit(0);

}

voidfuncA() {printf(“funcA called”);

}

#include <stdio.h>#include <stdlib.h>

intmain() {printf(“Hello, SPDX!”);funcA();exit(0);

}

voidfuncA() {printf(“funcA called”);

}

#include <stdio.h>#include <stdlib.h>

intmain() {printf(“Hello, SPDX!”);funcA();exit(0);

}

voidfuncA() {printf(“funcA called”);

}

OSS DISCOVERY Development Verification Release for Obligation satisfaction

SPDX Piloting scope

Notice Notice

Notice

Page 16: Piloting SPDX in Samsung

16/31

Verification process details - Identify

“Identify” Effort

- Confirm the original copyright & license of source codes.

• Verification tool can produce multiple matched result reviewer need to audit them.

- The work is labor-intensive and time-consuming for reviewers.

A Reviewer should audit matched result

#include <stdio.h> #include <stdlib.h> int main() { … }

GPL

BSD It is GPL? BSD? originator tracing..

Verification Tool

Identify Effort

Matched Result

#include <stdio.h> #include <stdlib.h> int main() { printf(“Hello, SPDX!”); funcA(); exit(0); } void funcA() { printf(“funcA called”); }

Source code

Verification Result

Document

Verification Result

Document

Reviewer’s TODO Trace the originality of source code (web surfing using MD5 value of source file,

visiting release site, or compare/analyzing various versions)

Labor intensive, Time-consuming

Multiple results are matched. (Each results can have different license obligation) Example) GPL source code needs to be released, and

need to put up a GPL License notice BSD license notice needed but source code

may not be released to public

Page 17: Piloting SPDX in Samsung

17/31

Problems of identification

Redundancy of identification.

- Identification data cannot be shared with other company.

- The Reviewer has to repeat identification effort.

Inconsistency of identification result

#include <stdio.h>#include <stdlib.h>

intmain() {

}

GPL

BSD

Source code

VerificationTool

RESULT:MATCHED Code snippet

#include <stdio.h>#include <stdlib.h>

intmain() {printf(“Hello, SPDX!”);funcA();exit(0);

}

voidfuncA() {printf(“funcA called”);

}

Source code

Verification Result

Document

#include <stdio.h>#include <stdlib.h>

intmain() {

}

GPL

BSD

Source code

VerificationTool

RESULT:MATCHED Code snippet

#include <stdio.h>#include <stdlib.h>

intmain() {printf(“Hello, SPDX!”);funcA();exit(0);

}

voidfuncA() {printf(“funcA called”);

}

Source code

Verification Result

Document

#include <stdio.h>#include <stdlib.h>

intmain() {

}

GPL

BSD

Source code

VerificationTool

RESULT:MATCHED Code snippet

#include <stdio.h>#include <stdlib.h>

intmain() {printf(“Hello, SPDX!”);funcA();exit(0);

}

voidfuncA() {printf(“funcA called”);

}

Source code

Verification Result

Document

Redundancy Redundancy

B to C A to B

#include <stdio.h> #include <stdlib.h> int main() { }

BSD

#include <stdio.h> #include <stdlib.h> int main() { }

GPL

#include <stdio.h> #include <stdlib.h> int main() { }

BSD

#include <stdio.h>#include <stdlib.h>

intmain() {

printf(“Hello, SPDX!”);funcA();exit(0);

}

voidfuncA() {

printf(“funcA called”);}

Result can be changed via repeated identification

Page 18: Piloting SPDX in Samsung

18/31

Release process details

Source code disclosure

License Notice

- Included in pages of the manual

- Included in the product itself.

#include <stdio.h>#include <stdlib.h>

intmain() {printf(“Hello, SPDX!”);funcA();exit(0);

}

voidfuncA() {printf(“funcA called”);

}

#include <stdio.h>#include <stdlib.h>

intmain() {printf(“Hello, SPDX!”);funcA();exit(0);

}

voidfuncA() {printf(“funcA called”);

}

#include <stdio.h>#include <stdlib.h>

intmain() {printf(“Hello, SPDX!”);funcA();exit(0);

}

voidfuncA() {printf(“funcA called”);

}Release (Obligation

satisfaction)

Source Code Disclosure

License Notice

1

2

Upload

Source codes published on web site

Source code

Notice Notice

Notice in manual Notice in product

Page 19: Piloting SPDX in Samsung

19/31

Problems of license notice

Cost of printing manual pages.

Cost of changing license info

- Firmware upgrade or License Modification (by human error, etc …)

- Re-printing license notice, new binary release

#include <stdio.h>#include <stdlib.h>

intmain() {printf(“Hello, SPDX!”);funcA();exit(0);

}

voidfuncA() {printf(“funcA called”);

}

#include <stdio.h>#include <stdlib.h>

intmain() {printf(“Hello, SPDX!”);funcA();exit(0);

}

voidfuncA() {printf(“funcA called”);

}

#include <stdio.h>#include <stdlib.h>

intmain() {printf(“Hello, SPDX!”);funcA();exit(0);

}

voidfuncA() {printf(“funcA called”);

}Release (Obligation

satisfaction)

Source Code Disclosure

License Notice

1

2

Upload

Source codes published to product site

Source code

Notice Notice

Notice in manual Notice in product

Cost of printing manual pages

Cost of Binary Release when License

modification occured

Page 20: Piloting SPDX in Samsung

20/31

Piloting SPDX usage

Page 21: Piloting SPDX in Samsung

21/31

Reducing the cost of verifying open source licenses

Reducing re-verification cost

- Auto Identify using SPDX format

AIRS

Verification Tool

#include <stdio.h>#include <stdlib.h>

intmain() {

}

GPL

BSD

Source code

VerificationTool

RESULT:MATCHED Code snippet

#include <stdio.h>#include <stdlib.h>

intmain() {printf(“Hello, SPDX!”);funcA();exit(0);

}

voidfuncA() {printf(“funcA called”);

}

Source code

Verification Result

Document

SPDX format including

Identification data

AUTO IDENTIFY

Identify ONLY newly added or

modified sources

AIRS

VerificationTool

Identify ONLY newly added or

modified sources

Page 22: Piloting SPDX in Samsung

22/31

AIRS(Auto Identify Using SPDX) Introduction(1)

AIRS

- Standalone program including Auto identify functionality

- Interface for legacy system

• JAVA library type or CLI

Main function

- SPDX Export Function

• Export identification data as SPDX file format

• Use file comment field to include identification data

- Auto Identify Function

• Identify exported identification data to new system

Identification data is written in SPDX File

[ content of exported SPDX file ]

Page 23: Piloting SPDX in Samsung

23/31

AIRS(Auto Identify Using SPDX) Introduction(2)

Pros of Auto Identify

- Identify when SHA1 checksum is identical whether absolute file path is not same.

• It can be identified even if the directory structure is changed,

- Various options

• Select the most recent reviewed file in case multiple identical files exists. (or not)

• Overwrite existing identification data (or not)

• Identify only when absolute file path is the same.(or not)

1 Only one identical file exists

Multiple identical files, Have same identification data.

2

(OPTION) Multiple identical files, Same file-name(absolute file path)

3

AI

AI

code.c code.c t.cpp base.c

algo.c

AI

Code

Identify Data

Compare File Checksum

Only one identical file exists?

identical files have identical identification

data?

(OPTION) same file name(path)?

same file exist?

Multiple same file exists

Different data

AUTO IDENTIFY

Only one same file

identical identification data

same

1

2

3

N

N

N

Y

N

Review all files

Use exported SPDX file’s REPORT Data

• Identification

Data • File Checksum

Y

Y

Y

[ Auto identify flow chart ] [ Auto identify Rules]

Page 24: Piloting SPDX in Samsung

24/31

AIRS(Auto Identify Using SPDX) Introduction(3)

Running AIRS

- Auto-identify target project with source project’s SPDX file.

Execute AIRS ex) # java –jar airs.jar ai –h http://127.0.0.1 –u [email protected] –p passwd –proxy-host 127.0.0.1 --proxy-port 8080 --project-id c_13_swc_developer_ai_demo_130826 --spdx-files source.rdf

[ before ]

All Auto-identified

# Not identified yet

[ after ]

※ OSI: Open source Self Inspector (samsung in-house tool)

Page 25: Piloting SPDX in Samsung

25/31

license notice web system

Reduce license notice cost

- Only QR Code/URL printed on the pages of the manual

- No need to change binary or manual whenever license notice needs to be changed.

Automate license notice by using standard form

+

Provide QR Code/URL on product or the pages of

the manual

AIRS

SPDX Export

Upload SPDX, insert product data

http://opensource.samsung.com

+

+

Product Binary

Manual Pages

CD

AIRS

AIRS

Department A

Automate by using SPDX(standard form)

Department B

Department C

Page 26: Piloting SPDX in Samsung

26/31

license notice web system (2)

QR Code/URL included as part of the product documentation (in manual, on box, in device with written offer, etc.)

Ex) QRCode on box

End user visits specified Web site(OSRC) using QR Code (or connect to URL directly)

End user receives license info in the product including source code, license, and compliance contact

Write product information Load Verification Result(SPDX) License Notice and QR Code(URL) created

[ License Notice on web site using SPDX ]

[ End User Scenario ]

Admin page in opensource.samsung.com

Page 27: Piloting SPDX in Samsung

27/31

Future work (1)

Build Auto-identify Database in Samsung

- Collection of certified identification data.

- Data contents

• Frequently used open source package for every products.

• Packages of main branch module in specific platform.

Auto-identify DataBase

Identification Data - RDF(SPDX) Format

AIRS Auto

Identify

[ IT & mobile division ]

[ Visual Display division ]

[ Printing Solution division ]

Page 28: Piloting SPDX in Samsung

28/31

Future work (2)

Support various verification tool

- Currently AIRS supports only Protex.

- Designed to be compatible with various tools (abstract layer)

Improve auto-identify function

- Identify when code snippet is same even if the file checksum is different

- More detail options.

FOSS friendly

- Using SPDX Parser(from SPDX-tools)

- Planning contribution of AIRS

Auto Identify API (CLI/ Function call)

SPDX Manager

Identify Abstract Layer

Protex Palamida

User Interface

[ AIRS Architecture ]

Protecode

IdentificationInfo AutoIdentifyService

Protex IdentificationInfo

ProtexAutoIdentify Service

Palamida IdentificationInfo

PalamidaAuto IdentifyService

Protecode

IdentificationInfo

ProtecodeAuto IdentifyService

SPDX Parser SPDXService

Derived from SPDX-tools

Other verification tool supportable

Page 29: Piloting SPDX in Samsung

29/31

Feedback to Standard

Page 30: Piloting SPDX in Samsung

30/31

Feedback to SPDX

Modification of “Artifact of Project” fields

- Cardinality: “Optional, One” “Optional, one or many”

- Specific derived-file information is necessary

• Currently, DOAP is used less detailed.

Package Hierarchy

- Deal with sub-packages (no specification)

- Connectivity to other packages

Patternize license comment

- Provide license comment patterns for better-automation

- ex) This file is derived from APACHE-COMMONS.jar <derivedFrom>apache-commons.jar</derivedFrom>

Force common rule for file path

- File path is important for comparing/auto-identifying.

• Path can be started from “./”, “/”, “<package_file_name>/”

- Common rule is necessary.

Summary of Derived project information in package info

- When details of derived project are needed, only file info section can give them, however this way can produce highly redundant data.

Page 31: Piloting SPDX in Samsung

31/31

Q&A