├── .gitignore ├── Gemfile ├── Makefile ├── README.md ├── _config.yml ├── _includes └── extra │ ├── my-style.scss │ └── styles.scss └── scanner ├── 1_prechecker.md ├── 2_source.md ├── 3_dependency.md ├── 4_binary.md ├── 5_yocto.md ├── 6_android.md ├── 7_scanner_service.md ├── README.md ├── etc ├── README.md ├── binary_db.md └── guide_virtualenv.md └── images ├── 7_fl_ss_analysis_result.png ├── 7_fl_ss_create_project.png ├── 7_fl_ss_detected_opensource.png ├── 7_fl_ss_login.png ├── 7_fl_ss_newproject.png ├── 7_fl_ss_ssh.png ├── add.gif ├── convert.gif ├── fosslight_depenency_graph.png ├── fosslight_prechecker_add_test_result.JPG ├── fosslight_reuse_add_test.JPG ├── fosslight_reuse_report.JPG ├── fosslight_scanner.png ├── fosslight_scanner_overview.png ├── lint.gif └── table_schema.png /.gitignore: -------------------------------------------------------------------------------- 1 | Gemfile.lock 2 | _site/ 3 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem "jekyll-rtd-theme" 4 | 5 | gem "github-pages", group: :jekyll_plugins 6 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | DEBUG=JEKYLL_GITHUB_TOKEN=blank PAGES_API_URL=http://0.0.0.0 2 | 3 | default: 4 | @gem install jekyll bundler && bundle install 5 | 6 | update: 7 | @bundle update 8 | 9 | clean: 10 | @bundle exec jekyll clean 11 | 12 | build: clean 13 | @${DEBUG} bundle exec jekyll build --profile --config _config.yml,.debug.yml 14 | 15 | server: clean 16 | @${DEBUG} bundle exec jekyll server --livereload --config _config.yml,.debug.yml 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ```note 2 | 이 페이지는 Deprecated 되었습니다. 3 | FOSSLight Guide는 https://github.com/fosslight/hub-guide/을 참고해 주시기 바랍니다. 4 | ``` 5 | 6 | 7 | # FOSSLight 8 | 9 | FOSSLight 프로젝트는 오픈 소스에 관한 모든 것을 관리할 수 있는 통합 시스템인 [FOSSLight Hub](https://fosslight.org/ko/fosslight)와 오픈 소스를 분석할 수 있는 [FOSSLight Scanner](https://fosslight.org/ko/scanner/) 로 구성되어있습니다. 10 | 11 | ## FOSSLight Hub 12 | 13 | FOSSLight Hub는 오픈 소스와 라이선스를 관리하고 오픈 소스 준수 절차를 순차적으로 처리하는 통합 시스템일 뿐만 아니라, 보안 취약점 관리, 공급망 관리, 소프트웨어 BOM(Bill of Materials) 및 오픈 소스와 관련된 모든 것을 관리할 수 있는 올인원 시스템입니다. 14 | [가이드](https://fosslight.org/hub-guide/) 페이지에서 FOSSLight Hub의 기본 사용법과 튜토리얼, 개발 환경 설정 방법 및 유지 관리 팁과 같은 고급 기능을 설명합니다. 15 | 16 | # FOSSLight Scanner 17 | 18 | [FOSSLight Scanner](scanner)는 Prechecker, Dependency Scanner, Source Scanner, Binary Scanner 4가지의 스캐너로 구성되어 있으며, FOSSLight Scanner를 통해 4개 스캐너의 통합 결과를 생성하도록 수행할 수 있습니다. 19 |

20 | ![](scanner/images/fosslight_scanner_overview.png){: width="80%" .center} 21 |
22 | 23 | 각 Scanner에 대한 설치 및 사용 방법에 대한 가이드는 FOSSLight Scanner 하위 가이드 페이지에서 확인하실 수 있습니다. 24 | #### FOSSLight Prechecker 25 | [FOSSLight Prechecker](scanner/1_prechecker.md)는 소스 코드 내에 저작권 및 라이선스 규칙을 준수했는지 확인하고 또 저작권 및 라이선스, Download Location 정보를 쉽게 추가할 수 있도록 도와주는 도구로, 잘 활용할수록 불필요한 오픈소스 스캐닝을 막을 수 있습니다. 예를 들어 개발 초기부터 FOSSLight Prechecker를 활용하여 직접 개발한 소스 코드와 오픈소스 코드에 대하여 저작권 및 라이선스, Download Location 정보를 명확하게 표기하도록 관리한다면 별도의 스캐닝 작업 없이도 오픈소스 사용을 정확하게 파악할 수 있습니다. 26 | 27 | #### FOSSLight Source Scanner 28 | [FOSSLight Source Scanner](scanner/2_source.md)는 소스 코드 스캐닝을 수행하는 도구로, 소스 코드의 문자열을 검색하여 저작권과 라이선스 문구를 검출하는 ScanCode와 코드 조각 스캐닝을 지원하는 scanoss를 이용하여 오픈소스 분석을 수행합니다. 29 | 30 | #### FOSSLight Dependency Scanner 31 | [FOSSLight Dependency Scanner](scanner/3_dependency.md)는 여러 패키지 매니저에 대한 종속성 분석을 통하여 오픈소스 정보를 추출하는 도구로, 패키지 매니저의 Manifest 파일을 자동으로 감지하고 각 패키지 매니저별로 종속성을 분석한 후 오픈소스 정보가 포함된 보고서 파일을 생성합니다. 이때 재귀적으로 종속성 분석을 해주기 때문에, 1차 종속성만 분석하는 디펜던시 스캐너에 비해 실제 사용된 모든 오픈소스 정보를 추출할 수 있습니다. 32 | 33 | #### FOSSLight Binary Scanner 34 | [FOSSLight Binary Scanner](scanner/4_binary.md)는 바이너리 형태의 파일을 찾아서 바이너리 파일 목록을 추출한 후, 연계된 데이터베이스에 검출한 바이너리의 오픈소스 정보가 있다면 자동으로 오픈소스 정보를 출력해주는 도구입니다. 이는 바이너리 자체를 분석하는 방법이 아니기 때문에, 데이터베이스 정보가 많아야 바이너리 분석이 잘 수행될 수 있으니 참고하시기 바랍니다. 35 | 36 | #### FOSSLight Android Scanner 37 | [FOSSLight Android Scanner](scanner/6_android.md)는 Android 모델에 탑재되는 Binary를 모두 나열하여 각 Binary 별로 Open Source가 사용되었는지 확인하고, 고지해야 할 사항이 OSS 고지문(ex. NOTICE.html)에 적절하게 포함되었는지 확인하기 위해 수행합니다. 38 | 39 | #### FOSSLight Yocto Scanner 40 | [FOSSLight Yocto Scanner](scanner/5_yocto.md)는 Yocto Project에 기반하여 build 시, rootfs 이미지에 포함되는 Package에 대한 OSS 정보를 FOSS Report 형식으로 출력해주는 Python Script입니다. 41 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | base_url: /fosslight-guide 2 | title: FOSSLight Scanner Guide 3 | lang: ko 4 | description: FOSSLight Scanner Korean Guide 5 | 6 | remote_theme: fosslight/guide_theme 7 | 8 | top_link: "https://fosslight.github.io/fosslight-guide-en" 9 | top_link_word: "English" 10 | 11 | addons_title: "FOSSLight Homepage" 12 | addons_url: "https://fosslight.org/ko" 13 | 14 | google: 15 | gtag: UA-196813776-3 16 | 17 | readme_index: 18 | with_frontmatter: true 19 | 20 | exclude: 21 | - Makefile 22 | - Gemfile 23 | - Gemfile.lock 24 | 25 | plugins: 26 | - jemoji 27 | - jekyll-avatar 28 | - jekyll-mentions 29 | -------------------------------------------------------------------------------- /_includes/extra/my-style.scss: -------------------------------------------------------------------------------- 1 | .dl-table { 2 | a { 3 | @supports ((text-decoration-thickness: initial) and (text-underline-offset: initial)) { 4 | text-underline-offset: .8rem; 5 | } 6 | @supports not ((text-decoration-thickness: initial) and (text-underline-offset: initial)) { 7 | padding-bottom: .45rem; 8 | } 9 | } 10 | 11 | .btn, .gumroad-button { 12 | margin: 1rem 0; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /_includes/extra/styles.scss: -------------------------------------------------------------------------------- 1 | $primary-color: #A50034; 2 | $secondary-color: #444444; 3 | 4 | .header { 5 | color : $secondary-color; 6 | background: $primary-color; 7 | } 8 | 9 | .sidebar { 10 | color: $primary-color; 11 | background: $secondary-color; 12 | } 13 | 14 | .toctree { 15 | color: $primary-color; 16 | } 17 | 18 | input.form-control { 19 | border-color: #3E4538; 20 | } 21 | 22 | a.caption { 23 | color: lighten($primary-color, 20%) !important; 24 | } 25 | 26 | .dl-table { 27 | a { 28 | @supports ((text-decoration-thickness: initial) and (text-underline-offset: initial)) { 29 | text-underline-offset: .8rem; 30 | } 31 | @supports not ((text-decoration-thickness: initial) and (text-underline-offset: initial)) { 32 | padding-bottom: .45rem; 33 | } 34 | } 35 | 36 | .btn, .gumroad-button { 37 | margin: 1rem 0; 38 | } 39 | } 40 | 41 | .center { 42 | display: block; 43 | margin: auto; 44 | } 45 | .right { 46 | text-align: right; 47 | font-size: small; 48 | a { 49 | text-decoration: none; 50 | } 51 | } 52 | 53 | .emphasis_text { 54 | font-weight: bolder; 55 | text-decoration: none; 56 | color: rgb(191, 13, 63); 57 | font-size: 1.2rem; 58 | } 59 | 60 | .flex-container { 61 | display: flex; 62 | justify-content: space-around; 63 | flex-wrap: wrap; 64 | } 65 | 66 | .flex-container > .flex-contents { 67 | display: block; 68 | border: 1px solid rgb(191, 13, 63); 69 | margin-bottom: 1rem; 70 | padding: 20px; 71 | width: 70%; 72 | height: 24rem; 73 | 74 | @media (min-width: 48em) { 75 | width: 47.5%; 76 | margin-right: 5%; 77 | 78 | &:last-of-type, 79 | &:nth-child(2n + 2) { 80 | margin-right: 0; 81 | } 82 | } 83 | 84 | @media (min-width: 75em) { 85 | width: 30%; 86 | margin-right: 5%; 87 | 88 | &:nth-child(2n + 2) { 89 | margin-right: 5%; 90 | } 91 | 92 | &:last-of-type, 93 | &:nth-child(3n + 3) { 94 | margin-right: 0; 95 | } 96 | } 97 | } 98 | 99 | .flex-container > .flex-contents:hover { 100 | background-color: rgb(209, 143, 154); 101 | 102 | #feature_title { 103 | color: white; 104 | } 105 | } 106 | 107 | #feature_title { 108 | display: block; 109 | margin: initial; 110 | color: rgb(197, 103, 119); 111 | font-size: 1.5rem; 112 | padding-top: 1rem; 113 | width: 100%; 114 | height: 20%; 115 | font-weight: bold; 116 | text-align: center; 117 | line-height: normal; 118 | } 119 | 120 | #feature_img { 121 | display: block; 122 | margin: initial; 123 | padding-top: 2rem; 124 | width: 100%; 125 | height: 30%; 126 | text-align: center; 127 | } 128 | 129 | #feature_content { 130 | display: block; 131 | margin: initial; 132 | color: black; 133 | font-size: 1rem; 134 | padding-top: 3rem; 135 | width: 100%; 136 | font-weight: initial; 137 | text-align: center; 138 | line-height: normal; 139 | } 140 | 141 | .home_contents :hover { 142 | opacity: 0.7; 143 | } 144 | 145 | 146 | 147 | * { box-sizing: border-box; } 148 | 149 | body { 150 | background-color: #fff; 151 | color: #fff; 152 | margin: 0; 153 | min-height: 100%; 154 | } 155 | 156 | .person-container { width: 100%;} 157 | 158 | .persons { 159 | padding: 20px auto; 160 | max-width: 1000px; 161 | margin: 0px auto; 162 | position: relative; 163 | } 164 | 165 | .persons:before, 166 | .persons:after { 167 | clear: both; 168 | content: " "; 169 | display: table; 170 | } 171 | 172 | .persons .person { 173 | width: 17%; 174 | margin: 14px; 175 | display: table; 176 | float: left; 177 | border-left: 5px solid transparent; 178 | cursor: pointer; 179 | border: 1px solid #A50034; 180 | } 181 | 182 | .persons .person .avatar { 183 | width: 100%; 184 | display: block; 185 | text-align: center; 186 | margin: 5px 0 0; 187 | } 188 | 189 | .persons .person .avatar img { 190 | display: inline-block; 191 | vertical-align: middle; 192 | width: 64px; 193 | } 194 | 195 | .persons .person.active { background-color: rgb(197, 103, 119); } 196 | 197 | .persons .person.active .fullname { color:#fff; } 198 | 199 | .persons .person .fullname { 200 | width: 100%; 201 | display: block; 202 | text-align: center; 203 | font-family: Raleway, sans-serif; 204 | color: black; 205 | font-size: 20px; 206 | padding: 5px 0 5px; 207 | font-weight: bold; 208 | } 209 | 210 | .persons .person .title { 211 | width: 100%; 212 | display: block; 213 | text-align: center; 214 | font-family: Raleway, sans-serif; 215 | color: black; 216 | font-size: 16px; 217 | } 218 | 219 | .persons .person .js-description { display: none; } 220 | @media screen and (max-width: 700px) { 221 | 222 | .persons .person { width: 50%; } 223 | } 224 | @media screen and (max-width: 400px) { 225 | 226 | .persons .person { 227 | width: 100%; 228 | border-left: medium none; 229 | } 230 | } 231 | 232 | .persons .js-dropdown { 233 | background-clip: padding-box !important; 234 | box-sizing: border-box; 235 | float: left; 236 | padding: 10px 0 10px; 237 | margin: 20px 0 10px; 238 | width: 100%; 239 | display: table; 240 | } 241 | 242 | .persons .js-dropdown:before, 243 | .persons .js-dropdown:after { 244 | clear: both; 245 | content: " "; 246 | display: table; 247 | } 248 | @media screen and (max-width: 400px) { 249 | 250 | .persons .js-dropdown { border-left: medium none; } 251 | } 252 | 253 | .persons .js-dropdown .js-dropdown-content { 254 | background: none repeat scroll 0 0 #FFFFFF; 255 | border: 4px solid rgb(197, 103, 119); 256 | color: black; 257 | position: relative; 258 | width: 100%; 259 | padding: 10px 10px 10px; 260 | } 261 | 262 | .persons .js-dropdown .js-dropdown-content .js-dropdown-arrow { 263 | position: absolute; 264 | bottom: 100%; 265 | left: 50%; 266 | width: 0; 267 | height: 0; 268 | margin-left: -45px; 269 | border: 46px solid transparent; 270 | border-bottom-color: rgb(197, 103, 119); 271 | pointer-events: none; 272 | -webkit-transition: left 0.3s; 273 | -moz-transition: left 0.3s; 274 | transition: left 0.3s; 275 | } 276 | 277 | .persons .js-dropdown .js-dropdown-content p { 278 | line-height: 26px; 279 | margin: 0 0 40px; 280 | padding: 0; 281 | font-size: 16px; 282 | } 283 | 284 | //style 추가 285 | $border-color: #DDDDDD; // 테두리 색상 286 | $highlight-color: #0066CC; // 강조 색상 287 | $font-family: 'Courier New'; // 폰트 패밀리 288 | $padding: 2px 6px; // 패딩 289 | $border-radius: 4px; // 테두리 반경 290 | 291 | // 테이블 스타일 292 | table { 293 | width: 100%; 294 | border-collapse: collapse; 295 | } 296 | 297 | // 강조 스타일 298 | .highlight { 299 | font-family: $font-family; 300 | font-weight: 600; 301 | color: $highlight-color; 302 | border: 1px solid $border-color; 303 | padding: $padding; 304 | border-radius: $border-radius; 305 | } 306 | 307 | .highlight-black { 308 | font-family: $font-family; 309 | font-weight: 600; 310 | border: 1px solid $border-color; 311 | padding: $padding; 312 | border-radius: $border-radius; 313 | } 314 | 315 | .highlight_table { 316 | font-weight: bold; /* 글씨 굵게 */ 317 | padding: 6px 12px; /* 여백 추가 */ 318 | display: inline-block; 319 | } 320 | 321 | .gray-text { 322 | color: gray; 323 | } 324 | 325 | // 도트 및 화살표 스타일 326 | .large-dot { 327 | font-size: 1em; // 도트 크기 조정 328 | color: inherit; // 기본 텍스트 색상으로 설정 329 | } 330 | 331 | 332 | // 설명 스타일 333 | .description { 334 | padding-left: 20px; // 왼쪽 여백 추가 335 | } 336 | 337 | //h3 제목 스타일 338 | .specific-title { 339 | font-size: 16px !important; 340 | color: #000000; 341 | text-align: left; 342 | margin-top: 5px; 343 | margin-bottom: 0; // 제목 아래의 간격을 없앰 344 | padding: 7px; 345 | border: none; 346 | background: linear-gradient(to bottom, #ffe4e1, #fff3f3); /* 회색에서 핑크로 그라데이션 */ 347 | //background-color: #ffe4e1; 348 | border-radius: 5px; 349 | display: inline-block; 350 | border-left: 3px solid #f8a8a8; 351 | /*width: 100%; */ 352 | } 353 | 354 | //h2 제목 스타일 355 | .left-bar-title { 356 | color: #000000; 357 | text-align: left; 358 | padding: 10px 2px; /* 패딩으로 높이를 조절 */ 359 | padding-left: 15px; 360 | //border-left: 10px solid #413f3f; 361 | border-left: 5px solid #777575; 362 | border-radius: 5px; 363 | display: block; 364 | background-color:#E6E6E6; 365 | background: linear-gradient(to bottom, #E6E6E6, #ffffff); 366 | width: 100%; 367 | margin: 150px 0 20px 0; 368 | } 369 | 370 | //h4 제목 스타일 371 | .under-bar-title { 372 | position: relative; // 위치 설정 373 | display: inline-block; 374 | font-size: 0.9rem !important; 375 | // 헤더 아래에 선 추가 376 | &::after { 377 | content: ""; // 가상 요소 생성 378 | display: block; // 블록 요소로 설정 379 | width: calc(100% - 10px); // 텍스트 너비에서 오른쪽 여백을 줄임 380 | height: 2px; // 선의 두께를 2px로 설정 (현재의 2배) 381 | background: linear-gradient(to right, #413f3f, #ffe4e1 ); // 그라데이션 색상 382 | margin-top: 5px; // 헤더와 선 사이의 여백 383 | position: absolute; // 절대 위치 384 | left: 0; // 왼쪽 정렬 385 | bottom: -5px; // 헤더 아래 위치 386 | } 387 | } 388 | 389 | 390 | // h5 제목 스타일 391 | .under-2bar-title { 392 | position: relative; // 위치 설정 393 | display: inline-block; 394 | font-size: 0.85rem !important; 395 | text-indent: 20px; // 텍스트 첫 번째 줄에 20px 들여쓰기 추가 396 | 397 | // 첫 번째 파란색 선 398 | &::after { 399 | content: ""; // 가상 요소 생성 400 | display: block; // 블록 요소로 설정 401 | width: 100%; // 전체 너비 402 | height: 2px; // 선의 두께 403 | background-color: #0000ff; // 파란색 404 | margin-top: 5px; // 제목과 선 사이의 간격 405 | position: absolute; 406 | left: 0; // 왼쪽 정렬 407 | bottom: -5px; // 첫 번째 선의 위치 408 | } 409 | 410 | // 두 번째 파란색 선 411 | &::before { 412 | content: ""; // 가상 요소 생성 413 | display: block; // 블록 요소로 설정 414 | width: 100%; // 전체 너비 415 | height: 2px; // 선의 두께 416 | background-color: #0000ff; // 파란색 417 | margin-top: 2px; // 첫 번째 선과 두 번째 선 사이의 간격 418 | position: absolute; 419 | left: 0; // 왼쪽 정렬 420 | bottom: -7px; // 두 번째 선의 위치 (첫 번째 선보다 아래로) 421 | } 422 | } 423 | 424 | 425 | .markdown-body p, 426 | .markdown-body ul li, 427 | .markdown-body ol li, 428 | .markdown-body details summary, 429 | .markdown-body table th, 430 | .markdown-body table td { 431 | font-size: 0.85rem; /* 폰트 크기 설정 */ 432 | color: inherit; /* 부모의 색상 상속 */ 433 | padding: 1px; /* 셀 안의 여백 조정 */ 434 | } 435 | 436 | 437 | .note { 438 | background-color: #faf9f4; /* 연한 노란색 배경 */ 439 | border: 1px solid #ffeeba; /* 노란색 테두리 */ 440 | color: #5e4701; /* 어두운 노란색 글자 */ 441 | padding: 10px; /* 내부 여백 */ 442 | border-radius: 4px; /* 모서리 둥글게 */ 443 | font-size: 0.85rem; /* 폰트 크기 설정 */ 444 | } 445 | 446 | .youtube-container { 447 | text-align: left; // 왼쪽 정렬 448 | margin-top: 0; // YouTube 비디오 위 간격 449 | margin-bottom: 0; // YouTube 비디오 아래 간격 450 | position: relative; 451 | display: block; // display를 block 새로운 줄에 배치 452 | background-color: #f5f5f5; // 배경 색상 453 | padding: 10px; // 여백을 줄여서 비디오 주변 공간을 최소화 454 | border-radius: 8px; 455 | width: 560px; // 고정된 YouTube iframe의 너비 456 | height: 315px; // 고정된 YouTube iframe의 높이 457 | margin-left: 0; // 왼쪽 정렬을 확실하게 적용하기 위해서 margin-left 추가 458 | margin-right: 0; // 오른쪽 여백을 없애기 459 | 460 | iframe { 461 | width: 100%; // iframe을 div 크기에 맞게 조정 462 | height: 100%; // iframe 높이를 부모 요소의 높이에 맞게 설정 463 | display: block; // 블록 요소로 설정 464 | margin: 0; // 여백을 0으로 설정하여 왼쪽으로 정렬 465 | border-radius: 8px; 466 | } 467 | } 468 | 469 | 470 | .styled-image { 471 | max-width: 100%; /* 화면 크기에 맞게 이미지를 크기 조정 */ 472 | height: auto; /* 비율을 유지하면서 높이 자동 설정 */ 473 | display: block; /* 블록 요소로 설정하여 새로운 줄에 배치 */ 474 | float: none; /* <-- 명시적으로 float 제거 */ 475 | clear: both; 476 | margin: 0; /* 여백을 0으로 설정 */ 477 | margin-right: 20px; /* 이미지와 텍스트 사이에 간격 추가 */ 478 | margin-bottom: 20px; 479 | border: 2px solid #ddd; /* 얇은 테두리 추가 */ 480 | border-radius: 8px; /* 둥근 테두리 */ 481 | box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1); /* 부드러운 그림자 */ 482 | } 483 | 484 | 485 | .styled-image_nofloat { 486 | max-width: 100%; /* 화면 크기에 맞게 이미지를 크기 조정 */ 487 | display: block; /* 블록 요소로 설정하여 새로운 줄에 배치 */ 488 | margin: 0; /* 여백을 0으로 설정 */ 489 | margin-right: 20px; /* 이미지와 텍스트 사이에 간격 추가 */ 490 | margin-bottom: 20px; /* 이미지 아래에 20px의 마진 추가 */ 491 | border: 2px solid #ddd; /* 얇은 테두리 추가 */ 492 | border-radius: 8px; /* 둥근 테두리 */ 493 | box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1); /* 부드러운 그림자 */ 494 | clear: both; /* float된 요소 아래로 텍스트가 내려가도록 처리 */ 495 | } 496 | 497 | .list-with-dot { 498 | padding-left: 10px; 499 | margin: 0; 500 | list-style-type: disc; 501 | } -------------------------------------------------------------------------------- /scanner/1_prechecker.md: -------------------------------------------------------------------------------- 1 | --- 2 | published: true 3 | title: FOSSLight Prechecker 4 | --- 5 | # FOSSLight Prechecker 6 | 7 | License Current python package version. [![REUSE status](https://api.reuse.software/badge/github.com/fosslight/fosslight_prechecker)](https://api.reuse.software/info/github.com/fosslight/fosslight_prechecker) 8 | 9 | [**FOSSLight Prechecker**](https://github.com/fosslight/fosslight_prechecker)는 [reuse-tool][ret]을 이용하여 [소스 코드의 저작권 및 License 표기 규칙][rule]을 준수하는지 확인하고 보완하기 위해 사용할 수 있는 도구입니다. 10 | 11 | [ret]: https://github.com/fsfe/reuse-tool 12 | [rule]: https://opensource.lge.com/guide/19 13 | 14 | **Github Repository** : [https://github.com/fosslight/fosslight_prechecker](https://github.com/fosslight/fosslight_prechecker) 15 | **License** : [GPL-3.0-only](https://github.com/fosslight/fosslight_prechecker/blob/main/LICENSE) 16 | 17 | ## 목차 18 | - [필요 조건](#-필요-조건) 19 | - [설치 방법](#-설치-방법) 20 | - [실행 방법](#-실행-방법) 21 | - [결과](#-결과) 22 | - [동작 방식](#-동작-방식) 23 | 24 | ## 📋 필요 조건 25 | [**FOSSLight Prechecker**](https://github.com/fosslight/fosslight_prechecker)는 Python 3.7+ 기반에서 동작합니다. 26 | 27 | ## 🎉 설치 방법 28 | FOSSLight Prechecker는 pip3를 이용하여 설치할 수 있습니다. 29 | [python 3.7 + virtualenv](etc/guide_virtualenv.md) 환경에서 설치할 것을 권장합니다. 30 | ``` 31 | $ pip3 install fosslight_prechecker 32 | ``` 33 | 34 | ## 🚀 실행 방법 35 | FOSSLight Prechecker 다음 세가지 모드를 가지고 있습니다. 36 | 1. `lint` --- [Source Code 내 저작권 및 License 표기 규칙][rule]을 준수하는지 체크합니다. 37 | 2. `convert` --- [sbom-info.yaml](https://github.com/fosslight/fosslight_prechecker/blob/main/tests/convert/sbom-info.yaml) 또는 [oss-pkg-info.yaml](https://github.com/fosslight/fosslight_prechecker/blob/main/tests/convert/oss-pkg-info.yaml)을 [fosslight_report.xlsx](https://github.com/fosslight/fosslight-guide/blob/master/learn/2_fosslight_report.md)로 변환합니다. 38 | - yaml 파일을 fosslight_report.xlsx의 SRC Sheet로 변환 39 | 3. `add` --- Copyright와 License가 없는 파일에 Copyright, License, 그리고 Download Location을 추가합니다. 40 | 4. `download` --- sbom-info.yaml 파일에 작성된 License의 원문을 각각의 파일로 다운로드 합니다. 41 | 42 | ``` 43 | $ fosslight_prechecker [Mode] [option1] [option2] ... 44 | ``` 45 | 46 | ### Mode별 실행 방법 및 Parameters 47 | * Required parameter : **Mode** 48 | * Optional parameter : **Options** 49 | 50 | ``` 51 | Mode 52 | lint (Default) 저작권 및 License 표기 규칙 준수 확인 53 | convert sbom-info.yaml or oss-pkg-info.yaml -> fosslight_report.xlsx로 변환 54 | add 소스 코드에 Copyright와 License 추가 55 | download sbom-info.yaml or oss-pkg-info.yaml 파일에 작성된 License의 원문을 파일로 다운로드 56 | 57 | Options: 58 | -h 설명 메시지 출력 59 | -v FOSSLight Prechecker 버전 출력 60 | -p 체크할 소스 경로 61 | -e 분석시 제외할 경로('lint' mode에서만 동작, Pattern 매칭 가능) 62 | -f 결과 파일 포맷 (yaml, xml, html) 63 | -o 결과 파일 이름 지정 64 | -n venv, node_modules, ./ 에 대하여 분석 제외하지 않으려면 추가 65 | -i log 파일 미생성 및 Progress bar 제거 66 | 67 | Options for only 'add' mode 68 | -l 추가할 라이선스 (SPDX License Identifer) 69 | -c 추가할 저작권 (ex, ) 70 | -u 추가할 Download Location(ex, https://www.testurl.com) 71 | 72 | Option for 'download' mode 73 | -l 대표 라이선스 파일로 생성할 라이선스 (SPDX License Identifer) 74 | ``` 75 | - 📃 [Pattern 매칭 가이드](https://scancode-toolkit.readthedocs.io/en/stable/cli-reference/scan-options-pre.html?highlight=ignore#glob-pattern-matching) 76 | 77 | 78 | **(Windows인 경우)** 실행 파일을 이용한 방법 79 | 1. [FOSSLight Prechecker - Release](https://github.com/fosslight/fosslight_prechecker/releases) 에서 fosslight_prechecker_windows.exe를 다운로드 80 | 2. 두 가지 실행 방법 81 | 2-1. 실행 파일을 원하는 path로 이동 후 더블 클릭하여 실행 82 | * Default 모드인 Lint mode만 실행 83 | 2-2. command로 실행 84 | * 'cmd' 실행 85 | * 파일이 위치한 Path에서 'Mode별 실행 방법 및 Parameters'와 같이 실행 86 | * ex) fosslight_prechecker lint -p src/ 87 | 88 | 89 | ## 📁 결과 90 | ### 🔖 lint mode 91 | 92 | **1) 특정 경로분석 예시** 93 | ``` 94 | (venv)$ fosslight_prechecker lint -p /home/tests -o result.yaml 95 | ``` 96 | - 실행 결과 97 |
 98 |        Checking copyright/license writing rules:
 99 |           Compliant: Not OK
100 |           Files without copyright:
101 |           - add/test_no_copyright.py
102 |           Files without license:
103 |           - add/test_no_license.py
104 |           Files without license and copyright: N/A
105 |           Summary:
106 |             Detected Licenses:
107 |             - '-'
108 |             - GPL-3.0-only
109 |             - MIT
110 |             Files without copyright / total: 1 / 14
111 |             Files without license / total: 1 / 14
112 |             Open Source Package File:
113 |             - convert/oss-pkg-info.yaml
114 |             - add/oss-pkg-info.yaml
115 |           Tool Info:
116 |             Analyze path: tests
117 |             OS: Linux 4.15.0-144-generic
118 |             Python version: 3
119 |             fosslight_prechecker version: fosslight_prechecker v2.2.0  
120 | 121 | **2) 특정 파일 분석 예시** 122 | ``` 123 | (venv)$ fosslight_prechecker lint -p "src/file1.py,src/file2.py" 124 | ``` 125 | - 실행 결과 126 |
127 |         # src/file1.py
128 |         * License: 
129 |         * Copyright: 
130 | 
131 |         # src/file2.py
132 |         * License: GPL-3.0-only
133 |         * Copyright: Copyright (c) 2022 LG Electronics Inc.
134 | 
135 |         Checking copyright/license writing rules:
136 |           Compliant: Not OK
137 |           Files without copyright: N/A
138 |           Files without license: N/A
139 |           Files without license and copyright:
140 |           - src/fosslight_prechecker/_precheck.py
141 |           Summary:
142 |             Detected Licenses: N/A
143 |             Files without copyright / total: 1 / 2
144 |             Files without license / total: 1 / 2
145 |             Open Source Package File: []
146 |           Tool Info:
147 |             Analyze path: /home/jaekwonbang/tests
148 |             OS: Linux 4.15.0-144-generic
149 |             Python version: 3
150 |             fosslight_prechecker version: fosslight_prechecker v2.2.0  
151 | 152 | 153 |
154 | 결과 출력 항목 155 | 포맷에 따라 결과로 출력되는 항목이 다를 수 있습니다.(Default 포맷 : yaml) 156 | 157 | - **Compliant**: lint 결과가 Compliant한지 여부 (OK or Not OK) 158 | - **Files without copyright**: Copyright가 없는 파일 리스트 159 | - **Files without license**: License가 없는 파일 리스트 160 | - **Files without license and copyright**: Copyright와 License 모두 없는 파일 리스트 161 | - **Summary** 162 | - **Detected Licenses**: 검출된 License 163 | - **Files without copyright / total:** Copyright 없는 파일 수 / 전체 파일 수 164 | - **Files without license / total**: License 없는 파일 수 / 전체 파일 수 165 | - **Files without copyright / total**: Copyright 없는 파일 수 / 전체 파일 수 166 | - **Open Source Package File**: sbom-info*.yaml 또는 oss-pkg-info*.yaml 파일 리스트 167 | - **Tool Info** 168 | - **Analysis path**: 분석 진행한 path 169 | - **OS**: FOSSLight Prechecker가 실행된 OS 버전 170 | - **Python version**: FOSSLight Prechecker가 실행된 Python 버전 171 | - **fosslight_prechecker version**: FOSSLight Prechecker 버전 172 | 173 | >
174 | >파일 개수 산정 시, 제외 항목 175 | > 176 | > - 숨김 파일 177 | > - 파일 내 Code가 전혀 없는 파일 178 | > - .gitignore에 정의된 파일 179 | > - git repo 기준 untracked 파일 180 | > - FOSSLight의 산출물 181 | > - sbom-info.yaml 또는 oss-pkg-info.yaml 내에 exclude가 True인 path 182 | >
183 |
184 | 185 | 186 | 187 |
188 | Demo 영상 (lint) 189 | demo video for lint mode 190 |
191 | 192 | 193 | ### 🔖 convert mode 194 | **1) Path 내 존재하는 sbom-info.yaml 또는 oss-pkg-info.yaml (여러개인 경우 전체 해당) -> fosslight_report.xlsx 변환 예시** 195 | ``` 196 | $ fosslight_prechecker convert -p tests/ 197 | ``` 198 | 199 | **2) 실행 결과 파일 예시** 200 | 201 | >
202 | > oss-pkg-info.yaml 파일 203 | > yaml 파일 내 경로 작성 시, 특수 문자({, }, [, ], &, *, #, ?, |, -, <, >, =, !, %, @)로 시작하는 경우 쌍따옴표("")를 사용하여 작성해주시기 바랍니다. 204 | ```yaml 205 | glibc: 206 | - version: '2.3' 207 | source name or path: 208 | - tests/b.c 209 | - tests/a.c 210 | license: 211 | - GPL-3.0 212 | - LGPL-2.1 213 | download location: https://github.com/fsfe/glibc 214 | dbus: 215 | - version: '1.3' 216 | source name or path: 217 | - tests/src/* 218 | license: 219 | - GPL-2.0 220 | download location: https://github.com/fsfe/dbus 221 | copyright text: 'Copyright (c) 2020 Test Copyright (c) 2020 Sample' 222 | reuse-tool: 223 | - version: '' 224 | source name or path: 225 | - tests/ 226 | license: 227 | - MIT 228 | download location: https://github.com/fsfe/reuse 229 | homepage: http://google.com 230 | copyright text: Copyright (c) 2020 Test 231 | build-tool: 232 | - version: '' 233 | source name or path: 234 | - tests/ 235 | license: 236 | - Apache-2.0 237 | download location: http://gihub.com/bazel 238 | exclude: true 239 | ``` 240 | >
241 | 242 | >
243 | > fosslight_report.xlsx 파일 244 | FOSSLight Report 245 | >
246 | 247 |
248 | Demo 영상 (convert) 249 | demo video for convert mode 250 |
251 | 252 | 253 | 254 | ### 🔖 add mode 255 | **1) 특정 경로 내 파일에 저작권과 라이선스 추가 예시** 256 | ``` 257 | (venv)$ fosslight_prechecker add -p tests/add -c "2019-2021 LG Electronics Inc." -l "GPL-3.0-only" -u "https://www.testurl.com" 258 | ``` 259 | 260 | **2) 특정 파일에 저작권과 라이선스 추가 예시** 261 | ``` 262 | (venv)$ fosslight_prechecker add -p "tests/add/test_both_have_1.py,tests/add/test_both_have_2.py,tests/add/test_no_copyright.py,tests/add/test_no_license.py" -c "2019-2021 LG Electronics Inc." -l "GPL-3.0-only" -u "https://www.testurl.com" 263 | ``` 264 | 265 | **3) 실행 결과** 266 | ▪️ 파일 변경 사항 : 상단에 저작권과 라이선스 추가 267 | 268 | |Before |After | 269 | |:---------------|:--------------| 270 | |![Before](images/fosslight_reuse_add_test.JPG)|![After](images/fosslight_prechecker_add_test_result.JPG)| 271 | 272 | ```bash 273 | # File list that have both license and copyright : 3 / 7 274 | # __init__.py 275 | * License: 276 | * Copyright: 277 | 278 | # test_both_have_1.py 279 | * License: GPL-3.0-only 280 | * Copyright: SPDX-FileCopyrightText: Copyright 2019-2021 LG Electronics Inc. 281 | 282 | # test_both_have_2.py 283 | * License: MIT 284 | * Copyright: SPDX-FileCopyrightText: Copyright (c) 2011 LG Electronics Inc. 285 | 286 | # Missing license File(s) 287 | * test_no_license.py 288 | * Your input license : GPL-3.0-only 289 | Successfully changed header of tests/add_result/test_no_license.py 290 | 291 | # Missing Copyright File(s) 292 | * test_no_copyright.py 293 | * Your input Copyright : Copyright 2019-2021 LG Electronics Inc. 294 | Successfully changed header of tests/add_result/test_no_copyright.py 295 | 296 | # Adding Download Location into your files 297 | * Your input DownloadLocation : https://www.testurl.com 298 | Successfully changed header of tests/add_result/test_no_copyright.py 299 | Successfully changed header of tests/add_result/test_no_license.py 300 | Successfully changed header of tests/add_result/test_both_have_1.py 301 | Successfully changed header of tests/add_result/test_both_have_2.py 302 | ``` 303 | 304 |
305 | Demo 영상 (add) 306 | demo video for add mode 307 |
308 | 309 | ### 🔖 download mode 310 | **1) sbom-info.yaml 내 기입된 라이선스를 Text 파일로 Download 예시** 311 | ``` 312 | (venv)$ fosslight_prechecker download -p tests/src 313 | ``` 314 | 315 | **2) sbom-info.yaml 내 기입된 라이선스를 Text 파일로 Download + 대표 라이선스 파일 생성 예시** 316 | ``` 317 | (venv)$ fosslight_prechecker download -p tests/src -l "Apache-2.0" 318 | ``` 319 | 320 | 321 | ## 🔍 동작 방식 322 | ### 🔖 lint mode 323 | 1. OSS Package Information 파일 존재 여부 체크 324 |
325 | 하기 파일 중 1개 이상 존재하는지 체크 (대소문자 구분 없음) 326 |
    327 |
  • sbom-info.yaml (or .yml)
  • 328 |
  • oss-pkg-info.yaml (or .yml
  • 329 |
  • requirement.txt
  • 330 |
  • requirements.txt
  • 331 |
  • package.json
  • 332 |
  • pom.xml
  • 333 |
  • build.gradle
  • 334 |
  • Podfile.lock
  • 335 |
  • Cartfile.resolved
  • 336 |
  • pubspec.yaml
  • 337 |
  • Package.resolved
  • 338 |
  • go.mod
  • 339 |
  • packages.config
  • 340 |
  • package.assets.json
  • 341 |
  • oss-package.info
  • 342 |
  • "MODULE_LICENSE_ "로 시작하는 파일
  • 343 |
344 |
345 | 346 | 2. fsfe-reuse lint 실행 347 | 2-1. path 단위로 실행하는 경우 348 | - ./reuse/dep5 파일 없으면 생성 349 | - ./reuse/dep5 파일이 이미 존재하는 경우 bk 파일을 복사하고 기본 설정값 추가 350 | - dep5 파일 생성하여 binary 또는 .json, venv/, node_modules/,. */ 파일을 체크 대상에서 제외시킴 351 | - fsfe-reuse lint 실행 (OSS Package Information file이 존재하면, license 정보 없는 파일 목록은 출력하지 않음) 352 | - ./reuse/dep5 파일을 원래대로 복구 (원래 존재한 경우 기존 파일로 복구, 존재하지 않은 경우 삭제) 353 | 354 | 2-2. file 단위로 실행하는 경우 355 | - 파일별 저작권, License 출력 356 | - 단, 파일이 존재하지 않거나 파일이 binary 또는 .json인 경우 출력되지 않음 357 | 3. 결과를 출력하여 지정한 포맷으로 파일로 저장(Default : yaml) 358 | 359 | ### 🔖 convert mode 360 | 1. 변환할 파일의 존재 여부 확인 361 | * 파일 예시 : [sbom-info.yaml][sbom_info], [oss-pkg-info.yaml][oss_pkg_info] 362 | 363 | [sbom_info]: https://github.com/fosslight/fosslight_prechecker/blob/main/tests/convert/sbom-info.yaml 364 | [oss_pkg_info]: https://github.com/fosslight/fosslight_prechecker/blob/main/tests/convert/oss-pkg-info.yaml 365 | 366 | 2. 파일을 변환 367 | 2-1. Path 단위로 실행하는 경우 368 | - 경로 내 존재하는 모든 sbom-info.yaml 또는 oss-pkg-info.yaml 파일을 fosslight_report.xlsx로 변환 369 | 370 | 2-2. 입력한 파일을 변환  371 | - 입력한 yaml 파일을 fosslight_report.xlsx로 변환 372 | - 단, -o 로 output file 명을 지정한 경우 해당 이름으로 결과 파일이 생성 373 | 374 | 375 | ### 🔖 add mode 376 | 1. 추가할 저작권과 라이선스 확인 377 | 2. 저작권과 라이선스 탐색 및 추가 378 | - 저작권과 라이선스가 모두 존재하는 파일 리스트 출력(Add 대상에서 제외) 379 | - -c와 -l 옵션을 이용하여 저작권 또는 라이선스가 없는 파일의 상단에 저작권과 라이선스를 추가 380 | - -u 옵션을 이용하여 Download Location을 파일의 상단에 추가 381 | 382 | 383 | ### 🔖 download mode 384 | 1. 옵션없이 실행시 실행 path 내 sbom-info.yaml을 찾아 yaml 파일 내 작성된 라이선스를 Text 파일로 Download 385 | 2. -l 옵션 사용시, 대표 라이선스로 Download 386 | - 이미 대표 라이선스 파일(LICENSE, LICENSE.txt 등) 존재할 경우, 대표 라이선스 파일을 생성하지 않음. 387 | - 대표 라이선스 파일 존재하지 않을 경우, 해당 라이선스 Text 파일 LICENSE 파일로 생성 388 | 389 | -------------------------------------------------------------------------------- /scanner/2_source.md: -------------------------------------------------------------------------------- 1 | --- 2 | published: true 3 | --- 4 | # FOSSLight Source Scanner 5 | 6 | FOSSLight Source is released under the Apache-2.0 License. Current python package version. [![REUSE status](https://api.reuse.software/badge/github.com/fosslight/fosslight_source_scanner)](https://api.reuse.software/info/github.com/fosslight/fosslight_source_scanner) 7 | 8 | [**FOSSLight Source Scanner**](https://github.com/fosslight/fosslight_source_scanner)는 소스 코드 스캐너인 [ScanCode][sc], [SCANOSS][scanoss]를 이용합니다. [ScanCode][sc]를 이용하면 파일 안에 포함된 Copyright과 License 문구를 검출하고, [SCANOSS][scanoss]를 이용하면 OSS Name, OSS Version, Download Location, Copyright, License 정보를 [OSSKB][osskb]에서 검색합니다. 9 | Build Script, Binary, Directory, 특정 Directory (ex-test) 안의 파일은 제외되고, 그리고 License 이름에서 "-only", "-old-style"와 같은 문구는 제거됩니다. 결과는 spreadsheet, csv 형태로 출력됩니다. 10 | 11 | [sc]: https://github.com/nexB/scancode-toolkit 12 | [scanoss]: https://github.com/scanoss/scanoss.py 13 | [osskb]: https://osskb.org/ 14 | 15 | **Github Repository** : [https://github.com/fosslight/fosslight_source_scanner](https://github.com/fosslight/fosslight_source_scanner) 16 | **License** : [Apache-2.0](https://github.com/fosslight/fosslight_source_scanner/blob/main/LICENSE) 17 | 18 | ## 목차 19 | - [필요 조건](#-필요-조건) 20 | - [설치 방법](#-설치-방법) 21 | - [실행 방법](#-실행-방법) 22 | - [결과](#-결과) 23 | 24 | ## 📋 필요 조건 25 | [**FOSSLight Source Scanner**](https://github.com/fosslight/fosslight_source_scanner)는 Python 3.8+ 기반에서 동작합니다. 26 | 27 | 28 | ## 🎉 설치 방법 29 | FOSSLight Source Scanner는 pip3를 이용하여 설치할 수 있습니다. 30 | [python 3.8 + virtualenv](etc/guide_virtualenv.md) 환경에서 설치할 것을 권장합니다. 31 | 32 | ``` 33 | $ pip3 install fosslight_source 34 | ``` 35 | 36 | ## 🚀 실행 방법 37 | Source Code 분석을 실행한 후 FOSSLight Report 형식으로 출력합니다. 38 | ```` 39 | $ fosslight_source [option] 40 | ```` 41 | #### Options 42 | ``` 43 | Optional 44 | -p Path to analyze source (Default: current directory) 45 | -h Print help message 46 | -v Print FOSSLight Source Scanner version 47 | -m Print additional information for scan result on separate sheets 48 | -e Path to exclude from analysis (file and directory, pattern matching is available) 49 | -o Output path (Path or file name) 50 | -f Output file format (excel, csv, opossum, yaml) 51 | Options only for FOSSLight Source Scanner 52 | -s Select which scanner to be run (scancode, scanoss, all) 53 | -j Generate raw result of scanners in json format 54 | -t Stop scancode scanning if scanning takes longer than a timeout in seconds. 55 | -c Select the number of cores to be scanned with ScanCode. 56 | --no_correction Enter if you don't want to correct OSS information with sbom-info.yaml 57 | --correct_fpath Path to the sbom-info.yaml file 58 | ``` 59 | - -s 옵션이 추가되지 않을 경우 모든 Scanner (ScanCode, SCANOSS)가 동작한 결과가 취합됩니다. 60 | - 📃 [Pattern 매칭 가이드](https://scancode-toolkit.readthedocs.io/en/stable/cli-reference/scan-options-pre.html?highlight=ignore#glob-pattern-matching) 61 | 62 | #### Example 63 | Source Code 분석 후 FOSSLight Report와 json 형태의 ScanCode, SCANOSS 결과 출력 64 | ``` 65 | $ fosslight_source -p /home/source_path -j 66 | ``` 67 | 68 | ## 📁 결과 69 | 70 | ``` 71 | $ tree 72 | . 73 | ├── fosslight_log_220103_1540.txt 74 | ├── fosslight_opossum_220103_1540.json 75 | ├── fosslight_report_220103_1540.xlsx 76 | ├── fosslight_report_220103_1540.csv 77 | ├── scancode_raw_result.json 78 | ├── scanner_output.wfp 79 | └── scanoss_raw_result.json 80 | ``` 81 | - fosslight_log_[datetime].txt : 실행 로그가 저장된 파일 82 | - fosslight_opossum_[datetime].json : [OpossumUI](https://github.com/opossum-tool/OpossumUI)에서 활용 가능한 Source Code 분석 결과 83 | - fosslight_report_[datetime].xlsx : FOSSLight Report 형태의 Source Code 분석 결과 84 | - fosslight_report_[datetime].csv : FOSSLight Report를 csv로 출력한 결과 85 | - scancode_raw_result.json : ScanCode 실행 결과 (fosslight_source 명령어에 -j 옵션이 포함된 경우에만 생성) 86 | - scanner_output.wfp : SCANOSS 실행 시 생성된 Finger Print (fosslight_source 명령어에 -j 옵션이 포함된 경우에만 생성) 87 | - scanoss_raw_result.json : SCANOSS 실행 결과 (fosslight_source 명령어에 -j 옵션이 포함된 경우에만 생성) 88 | -------------------------------------------------------------------------------- /scanner/3_dependency.md: -------------------------------------------------------------------------------- 1 | --- 2 | published: true 3 | title: FOSSLight Dependency Scanner 4 | --- 5 | # FOSSLight Dependency Scanner 6 | 7 | License Current python package version. [![REUSE status](https://api.reuse.software/badge/github.com/fosslight/fosslight_dependency_scanner)](https://api.reuse.software/info/github.com/fosslight/fosslight_dependency_scanner) 8 | 9 | [**FOSSLight Dependency Scanner**](https://github.com/fosslight/fosslight_dependency_scanner)는 여러 패키지 매니저에 대한 종속성 분석을 지원하는 도구입니다. 패키지 매니저의 Manifest 파일을 자동으로 감지하고 오픈 소스 도구를 사용하여 종속성을 분석합니다. 그 후 종속성의 OSS 정보가 포함된 보고서 파일을 생성합니다. 10 | 11 | {::options parse_block_html="true" /} 12 |
13 | 지원하는 Package Manager 14 | - [Gradle](https://gradle.org/) (Java/Android) 15 | - [Maven](http://maven.apache.org/) (Java) 16 | - [NPM](https://www.npmjs.com/) (Node.js) 17 | - [PNPM](https://pnpm.io/) (Node.js) 18 | - [PyPi](https://pip.pypa.io/) (Python) 19 | - [Pub](https://pub.dev/) (Dart with flutter) 20 | - [Cocoapods](https://cocoapods.org/) (Swift/Obj-C) 21 | - [Swift](https://swift.org/package-manager/) (Swift) 22 | - [Carthage](https://github.com/Carthage/Carthage) (Carthage) 23 | - [Go](https://pkg.go.dev/) (Go) 24 | - [Nuget](https://www.nuget.org/) (.NET) 25 | - [Helm](https://helm.sh/) (Kubernetes) 26 | - [Unity](https://unity.com/) (Unity 27 | - [Cargo](https://crates.io/) (Rust) 28 |
29 | {::options parse_block_html="false" /} 30 | 31 | **Github Repository** : [https://github.com/fosslight/fosslight_dependency_scanner](https://github.com/fosslight/fosslight_dependency_scanner) 32 | **License** : [Apache-2.0](https://github.com/fosslight/fosslight_dependency_scanner/blob/main/LICENSE) 33 | 34 | ## 목차 35 | - [필요 조건](#-필요-조건) 36 | - [설치 방법](#-설치-방법) 37 | - [실행 방법](#-실행-방법) 38 | - [결과](#-결과) 39 | - [동작 방식](#-동작-방식) 40 | - [패키지별 지원 레벨](#-패키지별-지원-레벨) 41 | 42 | 43 | ## 📋 필요 조건 44 | 각 패키지 매니저마다 다른 오픈소스 소프트웨어를 이용하여 Dependency 분석을 수행하고 있습니다. 이에 분석하고자 하는 패키지 매니저에 따라 각각의 Prerequisite 단계를 수행하시기 바랍니다. 45 | 46 | {::options parse_block_html="true" /} 47 |
48 | **Prerequisite for Npm** 49 | 1. Npm dependency 분석을 수행하기 위해 NPM License Checker를 설치합니다. 50 | ``` 51 | $ npm install -g license-checker 52 | ``` 53 | > license-checker를 전역 패키지로 설치하기 위해서는, 반드시 '-g' option을 추가해 주어야 합니다. 만약 'sudo' 권한이 없는 경우, 다음 명령어를 통해 전역 모듈이 설치되는 기본 path를 변경하여 이용하실 수 있습니다. 54 | ``` 55 | $ npm set prefix ~/.npm 56 | $ PATH=~/.npm/bin:$PATH 57 | ``` 58 | 59 | 2. dependency를 설치하기 위해 다음 명령어를 실행합니다. (optional) 60 | ``` 61 | $ npm install 62 | ``` 63 | > 아래 케이스 중 해당하는 경우, 이 단계는 skip 가능합니다. 64 | > - package.json 파일이 input directory에 존재하는 경우 : FOSSLight Dependency Scanner에서 자동으로 패키지 설치하여 실행 가능합니다. 65 | > - 이미 dependency들이 설치된 node_modules 디렉토리가 존재하는 경우 : node_modules폴더가 존재하는 path를 input directory로 설정하여 실행 가능합니다. 66 |
67 | 68 |
69 | **Prerequisite for Pnpm** 70 | ```tip 71 | FOSSLight Dependency Scanner 내부에서 'pnpm install' 및 'pnpm ls' 명령어를 통해 패키지 목록 및 license, repository와 같은 오픈소스 정보를 취합하고 있습니다. 이에 별도의 prerequisite단계없이, 바로 fosslight_dependency 명령어 실행하여 이용하실 수 있습니다. 72 | ``` 73 |
74 | 75 |
76 | **Prerequisite for Gradle** 77 | 1. 'build.gradle' 파일에 License Gradle Plugin을 추가합니다. 78 | ``` 79 | plugins { 80 | id 'com.github.hierynomus.license' version '0.16.1' // gradle 버전이 6.x 이하인 경우에는 version '0.15.0'을 이용해야 합니다. 81 | } 82 | downloadLicenses { 83 | includeProjectDependencies = true 84 | dependencyConfiguration = 'runtimeClasspath' // gradle 버전이 4.6 이하인 경우에는 'runtimeClasspath' 대신 'runtime'으로 추가합니다. 85 | } 86 | ``` 87 | 88 | 2. 'downloadLicenses' task를 실행합니다. 89 | ``` 90 | $ gradlew downloadLicenses 91 | ``` 92 |
93 | 94 |
95 | **Prerequisite for Android (gradle)** 96 | ```tip 97 | Android (gradle)의 경우, input directory에 gradlew 실행 파일 및 build.gradle 파일이 존재하는 경우, plugin 추가 및 실행을 FOSSLight Dependency Scanner 내부에서 자동으로 수행하므로 다음은 skip하셔도 됩니다. 98 | ``` 99 | 1. 'build.gradle' 파일에 android-dependency-scanning Plugin을 추가합니다. 100 | ``` 101 | buildscript { 102 | repositories { 103 | mavenCentral() 104 | } 105 | dependencies { 106 | classpath 'org.fosslight:android-dependency-scanning:1.0.0' 107 | } 108 | } 109 | ``` 110 | 111 | 2. 플러그인이 적용되는 app 디렉토리 내에 위치한 build.gradle 파일 내에 다음과 같이 추가합니다. 이때 plugins 블록 (또는 apply plugin:'com.android.application') 하위 라인에 추가되어야 에러가 발생하지 않습니다. 112 | ``` 113 | apply plugin: 'org.fosslight' 114 | ``` 115 | 116 | 3. 'generateLicenseTxt' task를 실행합니다. 117 | ``` 118 | $ gradlew generateLicenseTxt 119 | ``` 120 |
121 | 122 |
123 | **Prerequisite for Pypi** 124 | ```tip 125 | - 시스템 내 전역으로 설치된 파이썬 dependency로부터 분석하고자 하는 프로젝트 dependency를 분리하기 위해 가상환경을 설정하여 이용하기를 권장합니다. 126 | - 만약 input path내 requirements.txt가 존재한다면, FOSSLight Dependency Scanner가 자동으로 dependency 설치하여 분석 실행 가능하므로, 2번 단계부터는 skip합니다. 127 | ``` 128 | 129 | 1. python3-venv를 설치합니다. 130 | ``` 131 | $ sudo apt-get install python3-venv 132 | ``` 133 | 2. 가상환경을 생성하고 활성화합니다. 134 | ``` 135 | // virtualenv example 136 | $ virtualenv -p /usr/bin/python3.7 venv 137 | $ source venv/bin/activate 138 | // conda example 139 | $ conda create --name {venv name} 140 | $ conda activate {venv name} 141 | ``` 142 | 3. 가상환경 내 분석하고자 하는 프로젝트에서 사용된 패키지를 설치합니다. 143 | 4. FOSSLight Dependency Scanner 실행 시, '-a', '-d' 옵션을 이용하여 해당 가상환경 activate, deactivate 명령어를 추가합니다. 144 |
145 | 146 |
147 | **Prerequisite for Maven** 148 | ```tip 149 | Maven의 경우, input directory에 pom.xml 파일이 존재하는 경우, plugin 추가 및 실행을 FOSSLight Dependency Scanner 내부에서 자동으로 수행하므로 다음은 skip하셔도 됩니다. 150 | ``` 151 |
    152 |
  1. pom.xml 파일에 license-maven-plugin을 추가합니다.
  2. 153 |
    154 | <project>
    155 |   ...
    156 |   <build>
    157 |   ...
    158 |     <plugins>
    159 |     ...
    160 |       <plugin>
    161 |         <groupId>org.codehaus.mojo</groupId>
    162 |         <artifactId>license-maven-plugin</artifactId>
    163 |         <version>2.0.0</version>
    164 |         <executions>
    165 |           <execution>
    166 |             <id>aggregate-download-licenses</id>
    167 |             <goals>
    168 |               <goal>aggregate-download-licenses</goal>
    169 |             </goals>
    170 |           </execution>
    171 |         </executions>
    172 |       </plugin>
    173 |     </plugins>
    174 |     ...
    175 |   </build>
    176 |   ...
    177 | </project>
    178 | 
    179 | 180 |
  3. license-maven-plugin task를 실행합니다.
  4. 181 |
    182 | $ mvnw license:aggregate-download-licenses
    183 | 
    184 |
185 |
186 | 187 |
188 | **Prerequisite for Pub** 189 | > FOSSLight Dependency Scanner 실행하는 환경에서 flutter pub 명령어 사용 가능하지 않은 경우, flutter pub 사용 가능한 환경에서 미리 아래 과정을 수행하시기 바랍니다. 190 | 1. 다음 명령어를 통해 flutter_oss_licenses를 실행합니다. (optional) 191 | ``` 192 | $ flutter pub add dev:flutter_oss_licenses:'^2.0.1' 193 | $ flutter pub get 194 | $ flutter pub deps --json > tmp_deps.json 195 | $ flutter pub deps --no-dev -s compact > tmp_no_dev_deps.txt 196 | $ flutter pub run flutter_oss_licenses:generate.dart -o tmp_flutter_oss_licenses.json --json 197 | ``` 198 | 2. 1번 수행 결과에서 생성된 파일이 존재하는 path에서 FOSSLight Dependency Scanner를 실행합니다. 199 |
200 | 201 |
202 | **Prerequisite for Cocoapods** 203 | 1. Podfile을 통해 pod package를 설치합니다. 204 | ``` 205 | $ pod install 206 | ``` 207 |
208 | 209 |
210 | **Prerequisite for Swift** 211 | 1. Github personal access token을 생성하여 FOSSLight Dependency Scanner 실행 시 '-t' 파라미터로 사용합니다. 이 토큰은 Github repository의 license정보를 가져오기 위해 Github API를 사용하기 위해 필요합니다. 212 | Token생성 방법은 [Github docs 가이드](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token)를 참조하시기 바랍니다. 213 |
214 | 215 |
216 | **Prerequisite for Carthage** 217 | 1. 다음과 같이 패키지 설치 명령어를 수행하여 'Cartfile.resolved' 파일을 생성합니다. 218 | ``` 219 | $ carthage update 220 | ``` 221 | 2. Github personal access token을 생성하여 FOSSLight Dependency Scanner 실행 시 '-t' 파라미터로 사용합니다. 이 토큰은 Github repository의 license정보를 가져오기 위해 Github API를 사용하기 위해 필요합니다. 222 | Token생성 방법은 [Github docs 가이드](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token)를 참조하시기 바랍니다. 223 |
224 | 225 |
226 | **Prerequisite for Go** 227 | ```tip 228 | Go의 경우, go module에 한해 dependency 분석을 지원합니다. FOSSLight Dependency Scanner 내부에서 자동으로 'go list -m all' 명령어를 수행하여 dependency 목록을 얻은 뒤, license, repository와 같은 오픈소스 정보를 취합하고 있습니다. 이에 별도의 prerequisite단계없이, 바로 fosslight_dependency 명령어 실행하여 이용하실 수 있습니다. 229 | ``` 230 |
231 | 232 |
233 | **Prerequisite for Nuget** 234 | ```tip 235 | FOSSLight Dependency Scanner 내부에서 packages.config 파일 또는 PackageReference형태로 이용하는 경우 obj/project.assets.json 파일을 통해 패키지 목록을 확인하고, nuget api를 통해 license, repository와 같은 오픈소스 정보를 취합하고 있습니다. 이에 별도의 prerequisite단계없이, 바로 fosslight_dependency 명령어 실행하여 이용하실 수 있습니다. 236 | ``` 237 |
238 | 239 |
240 | **Prerequisite for Helm** 241 | ```tip 242 | FOSSLight Dependency Scanner 내부에서 Chart.yaml 파일과 helm dependency build 명령어를 통해 패키지 목록 및 license, repository와 같은 오픈소스 정보를 취합하고 있습니다. 이에 별도의 prerequisite단계없이, 바로 fosslight_dependency 명령어 실행하여 이용하실 수 있습니다. 243 | ``` 244 |
245 | 246 |
247 | **Prerequisite for Unity** 248 | ```tip 249 | FOSSLight Dependency Scanner 내부에서 Library/PackageManager/ProjectCache 파일과 Library/PackageCache 디렉토리 내 각 패키지 디렉토리에서 패키지 목록 및 license, repository와 같은 오픈소스 정보를 취합하고 있습니다. 이에 해당 파일들이 존재하는 환경에서 fosslight_dependency 명령어 실행하여 이용하실 수 있습니다. 250 | ``` 251 |
252 | 253 |
254 | **Prerequisite for Cargo** 255 | ```tip 256 | FOSSLight Dependency Scanner 내부에서 Cargo.toml 파일과 'cargo metadata' 명령어를 통해 패키지 목록 및 license, repository와 같은 오픈소스 정보를 취합하고 있습니다. 이에 별도의 prerequisite단계없이, 바로 fosslight_dependency 명령어 실행하여 이용하실 수 있습니다. 257 | ``` 258 |
259 | {::options parse_block_html="false" /} 260 | 261 | ## 🎉 설치 방법 262 | 263 | FOSSLight Dependency Scanner는 pip3를 이용하여 설치할 수 있습니다. 264 | [python 3.7 + virtualenv](etc/guide_virtualenv.md) 환경에서 설치할 것을 권장합니다. 265 | 266 | ``` 267 | $ pip3 install fosslight_dependency 268 | ``` 269 | 270 | 271 | ## 🚀 실행 방법 272 | 273 | FOSSLight Dependency Scanner는 패키지 매니저에 따라 다음 option들을 이용하여 실행할 수 있습니다. 274 | 275 | ``` 276 | $ fosslight_dependency [option] 277 | ``` 278 | ### Options 279 | ``` 280 | Optional 281 | -h Print help message. 282 | -v Print the version of the script. 283 | -m Enter the package manager. 284 | (npm, maven, gradle, pypi, pub, cocoapods, android, swift, carthage, go, nuget, helm, unity, cargo, pnpm) 285 | -p Enter the path where the script will be run. 286 | -e Enter the path where the analysis will not be performed.(Pattern matching is available) 287 | -o Output path 288 | (If you want to generate the specific file name, add the output path with file name.) 289 | -f [ ...] Output formats (excel, csv, opossum, yaml, spdx-tag, spdx-yaml, spdx-json, spdx-xml) 290 | Multiple formats can be specified separated by space. 291 | --graph-path Enter the path where the graph image will be saved 292 | (ex. /your/directory/path/filename.{pdf, jpg, png}) (recommend pdf extension) 293 | --graph-size Enter the size of the graph image (The size unit is pixels) 294 | --graph-path option is required 295 | --direct Print the direct/transitive dependency type in comment. 296 | Choice 'True' or 'False'. (default:True) 297 | --notice Print the open source license notice text. 298 | 299 | Required only for swift, carthage 300 | -t Enter the github personal access token. 301 | 302 | Optional only for pypi 303 | -a Virtual environment activate command(ex, 'conda activate (venv name)') 304 | -d Virtual environment deactivate command(ex, 'conda deactivate') 305 | 306 | Optional only for gradle, maven 307 | -c Enter the customized build output directory name 308 | -Default name : 'build' for gradle, 'target' for maven 309 | 310 | Optional only for android 311 | -n Enter the application directory name where the plugin output file is located(default: app) 312 | 313 | ``` 314 | - 📃 [Pattern 매칭 가이드](https://scancode-toolkit.readthedocs.io/en/stable/cli-reference/scan-options-pre.html?highlight=ignore#glob-pattern-matching) 315 | 316 | ### Tips to run 317 | FOSSLight Dependency Scanner 실행 시, input path('-p' 옵션)는 dependency 분석을 수행하고자 하는 패키지 매니저의 manifest 파일이 존재하는 프로젝트의 top directory로 지정해 주어야 합니다. 318 | 각 패키지 매니저별 manifest 파일은 다음과 같습니다. 319 | ``` 320 | - Npm : package.json 321 | - Pnpm : pnpm-lock.yaml 322 | - Pypi : requirements.txt / setup.py / pyproject.toml 323 | - Maven : pom.xml 324 | - Gradle (Android) : build.gradle 325 | - Pub : pubspec.yaml 326 | - Cocoapods : Podfile 327 | - Swift : Package.resolved 328 | - Carthage : Cartfile.resolved 329 | - Go : go.mod 330 | - Nuget : packages.config / {project name}.csproj 331 | - Helm : Chart.yaml 332 | - Unity : Library/PackageManager/ProjectCache 333 | - Cargo : Cargo.toml 334 | ``` 335 | 336 | - Android (gradle) 337 | - module name이 default인 app이 아닌 경우, module name을 '-n' 옵션으로 지정하여 실행하셔야 합니다. (fosslight_dependency -n {module_name}) 338 | - Swift package manager 339 | - 예외적으로 Swift package manager는 {프로젝트명}.xcodeproj 파일이 위치한 path에서 "fosslight_dependency -m swift -t {token}" 명령어를 실행하실 수 있습니다. 340 | - 이 경우에는 {프로젝트명}.xcodeproj/project.xcworkspace/xcshareddata/swiftpm path에서 'Package.resolved' 파일을 자동으로 찾고 프로그램이 실행됩니다. 341 | - Unity 342 | - Library 폴더 존재하는 directory에서 "fosslight_dependency -m unity" 명령어를 실행하시면 됩니다. 343 | 344 | ## 📁 결과 345 | ``` 346 | $ tree 347 | . 348 | ├── fosslight_report_dep_210503_0039.xlsx 349 | ├── fosslight_log_210503_0039.txt 350 | └── fosslight_opossum_210503_0039.json 351 | ``` 352 | - fosslight_report_dep_[datetime].xlsx : FOSSLight Report 형태의 Dependency 분석 결과 353 | - fosslight_log_dep_[datetime].txt: 실행 로그가 저장된 파일 354 | - fosslight_opossum_dep_[datetime].json : [OpossumUI](https://github.com/opossum-tool/OpossumUI)에서 활용 가능한 Dependency 분석 결과 (-f opossum 결과) 355 | - third_party_notice.txt : Unity로 실행한 경우에만 생성되는 파일로써, 각 패키지의 third party notice를 모아서 출력함 356 | 357 | ### Graph Network 생성 결과 358 | ``` bash 359 | # $ fosslight_dependency -p /project/path --graph-path ~/temp/graph.png --graph-size 1000 1000 360 | $ cd ~/temp 361 | $ tree 362 | . 363 | └── graph.png 364 | ``` 365 | 366 | 367 | - fosslight_report_dep_[datetime].xlsx 파일의 결과 중 Depends On 부분을 이용하여 각 Dependency 간의 의존 관계 그래프 이미지 저장 368 | 369 | ### 결과 파일 내용 370 | FOSSLight Report 결과 파일에는 transitive dependency들을 포함한 모든 분석된 dependency들의 manifest 파일을 기반으로 OSS 정보가 기록됩니다. 371 | 이때, 고유한 OSS명을 작성하기 위해, OSS명은 (패키지 매니저):(OSS명) 또는 (group id):(artifact id) 양식으로 기록됩니다. 372 | 373 | | Package manager | OSS Name | Download Location | Homepage | 374 | | ------------------------------ | ------------------------ | -------------------------------------------------------------------------------------------------- | --------------------------------------------------- | 375 | | Npm, Pnpm | npm:(oss name) | 우선순위1. repository in package.json
우선순위2. npmjs.com/package/(oss name)/v/(oss version) | npmjs.com/package/(oss name) | 376 | | Pypi | pypi:(oss name) | pypi.org/project/(oss name)/(version) | homepage in (pip show) information | 377 | | Maven
& Gradle
& Android | (group_id):(artifact_id) | mvnrepository.com/artifact/(group id)/(artifact id)/(version) | mvnrepository.com/artifact/(group id)/(artifact id) | 378 | | Pub | pub:(oss name) | pub.dev/packages/(oss name)/versions/(version) | homepage in (pub information) | 379 | | Cocoapods | cocoapods:(oss name) | source in (pod spec information) | cocoapods.org/pods/(oss name) | 380 | | Swift | swift:(oss name) | repositoryURL in Package.resolved | repositoryURL in Package.resolved | 381 | | Carthage | carthage:(oss name) | github repository in Cartfile.resolved | github repository in Cartfile.resolved | 382 | | Go | go:(oss name) | pkg.go.dev/(oss name)@(oss version) | repository in pkg.go.dev/(oss name)@(oss version) | 383 | | Nuget | nuget:(oss name) | 우선순위1. repository in nuget.org/packages/(oss name)/(oss version)
우선순위2. projectUrl in nuget.org/packages/(oss name)/(oss version)
우선순위3. nuget.org/packages/(oss name)/(oss version) | nuget.org/packages/(oss name) | 384 | | Helm | helm:(oss name) | first url of sources in (Chart.yaml) | home in (Chart.yaml) | 385 | | Unity | (oss name) | url in repository in ProjectCache | url in repository in ProjectCache | 386 | | Cargo | cargo:(oss name) | repository of the package in the result file for 'cargo metadata' | crates.io/crates/(oss name) | 387 | 388 | 389 | ```warning 390 | - Npm, Maven, gradle의 결과 파일 내용 중, Local path나 local repository를 통해 설치된(npmjs.com / mvnrepository에 배포되지 않은) 패키지의 경우, download location이 실제와 다를 수 있습니다. 391 | - Helm은 root 프로젝트의 Chart.yaml파일에 작성된 dependencies 항목에 대해서만 출력 가능하며, 각 dependency의 dependency 항목 출력은 현재 지원하지 않고 있습니다. 또한, 'helm dependency build' 명령어 수행 후 charts/ 디렉토리 내 다운로드된 .tgz 파일 내 Chart.yaml 파일 정보에서 각 dependency의 OSS 정보를 얻어오고 있습니다. 392 | 따라서 Chart.yaml에 License 또는 Homepage와 같은 정보가 누락된 경우, 해당 정보 얻어올 수 없기에 사용자가 수기로 확인 및 보완하는 작업이 필요합니다. 393 | ``` 394 | 395 | ## 🧐 동작 방식 396 | FOSSLight Dependency Scanner는 패키지 매니저에 따른 dependency를 분석하기 위해 오픈 소스 소프트웨어를 활용합니다. 이때 활용되는 오픈 소스 소프트웨어는 direct dependency뿐만 아니라 transitive dependency까지 추출 가능하며, 오픈소스명, 버전, 라이선스명을 추출 가능합니다. 397 | 398 | 각 패키지 매니저별 사용하는 소프트웨어는 다음과 같습니다: 399 | 400 | - NPM : [NPM License Checker](https://github.com/davglass/license-checker) 401 | - Pypi : [pip-licenses](https://github.com/raimon49/pip-licenses) 402 | - Gradle : [License Gradle Plugin](https://github.com/hierynomus/license-gradle-plugin) 403 | - Maven : [license-maven-plugin](https://github.com/mojohaus/license-maven-plugin) 404 | - Pub : [flutter_oss_licenses](https://github.com/espresso3389/flutter_oss_licenses) 405 | - Android(gradle) : [android-dependency-scanning](https://github.com/fosslight/android-dependency-scanning) 406 | 407 | 이에 패키지 매니저마다 각기 다른 오픈 소스 소프트웨어를 활용함으로써, FOSSLight Dependency Scanner를 실행하기 위해 패키지 매니저별 **Prerequisite** 단계를 먼저 수행해야 합니다. 408 | 409 | ## 👀 패키지별 지원 레벨 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 |
Language/
Project
Package ManagerManifest fileDirect dependenciesTransitive dependenciesRelationship of dependencies
(Dependencies of each dependency)
JavascriptNpmpackage.jsonOOO
Pnpmpnpm-lock.yamlOOO
JavaGradlebuild.gradleOOO
Mavenpom.xmlOOO
Java (Android)Gradlebuild.gradleOOO
ObjC, Swift (iOS)CocoapodsPodfile.lockOOO
CarthageCartfile.resolvedOOX
Swift (iOS)SwiftPackage.resolvedOOO
Dart, FlutterPubpubspec.yamlOOO
GoGogo.modOOO
PythonPypirequirements.txt, setup.py, pyproject.tomlOOO
.NETNugetpackages.config, obj/project.assets.jsonOOO
KubernetesHelmChart.yamlOXX
UnityUnityLibrary/PackageManager/ProjectCacheOOX
RustCargoCargo.tomlOOO
541 | -------------------------------------------------------------------------------- /scanner/4_binary.md: -------------------------------------------------------------------------------- 1 | --- 2 | published: true 3 | --- 4 | # FOSSLight Binary Scanner 5 | 6 | FOSSLight Binary is released under the Apache-2.0. Current python package version. [![REUSE status](https://api.reuse.software/badge/github.com/fosslight/fosslight_binary_scanner)](https://api.reuse.software/info/github.com/fosslight/fosslight_binary_scanner) 7 | 8 | [**FOSSLight Binary Scanner**](https://github.com/fosslight/fosslight_binary_scanner)는 Binary를 찾아 출력하고 Binary DB에 동일하거나 비슷한 Binary가 있으면 해당 OSS 정보를 출력합니다. 9 | jar 파일에 대한 오픈 소스 분석 시, 오픈 소스인 [**Dependency-check-py**](https://github.com/jhermann/dependency-check-py)를 이용합니다. 10 | 11 | **Github Repository** : [https://github.com/fosslight/fosslight_binary_scanner](https://github.com/fosslight/fosslight_binary_scanner) 12 | **License** : [Apache-2.0](https://github.com/fosslight/fosslight_binary_scanner/blob/main/LICENSE) 13 | 14 | ## 목차 15 | - [필요 조건](#-필요-조건) 16 | - [설치 방법](#-설치-방법) 17 | - [실행 방법](#-실행-방법) 18 | - [결과](#-결과) 19 | - [동작 방식](#-동작-방식) 20 | 21 | 22 | ## 📋 필요 조건 23 | [**FOSSLight Binary Scanner**](https://github.com/fosslight/fosslight_binary_scanner)는 Python 3.7+ 기반에서 동작합니다. 24 | OSS 정보(OSS Name, OSS Version, License)를 Binary DB로부터 추출하는 기능을 사용하려면 [DB 세팅 가이드](etc/binary_db.md)를 참고하세요. 25 | 26 | Jar 파일에 대한 분석을 위해서는 [**Java**](https://openjdk.java.net)를 설치해야 합니다.(Open Source JDK를 설치) 27 | 28 | ## 🎉 설치 방법 29 | ### 방법 1. 실행 파일 다운로드 30 | OS(Operating System)에 맞는 실행 파일을 다운로드 받습니다. 31 | - [FOSSLight Binary Scanner - Release](https://github.com/fosslight/fosslight_binary_scanner/releases) 32 | 33 | 단, 지원하지 않는 OS인 경우 '방법 2'로 설치합니다. 34 | 35 | ### 방법 2. Python 환경 기반 fosslight_binary 설치 36 | 0. (windows의 경우) https://visualstudio.microsoft.com/ko/vs/older-downloads/ > 재배포 가능 패키지 및 빌드 도구에서 Microsoft Build Tools 설치 37 | 1. [python 3.7 + virtualenv](etc/guide_virtualenv.md) 환경 세팅 38 | 2. Python package인 fosslight_binary 설치 39 | ``` 40 | $ pip3 install fosslight_binary 41 | ``` 42 | 43 | ## 🚀 실행 방법 44 | ### 방법 1. windows에서 실행 파일로 실행하는 경우 45 | binary 분석할 path에 fosslight_bin_windows.exe 파일 위치시킨 후, 더블 클릭하여 실행합니다. 46 | 47 | ### 방법 2. 그 외, command로 실행하는 경우 48 | ```` 49 | $ fosslight_binary [option] 50 | ```` 51 | 52 | ### Options 53 | ```` 54 | Options: 55 | -p Path to analyze binaries (Default: current directory) 56 | -h Print help message 57 | -v Print FOSSLight Binary Scanner version 58 | -s Extract only the binary list in simple mode 59 | -e Path to exclude from analysis (files and directories, pattern matching is available) 60 | -o Output path 61 | (If you want to generate the specific file name, add the output path with file name.) 62 | -f [ ...] Output file formats (excel, csv, opossum, yaml) 63 | Multiple formats can be specified separated by space. 64 | -d DB Connection(format :'postgresql://username:password@host:port/database_name') 65 | --notice Print the open source license notice text. 66 | --no_correction Enter if you don't want to correct OSS information with sbom-info.yaml 67 | --correct_fpath Path to the sbom-info.yaml file 68 | ```` 69 | - 📃 [Pattern 매칭 가이드](https://scancode-toolkit.readthedocs.io/en/stable/cli-reference/scan-options-pre.html?highlight=ignore#glob-pattern-matching) 70 | 71 | 72 | ## 📁 결과 73 | 74 | ``` 75 | $ tree 76 | . 77 | ├── fosslight_log_220904_0912.txt 78 | ├── fosslight_report_220904_0912.xlsx 79 | └── fosslight_opossum_220904_0912.json 80 | 81 | ``` 82 | - fosslight_log_[datetime].txt : 실행 log 83 | - fosslight_report_[datetime].xlsx : FOSSLight binary의 결과 (FOSSLight Report 형태) 84 | - jar 파일 분석 시, Vulnerability Link Column에 보안취약점 정보가 추가됨. 85 | - Binary별 checksum, tlsh Column은 기본적으로 숨김 처리 되어 있음. 86 | - fosslight_opossum_[datetime].json : [OpossumUI](https://github.com/opossum-tool/OpossumUI)에서 활용 가능한 Binary 분석 결과 87 | 88 | ## 🧐 동작 방식 89 | 1. 아래 항목들은 Binary 분석 과정에서 제외됩니다. 90 | 91 | |제외 항목 | 설명 | 92 | |------------------------|-------------------------------------------------------------------------------------------------------------------------------| 93 | |symbolic link, FIFO 파일| file open으로 읽을 수 없음. 이로 인해 file type이나 binary인지 체크할 때, FOSSLight Binary Scanner가 멈춤. | 94 | |Binary가 아닌 확장자 | 'qm', 'xlsx', 'pdf', 'pptx', 'jfif', 'docx', 'doc', 'whl', 'xls', 'xlsm', 'ppt', 'mp4', 'pyc', 'plist', 'dat', 'json', 'js' 등| 95 | |특정 파일 Type | 'data','timezone data', 'apple binary property list'로 시작하는 파일들 | 96 | |특정 경로 | '.git'의 경로 | 97 | 98 | 2. 아래 사항에 대하여 FOSSLight Report에 "**Exclude**"를 체크합니다. 99 | 100 | |Exclude 항목 |설명 | 101 | |----------------------------------------------------------------------|-----------------------------------------------------| 102 | |Binary가 ['fosslight_bin', 'fosslight_bin.exe']에 포함되는 경우 | - | 103 | |경로가 ["test", "tests", "doc", "docs", "intermediates"]에 포함되는 경우| 실제 배포에 포함되는 소스 코드 / 바이너리의 결과만 출력 | 104 | |directory가 숨긴 폴더인 경우 (폴더명이 .로 시작하는 경우) | - | 105 | |특정 확장자인 경우 | 최종 빌드 산출물이 아님(ex, .class) | 106 | 107 | 3. Binary별 checksum과 tlsh를 출력합니다. 108 | 4. OSS 정보를 Binary DB로 부터 불러옵니다. 109 | 5. 결과 Report 파일을 생성합니다. 110 | -------------------------------------------------------------------------------- /scanner/5_yocto.md: -------------------------------------------------------------------------------- 1 | --- 2 | published: true 3 | --- 4 | # FOSSLight Yocto Scanner 5 | 6 | FOSSLight Yocto is released under the Apache-2.0. Current python package version. [![REUSE status](https://api.reuse.software/badge/github.com/fosslight/fosslight_yocto_scanner)](https://api.reuse.software/info/github.com/fosslight/fosslight_yocto_scanner) 7 | 8 | [**FOSSLight Yocto Scanner**](https://github.com/fosslight/fosslight_yocto_scanner)는 Yocto Project에 기반하여 build 시, rootfs 이미지에 포함되는 Package에 대한 OSS 정보를 FOSS Report형식으로 출력해주는 Python Script입니다. 9 | 10 | - Package별 OSS 정보 출력 방법 : Recipe에 정의된 OSS 정보(OSS Name, OSS Version, LICENSE, Download Location)를 출력합니다. 11 | 이 때, OSS Name은 Recipe name으로 출력합니다. 12 | - ⚠️**rootfs 이미지 외 target에 탑재되는 이미지 (ex- 커널, 부트로더)에 대해서는 Script가 OSS 정보를 출력해주지 않습니다.** 이에 대해서는 사용자가 직접 OSS Report에 OSS 정보를 추가해야 합니다. 13 | 14 | **Github Repository** : [https://github.com/fosslight/fosslight_yocto_scanner](https://github.com/fosslight/fosslight_yocto_scanner) 15 | **License** : [Apache-2.0](https://github.com/fosslight/fosslight_yocto_scanner/blob/main/LICENSE) 16 | 17 | ## 목차 18 | - [필요 조건](#-필요-조건) 19 | - [설치 방법](#-설치-방법) 20 | - [실행 방법](#-실행-방법) 21 | - [결과](#-결과) 22 | - [동작 방식](#-동작-방식) 23 | 24 | 25 | ## 📋 필요 조건 26 | [**FOSSLight Yocto Scanner**](https://github.com/fosslight/fosslight_yocto_scanner)는 Python 3.8+ 기반에서 동작합니다. 27 | OSS 정보(OSS Name, OSS Version, License)를 Binary DB로부터 추출하는 기능을 사용하려면 [DB 세팅 가이드](etc/binary_db.md)를 참고하세요. 28 | 29 | 30 | ## 🎉 설치 방법 31 | 0. (windows의 경우) https://visualstudio.microsoft.com/ko/vs/older-downloads/ > 재배포 가능 패키지 및 빌드 도구에서 Microsoft Build Tools 설치 32 | 1. [python 3.8 + virtualenv](etc/guide_virtualenv.md) 환경 세팅 33 | 2. Python package인 fosslight_yocto 설치 34 | ``` 35 | $ pip3 install fosslight_yocto 36 | ``` 37 | 38 | ## 🚀 실행 방법 39 | ### 방법 1. bom.bbclass를 이용하는 방법 40 | 41 | --- 42 | [bom.bbclass](https://github.com/fosslight/fosslight_yocto_scanner/blob/main/files_for_preparation/bom.bbclass) 를 이용하여 추출한 결과를 FOSSLight Yocto를 이용하여 OSS Report형태로 변환합니다. 43 | - Sheet 별 출력 사항: 44 | - SRC Sheet : Installed package 목록을 추출하고 OSS 정보를 출력합니다. 45 | - BIN Sheet : rootfs image를 압축 해제한 폴더에서 binary를 추출한 후 binary별 OSS 정보를 출력합니다. 46 | 47 | --- 48 | 49 | #### 준비 사항 50 | 1. build directory (ex-poky/build)로 이동한 후, conf/local.conf에 buildhistory와 bom을 inherit시킵니다. 51 | ``` 52 | $ cd poky/build 53 | poky/build$ vi conf/local.conf 54 | INHERIT += "buildhistory" 55 | BUILDHISTORY_COMMIT = "1" 56 | 57 | INHERIT += "bom" 58 | ``` 59 | 2. 최상위 directory 아래 meta/classes 디렉토리에 [bom.bbclass](https://github.com/fosslight/fosslight_yocto_scanner/blob/main/files_for_preparation/bom.bbclass) 파일을 다운로드합니다. 60 | - meta/classes 가 없는 경우 build에 포함되는 meta layer의 classes폴더에 bom.bbclass를 다운로드합니다. 61 | ``` 62 | poky/meta/classes$ wget -O bom.bbclass "https://github.com/fosslight/fosslight_yocto_scanner/raw/main/files_for_preparation/bom.bbclass" 63 | ``` 64 | - yocto 2.5 이전 버전의 경우, --runall 기능을 지원하지 않아 build시 bom.bbclass를 출력하기 위하여 bom.bbclass를 하기와 같이 수정합니다. 65 | ``` 66 | addtask write_bom_info -> addtask write_bom_info before do_build 67 | ``` 68 | 3. 이미지를 build한 후, write_bom_info를 실행합니다. 69 | - yocto 2.5 이후 버전 70 | ``` 71 | poky/build $ bitbake 72 | poky/build $ bitbake --runall=write_bom_info (eg. bitbake --runall=write_bom_info core-image-minimal) 73 | ``` 74 | - yocto 2.5 이전 버전 75 | ``` 76 | poky/build $ bitbake 77 | ``` 78 | 4. ${TOPDIR}/에 bom.json 파일과 buildhistory 폴더가 생성됩니다. 79 | 80 | #### 실행 81 | fosslight_yocto 명령어를 실행합니다. 82 | ``` 83 | $ fosslight_yocto -i [installed-package-names.txt] -b [bom.json] -p [buildhistory/packages] -a [path_to_binary_analysis] 84 | ``` 85 | 86 | - Options 87 | ``` 88 | Mandatory 89 | -p Path of buildhistory/package 90 | -b bom.json 91 | -i installed-package-names.txt 92 | -ip installed-packages.txt 93 | 94 | Optional 95 | -h Print help message 96 | -v Print FOSSLight yocto version 97 | -y oss-pkg-info.yaml 98 | -a Path to analyze the binaries 99 | -n Print result in BIN(Android) format 100 | -s Analyze source code for unconfirmed Open Source 101 | -c Analyze all the source code 102 | -e Top build output path with bom.json to compress all the source code (ex. /data001/projectA/build) 103 | -o Output Path 104 | -f Output file format (excel, csv, opossum) 105 | -pr Print all data of bom.json 106 | ``` 107 | 108 | ### 방법 2. meta-doubleopen을 이용하는 방법 109 | --- 110 | [meta-doubleopen](https://github.com/doubleopen-project/meta-doubleopen)를 이용하여 spdx.json으로 추출하고 FOSSLight Yocto를 이용하여 FOSS Report 형식으로 변환합니다. 111 | - Sheet 별 출력 사항: 112 | - SRC_distributed: rootfs 이미지에 포함되는 Package 113 | - SRC_recipe: build에 포함되는 Recipe 114 | - SRC_not_distributed: rootfs 이미지에 포함되지 않는 Package 115 | 116 | - Package별 OSS 정보 출력 방법 : Recipe에 정의된 OSS 정보(OSS Name, OSS Version, LICENSE, Download Location, Homepage)를 출력합니다. 이 때, OSS Name은 Recipe name으로 출력합니다. 117 | 118 | --- 119 | 120 | #### 준비 사항 121 | [meta-doubleopen](https://github.com/doubleopen-project/meta-doubleopen)을 이용하여 이미지에 대한 spdx.json 파일을 생성합니다. 122 | 123 | #### 실행 124 | fosslight_doubleopen 명령어를 실행합니다. 125 | ``` 126 | $ source venv/bin/activate 127 | (.venv) $ fosslight_doubleopen -f core-image-minimal.spdx.json 128 | ``` 129 | - Option f {[image].spdx.json} : meta-doubleopen 실행 결과 생성되는 spdx.json 파일 130 | 131 | ## 📁 결과 132 | 133 | ``` 134 | $ tree 135 | . 136 | ├── fosslight_log_220904_0912.txt 137 | ├── fosslight_report_220904_0912.xlsx 138 | └── fosslight_opossum_220904_0912.json 139 | 140 | ``` 141 | - fosslight_log_[datetime].txt : 실행 log 142 | - fosslight_report_[datetime].xlsx : FOSSLight Yocto의 결과 (FOSSLight Report 형태) 143 | - Binary별 checksum, tlsh 값은 report에 기본적으로 숨김 처리 되어 있음. 144 | - fosslight_opossum_[datetime].json : [OpossumUI](https://github.com/opossum-tool/OpossumUI)에서 활용 가능한 Binary 분석 결과 145 | -------------------------------------------------------------------------------- /scanner/6_android.md: -------------------------------------------------------------------------------- 1 | --- 2 | published: true 3 | --- 4 | # FOSSLight Android Scanner 5 | 6 | FOSSLight Android is released under the Apache-2.0. Current python package version. [![REUSE status](https://api.reuse.software/badge/github.com/fosslight/fosslight_android_scanner)](https://api.reuse.software/info/github.com/fosslight/fosslight_android_scanner) 7 | 8 | [**FOSSLight Android Scanner**](https://github.com/fosslight/fosslight_android_scanner)는 Android 모델에 탑재되는 Binary를 모두 나열하여 각 Binary별로 Open Source가 사용되었는지 확인하고, 고지해야 할 사항이 OSS 고지문(ex. NOTICE.html)에 적절하게 포함되었는지 확인하기 위해 수행합니다. 9 | 10 | **Github Repository** : [https://github.com/fosslight/fosslight_android_scanner](https://github.com/fosslight/fosslight_android_scanner) 11 | **License** : [Apache-2.0](https://github.com/fosslight/fosslight_android_scanner/blob/main/LICENSE) 12 | 13 | ## 목차 14 | - [필요 조건](#-필요-조건) 15 | - [설치 방법](#-설치-방법) 16 | - [실행 방법](#-실행-방법) 17 | - [결과](#-결과) 18 | - [추가 기능](#-추가-기능) 19 | 20 | 21 | ## 📋 필요 조건 22 | [**FOSSLight Android Scanner**](https://github.com/fosslight/fosslight_android_scanner)는 Python 3.8+ 기반에서 동작합니다. 23 | OSS 정보(OSS Name, OSS Version, License)를 Binary DB로부터 추출하는 기능을 사용하려면 [DB 세팅 가이드](etc/binary_db.md)를 참고하세요. 24 | 25 | ## 🎉 설치 방법 26 | 1. [python 3.8 + virtualenv](etc/guide_virtualenv.md) 환경 세팅 27 | 2. Python package인 fosslight_android 설치 28 | ``` 29 | $ pip3 install fosslight_android 30 | ``` 31 | 32 | ## 🚀 실행 방법 33 | FOSSLight Android를 실행합니다. (이때, build 산출물 (/out directory) 및 build log file (android.log) 가 android source path 에 존재해야 합니다.) 34 | 35 | #### 준비 사항 36 | Android Build 37 | Android 모델을 build clean 상태에서 build하여 산출물(/out directory) 및 build log(android.log)를 확보합니다. 38 | ``` 39 | (Android native source build 예) 40 | $ source ./build/envsetup.sh 41 | $ make clean 42 | $ lunch aosp_hammerhead-user 43 | $ make -j4 2>&1 | tee android.log 44 | ``` 45 | 46 | {::options parse_block_html="true" /} 47 |
48 | **Android 7.0 이전 version의 모델** 49 | 50 | Android 7.0 이전 version의 모델일 경우, 먼저 module-info.mk 파일을 build/core/tasks/하위에 위치시킨 후 build합니다. (build시 module-info.json 파일을 생성하게 하기 위함) 51 | 52 | ``` 53 | $ wget https://raw.githubusercontent.com/aosp-mirror/platform_build/android-cts-7.0_r33/core/tasks/module-info.mk 54 | $ mv ./module-info.mk ./build/core/tasks 55 | ``` 56 | 57 |
58 | 59 | #### 실행 60 | fosslight_android 명령어를 실행합니다. 61 | 이때, build 산출물 (/out directory) 및 build log file (android.log) 가 android source path 에 존재해야 합니다. 62 | 63 | ``` 64 | (venv)$ fosslight_android -s [android source path] -a [build log file name] 65 | ``` 66 | 67 | - Options 68 | ``` 69 | Options: 70 | Mandatory 71 | -s Path to analyze 72 | -a The file must be located in the android source path. 73 | 74 | Optional 75 | -h Print help message 76 | -m Analyze the source code for the path where the license could not be found. 77 | -e Path to exclude from source analysis. 78 | -p Check files that should not be included in the Packaging file. 79 | -f Print result of Find Command for binary that can not find Source Code Path. 80 | -i Disable the function to automatically convert OSS names based on AOSP. 81 | -r result.txt file with a list of binaries to remove. 82 | ``` 83 | 84 | 85 | ## 📁 결과 86 | - fosslight_report_[datetime].xlsx : FOSSLight Android 분석 결과 (FOSSLight Report 형태) 87 | - Binary별 checksum, tlsh 값은 report에 기본적으로 숨김 처리 되어 있음. 88 | - fosslight_log_[datetime].txt : 실행 log 89 | - notice file 90 | - notice_to_fosslight_hub_{datetime}.zip : notice file이 1개 이상인 경우 .zip으로 압축됨 91 | - notice_to_fosslight_hub_{datetime}.{extension} : notice file이 1개인 경우(ex. NOTICE.html) 92 | - REMOVED_BIN_BY_DUPLICATION_[datetime].txt : output path내 binary name과 checksum이 동일한 파일이 2개 이상 존재하여 FOSSLight Report에서 중복 제거된 목록입니다. 93 | 더불어 -r 옵션으로 추가로 제거된 목록도 출력됩니다. 94 | 95 | 96 | 97 | | Column | 내용 | 98 | |:-----------------|:----------------------------------------------------------------------------------------------| 99 | | Binary Name | out directory 내 존재하는 Binary 목록 (binary, library, APK, font 등 ) | 100 | | Source Code Path | Binary를 구성하는 Source Code의 Path 정보 (LOCAL_PATH) | 101 | | Notice | NOTICE 파일에 Binary 정보가 표시되었는지 여부를 표시합니다. Open Source가 사용된 Binary라면, ok여야 합니다.
  - ok : Source Path에 NOTICE 파일이 있고, 최종 output NOTICE (ex. NOTICE.html)에 Binary 포함
  - ok(NA) : Source Path에 NOTICE 파일이 없으나, 최종 output NOTICE (ex. NOTICE.html)에 Binary 포함
  - nok : Source Path에 NOTICE 파일이 없고, 최종 output NOTICE (ex. NOTICE.html)에 Binary가 포함되어 있지 않음
  - nok(NA) : Source Path에 NOTICE 파일이 있음에도, 최종 output NOTICE (ex. NOTICE.html)에 Binary가 포함되어 있지 않음
  - CANNOT_FIND_NOTICE_HTML : NOTICE.html 파일을 찾을 수 없음. (이 경우, Script 실행 시, -n [NOTICE.html_path]를 주어 NOTICE.html 파일 위치를 Parameter로 줘야 함) | 102 | | OSS Name | LGE Binary DB에서 매칭하는 Binary의 정보를 가져와서 보여줍니다. | 103 | | OSS Version | LGE Binary DB에서 매칭하는 Binary의 정보를 가져와서 보여줍니다. | 104 | | License | 하기 정보로 부터 추출한 Open Source License 를 보여줍니다.
  - LGE Binary DB에서 매칭되는 Binary의 정보
  - Source Code Path 내 "MODULE_LICENSE_xxxxxx"와 같이 License를 명시한 file을 읽어서 표시
  - output의 {MODULE_NAME}.meta_lic에서 찾은 정보 | 105 | | Need Check | 'O'인 경우, 검토가 필요합니다. | 106 | | Comment | 검토가 필요한 사항을 출력합니다.
  - Fill in [Column명] : 기입이 필요한 Column을 표시.
  ex) Fill in OSS Name : 'OSS Name' Column에 사용한 OSS의 이름을 기입해야 함.
  - Add NOTICE to path : Source Code Path에 NOTICE 파일이 없으므로, NOTICE 파일을 해당 binary의 Source Code Path에 추가해야함.
  단, NOTICE 파일을 Source code path에 추가하기 어렵거나 NOTICE파일을 추가해도 최종 target에 탑재되는 NOTICE에 포함되지 않는 경우 FOSSLight Hub를 통해 Project를 리뷰 받은 후 Supplement NOTICE.html 기능을 통해 추가되어야하는 NOTICE를 다운로드 받은 후 Android 모델 OSS 고지문 > '별도 생성한 NOTICE를 OSS 고지문에 추가' 방법을 통해 보완이 필요합니다.| 107 | | (TLSH) | Binary의 TLSH 값을 출력합니다. | 108 | | (SHA1) | Binary의 Checksum 값을 출력합니다. | 109 | 110 | 111 | 112 | ## 🚗 추가 기능 113 | --- 114 | 하기 옵션을 통해 부가 기능을 활용할 수 있습니다. 115 | - Option: -p : Packaging 파일에 포함되지 않아야 하는 파일을 확인합니다. 116 | - Option: -f : Source Code Path를 찾지 못하는 binary에 대하여 Find Command 실행 결과를 출력해줍니다. 117 | - Option: -i : Android reference 의 repository기준으로 OSS Name의 자동 출력을 비활성화합니다. 118 | - Option: -r : 특정 binary가 FOSSLight Report에서 중복되는것을 제거합니다. Android native와 vendor가 분리되어 build되는 구조에서 사용하는 옵션으로 중복으로 포함되는 Binary를 제거합니다. vendor에 대한 FOSSLight Android 실행시 -r 옵션으로 android native 결과 생성되는 result_*.txt 파일을 parameter로 추가합니다. 119 | - Option: -m : License가 빈칸인 부분에 대해 자동으로 Source path 내 Source code 분석(소스 파일 내 License text 기반 License 검출)을 실행하여 License 값을 채워줍니다. (그러나 분석에 시간이 오래 걸립니다. Android native에서 44개 Path기준 약 35분 소요) 120 | 121 | 122 | --- 123 | 124 | 125 | 126 | ### -p: Packaging 파일에 포함되지 않아야 하는 파일 확인 127 | 공개할 Source Code 취합시, 포함되지 말아야 하는 파일 이름, 확장자, 디렉토리를 체크합니다. 128 | 129 | 130 | #### 사전 준비 131 | 132 | 1. Packaging Config File : 체크할 항목을 json 형식의 pkgConfig.json 파일 이름으로 생성합니다. 133 | Example : pkgConfig.json 134 | 135 | ``` 136 | { 137 | "Prohibited_File_Names":[ 138 | "key_file", 139 | "confidential_key" 140 | ], 141 | "Prohibited_File_Extensions":[ 142 | "exe", 143 | "jar" 144 | ], 145 | "Prohibited_Path":[ 146 | "confidential", 147 | ".git" 148 | ] 149 | } 150 | ``` 151 | 152 | 2. 항목 별 설명 : 항목 별 작성할 사항이 1개 이상인 경우 "," 로 구분하여 작성합니다. 153 | - Prohibited_File_Names : 검출하려는 파일 이름 154 | - Prohibited_File_Extensions : 검출하려는 파일 확장자 155 | - Prohibited_Path : 검출할 파일 디렉토리 156 | 157 | 3. 공개할 소스 코드를 취합한 디렉토리 위치 혹은 압축 파일 확인 158 | - 공개할 소스 코드 취합한 디렉토리나 압축 파일 내 압축된 파일이 있을 경우, 압축을 해제하여 검색합니다. 159 | - 압축 해제 지원 확장자 : tar, tar.gz, zip 160 | - tar, tar.gz, zip 외의 압축 파일이 있다면, 압축 해제를 미리 수동으로 해야합니다. 161 | 162 | 163 | 164 | 165 | #### 실행방법 166 | 1. Packaging Config File을 pkgConfig.json 파일명(json 형식)으로 준비합니다. 167 | 2. -p 옵션을 추가하여 실행합니다. (-p : 공개할 소스 코드를 취합한 Path 혹은 압축 파일) 168 | ``` 169 | (venv)$ fosslight_android -p [A path or compressed file containing the source code to be disclosed] 170 | 171 | ex 172 | (venv)$ fosslight_android -p /home/test/sourceCodeToBeDisclosed.tar.gz 173 | ``` 174 | 175 | #### 결과 확인 176 | 1. 검출된 항목별로 추출된 목록을 보여줍니다. 177 | 2. 결과 example : 178 | 179 | ``` 180 | (venv)$ fosslight_android -p /home/test/sourceCodeToBeDisclosed.tar.gz 181 | 1. Prohibited file names : 1 182 | sourceCode/executable/LgeOscClient/confidential_key 183 | 2. Prohibited file extension : 4 184 | sourceCode/executable/Report_Jenkins_ubuntu.exe 185 | sourceCode/executable/ReportTool_v3.03_181128U.jar 186 | sourceCode/executable/Protex_Create_Upload_Analyze_v3.03_181128U.jar 187 | sourceCode/executable/ReportTool_CLI_v3.03_181128U.jar 188 | 3. Prohibited Path : 2 189 | sourceCode/.git 190 | sourceCode/executable/LgeOscClient/confidential 191 | 4. Fail to read : 0 192 | ``` 193 | 194 | - Prohibited file names : 공개할 소스 코드 중 파일명에 pkgConfig.json의 Prohibited_File_Names 값을 포함하는 경우 출력합니다. 195 | - Prohibited file extension : 공개할 소스 코드 중 파일 확장자가 pkgConfig.json의 Prohibited_File_Extensions 값인 경우 출력합니다. 196 | - Prohibited Path : 공개할 소스 코드 중 파일 Path 중 pkgConfig.json의 Prohibited_Path 값을 포함하는 경우 출력합니다. 197 | - Fail to read : 압축 해제에 실패한 파일 목록을 출력합니다. 198 |
199 |
200 | 201 | 202 | 203 | 204 | ### -f: Source Code Path를 찾지 못하는 binary에 대하여 Find Command 실행 결과 출력 205 | Source Code Path를 찾지 못하는 Binary에 대하여 Android의 Source Path내 폴더 (out directory, .으로 시작하는 숨김 directory 제외)별로 Find Command 실행 결과를 출력합니다. 206 | 207 | #### 실행방법 208 | 1. -f 옵션을 추가하여 실행합니다. 209 | ```commandline 210 | (venv)$ fosslight_android -s [android source path] -a [build log file name] -f 211 | 212 | ex 213 | (venv)$ fosslight_android -s /home/soim/android/source -a android.log -f 214 | ``` 215 | 216 | #### 결과 확인 217 | 1. Source Code Path를 찾지 못하는 Binary별 Find command 실행 결과는 'FIND_RESULT_OF_BINARIES.txt' 파일로 생성됩니다. 218 | 2. 단, Source Code Path를 찾지 못하는 Binary가 없을 경우 해당 파일은 생성되지 않습니다. 219 |
220 |
221 | 222 | 223 | ### -i: OSS Name 자동 완성 기능 끄기 224 | FOSSLight Android는 Binary DB에서 OSS 정보를 찾을 수 없는 경우이거나 OSS Name이 "Android Open Source Project"인 경우, Source Code Path를 기준으로 [Android Native](https://android.googlesource.com/platform)에 있는 저장소라면 OSS Name을 자동으로 출력해줍니다. 225 | OSS Name 자동 완성 기능을 끄고자 할 경우 선택합니다. 226 | 227 | #### 실행방법 228 | 1. -i 옵션을 추가하여 실행합니다. 229 | ```commandline 230 | (venv)$ fosslight_android -s [android source path] -a [build log file name] -i 231 | 232 | ex 233 | (venv)$ fosslight_android -s /home/soim/android/source -a android.log -i 234 | ``` 235 | 236 | #### 결과 확인 237 | 1. 생성 파일명 : RESULT_COMPARE_I_OPTION.xlsx 238 | - Sheet "Ref_with_i_option" : i 옵션으로 android reference 소스에서 FOSSLight Android 분석 결과 239 | - Sheet "Ref_without_i_option" : android reference 소스에서 FOSSLight Android 분석 결과 240 |
241 |
242 | 243 | 244 | 245 | ### -r: 특정 binary를 FOSSLight Report에서 중복 제거 246 | 하나의 Model에 탑재하는 Android native와 vendor가 분리된 output으로 생성되는 경우에 한하여 활용합니다. vendor에 대한 FOSSLight Android 실행시 -r 옵션을 이용하여 Android native에도 포함되는 binary를 중복 제거합니다. 247 | - 중복 제거 조건 : Binary name이 같고 checksum이 같거나, Binary name이 같고 TLSH 값 차이가 120이하인 경우 248 | - 중복 제거된 binary는 REMOVED_BIN_BY_DUPLICATION.txt에 출력됩니다. 249 |
250 |
251 | 252 | 253 | #### 실행방법 254 | 1. FOSSLight Android 분석 실행시 -r 옵션을 추가합니다. 255 | ```commandline 256 | (venv)$ fosslight_android -s [vendor_source_path] -a [android_build_log_file] -r [android_native_result.txt] 257 | 258 | ex 259 | (venv)$ fosslight_android -s [vendor_source_path] -a android.log -r android_native_result.txt 260 | ``` 261 | 262 | #### 결과 확인 263 | 1. android_native_result.txt와 중복된 binary는 FOSSLight-Report.xlsx에서 제거되고, REMOVED_BIN_BY_DUPLICATION.txt에 출력됩니다. 264 |
265 |
266 | 267 | 268 | ### -m: 소스 코드 분석하여 License 출력 269 | License 정보를 못 찾은 경우에 한하여 FOSSLight Source를 이용하여 Source code를 분석한 결과를 License란에 출력합니다. 270 | 271 | #### 실행방법 272 | 1. -m 옵션을 추가합니다. 273 | ```commandline 274 | (venv)$ fosslight_android -s [vendor_source_path] -a [android_build_log_file] -m 275 | 276 | ex 277 | (venv)$ fosslight_android -s [vendor_source_path] -a android.log -m 278 | ``` 279 | 280 | #### 결과 확인 281 | 1. FOSSLight Report의 License column에 분석한 결과가 채워집니다. 282 | 2. 추가로 source_analyzed_[datetime] 폴더에 소스 코드별 분석한 결과가 생성됩니다. 283 | -------------------------------------------------------------------------------- /scanner/7_scanner_service.md: -------------------------------------------------------------------------------- 1 | --- 2 | published: true 3 | --- 4 | 5 | # (Enterprise Only) FOSSLight Scanner Service 6 | 7 | ## 개요 8 | {: .left-bar-title} 9 | 웹서비스로 [FOSSLight Scanner](https://fosslight.org/fosslight-guide/scanner/)를 이용하여 Source, Binary, Dependency 분석을 수행합니다. 분석 결과는 [FOSSLight Report](https://fosslight.org/hub-guide/learn/2_fosslight_report.html)형태로 생성됩니다. 10 | - URL : [http://fs.lge.com](http://fs.lge.com) 11 | - 분석 항목 12 | - [FOSSLight Source Scanner](https://fosslight.org/fosslight-guide/scanner/2_source.html) 13 | - [FOSSLight Binary Scanner](https://fosslight.org/fosslight-guide/scanner/4_binary.html) 14 | - [FOSSLight Dependency Scanner](https://fosslight.org/fosslight-guide/scanner/3_dependency.html) 15 | - 지원하는 package manager : npm, pypi, maven, pub, go, nuget, cargo. 16 | (그 외 package manager은 검증 진행 중) 17 | - 미지원 항목 18 | - [FOSSLight Android Scanner](https://fosslight.org/fosslight-guide/scanner/6_android.html) 19 | - [FOSSLight Yocto Scanner](https://fosslight.org/fosslight-guide/scanner/5_yocto.html) 20 | 21 | 22 | ## 사용 방법 23 | {: .left-bar-title} 24 | 25 | ### 로그인 26 | {: .specific-title} 27 | - [http://fs.lge.com](http://fs.lge.com)에서 AD 계정 ID와 비밀번호를 입력하여 접속합니다.
28 | ![log-in](images/7_fl_ss_login.png){: .styled-image} 29 | 30 | ### Create a Project 31 | {: .specific-title} 32 | 1. 우측 상단의 "New Project" 버튼을 클릭하여 Project를 생성합니다. 33 | ![New Project](images/7_fl_ss_newproject.png){: .styled-image} 34 | 35 | 2. "Create a Project"에 내용을 입력합니다. 36 | ![Creat a Project](images/7_fl_ss_create_project.png){: .styled-image} 37 | - **Name** : Project 이름을 입력합니다. 38 | - **Inputs** : 분석할 소스를 선택합니다. 39 | - **Upload files** : 분석할 파일을 압축하여 업로드합니다. (1개만 업로드) 40 | - **Download URLs** : 분석할 소스 링크 (wget 또는 git clone 하여 받을 수 있는 링크)를 입력합니다. 41 | - **Public** : 공개된 Repository인 경우 42 | - 입력값 예시 43 | - wget : github.com/LGE-OSS/example/archive/refs/tags/v1.0.0.zip 44 | - git clone : github.com/LGE-OSS/example 45 | - **Private Git** : Private git 인 경우 46 | - **http://** 또는 **https://** : user name과 PAT 값을 입력합니다. (PAT 값에는 /가 포함되면 안 됨) 47 | - **ssh://** : 제공되는 ssh key 값을 복사하여 private git repository에 등록합니다. ⚠️ github 는 ssh 대신 PAT 를 이용합니다. 48 | ![ssh](images/7_fl_ss_ssh.png){: .styled-image} 49 | - **Pipeline** 50 | - scan_all : source, binary, dependency 분석 51 | - source : source code만 분석 52 | - binary : binary만 분석 53 | - **권한 설정** 54 | - Private : 생성자만 조회 가능 55 | - Public : 링크를 통해 해당 Project를 다른 사람이 볼 수 있고 분석 결과를 다운로드할 수 있음 56 | 57 | 58 | ### 분석 결과 59 | {: .specific-title} 60 | ![analysis_result](images/7_fl_ss_analysis_result.png){: .styled-image} 61 | 1. **Download results** : 분석 결과 파일을 다운로드 받을 수 있습니다. 62 | - FOSSLight Scanner Result : FOSSLight Hub의 [Identification](https://fosslight.org/hub-guide/tutorial/1_project/2_Identification/) 과정에서 업로드 할 수 있는 리포트입니다. 63 | 2. **Files** : 분석한 파일별 검출 결과를 File Tree 포맷으로 확인할 수 있습니다. (FOSSLight Dependency 결과는 미포함) 64 | 3. **Detected Open Source** : 분석 결과를 list로 확인할 수 있습니다. (FOSSLight Dependency 결과는 미포함) 65 | ![detected_opensource](images/7_fl_ss_detected_opensource.png){: .styled-image} 66 | -------------------------------------------------------------------------------- /scanner/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sort: 5 3 | published: true 4 | title: 🚩FOSSLight Scanner 5 | --- 6 | # FOSSLight Scanner 7 | 8 | FOSSLight Scanner is released under the Apache-2.0. Current python package version. 9 | 10 | FOSSLight Scanner는 로컬 소스코드 또는 입력받은 링크를 통해 소스를 다운로드 받은 후 소스코드, 바이너리 및 디펜던시에 대한 오픈 소스 분석을 수행할 수 있습니다. 11 |
12 | 오픈 소스 분석을 위해 사용하는 툴은 다음과 같습니다. 13 | 14 | 1. [FOSSLight Source Scanner](2_source.md) : 소스 코드를 분석하여 오픈 소스 분석 결과를 생성합니다.  15 | 2. [FOSSLight Dependency Scanner](3_dependency.md) : Package manager 또는 빌드 시스템을 통해 사용되는 dependency의 오픈 소스 분석 결과를 생성합니다.  16 | 3. [FOSSLight Binary Scanner](4_binary.md) : Binary를 분석하여 오픈 소스 분석 결과를 생성합니다.  17 |
18 | 19 | 20 | **Github Repository** : [https://github.com/fosslight/fosslight_scanner](https://github.com/fosslight/fosslight_scanner) 21 | **License** : [Apache-2.0](https://github.com/fosslight/fosslight_scanner/blob/main/LICENSE) 22 | 23 | ## 목차 24 | - [📋 필요 조건](#-필요-조건) 25 | - [🎉 설치 방법](#-설치-방법) 26 | - [🚀 실행 방법](#-실행-방법) 27 | - [📁 결과](#-결과) 28 | - [🐳 Docker를 이용하여 설치 및 실행 방법](#-docker를-이용하여-설치-및-실행-방법) 29 | 30 | ## 📋 필요 조건 31 | 1. [**FOSSLight Scanner**](https://github.com/fosslight/fosslight_scanner)는 Python 3.8+ 기반에서 동작합니다. 32 | 2. Jar 파일에 대한 분석을 위해서는 [**Java**](https://openjdk.java.net)를 설치해야 합니다.(Open Source JDK를 설치) 33 | 3. (windows의 경우) Microsoft Build Tools (Microsoft Visual C++ 14.0+) from https://visualstudio.microsoft.com/ko/visual-cpp-build-tools/ 를 설치해야 합니다. 34 | 35 | ## 🎉 설치 방법 36 | FOSSLight Scanner는 pip3를 이용하여 설치할 수 있습니다. 37 | [python 3.8 + virtualenv](etc/guide_virtualenv.md) 환경에서 설치할 것을 권장합니다. 38 | 39 | ``` 40 | $ pip3 install fosslight_scanner 41 | ``` 42 | 43 | ### ⚠️ 설치 에러 발생 시 44 | 'Cargo, the Rust package manager, is not installed or is not on PATH.' 에러 발생 시, cargo, rust를 아래와 같이 설치한 이후, 다시 FOSSLight Scanner를 설치합니다. 45 | ``` 46 | $ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh 47 | $ export PATH="$HOME/.cargo/bin:$PATH" 48 | ``` 49 | 50 | 51 | ## 🚀 실행 방법 52 | ### Mode별 실행 방법 및 Parameters 53 | ``` 54 | $ fosslight [Mode] [option1] [option2] ... 55 | ``` 56 | ``` 57 | Parameters: 58 | Mode: Multiple modes can be entered by separating them with , (ex. source,binary) 59 | all Run all scanners(Default) 60 | source Run FOSSLight Source Scanner 61 | dependency Run FOSSLight Dependency Scanner 62 | binary Run FOSSLight Binary Scanner 63 | compare Compare two FOSSLight reports 64 | 65 | Options: 66 | -h Print help message 67 | -p Path to analyze (ex, -p {input_path}) 68 | * Compare mode input file: Two FOSSLight reports (supports excel, yaml) 69 | (ex, -p {before_name}.xlsx {after_name}.xlsx) 70 | -w Link to be analyzed can be downloaded by wget or git clone 71 | -f [ ...] FOSSLight Report file format (excel, csv, opossum, yaml, spdx-tag, spdx-yaml, spdx-json, spdx-xml) 72 | * Compare mode result file: supports excel, json, yaml, html 73 | * Multiple formats can be specified separated by space. 74 | -e Path to exclude from analysis (ex, -e {dir} {file}) 75 | -o Output directory or file 76 | -c Number of processes to analyze source 77 | -r Keep raw data 78 | -t Hide the progress bar 79 | -v Print FOSSLight Scanner version 80 | -s Path to apply setting from file (check format with 'setting.json' in this repository) 81 | * Direct cli flags have higher priority than setting file 82 | (ex, '-f yaml -s setting.json' - result file extension is .yaml) 83 | --no_correction Enter if you don't want to correct OSS information with sbom-info.yaml 84 | * Correction mode only supported xlsx format. 85 | --correct_fpath Path to the sbom-info.yaml file 86 | --ui Generate UI mode result file 87 | 88 | Options for only 'all' or 'bin' mode 89 | -u DB Connection(format :'postgresql://username:password@host:port/database_name') 90 | 91 | Options for only 'all' or 'dependency' mode 92 | -d Additional arguments for running dependency analysis 93 | 94 | ``` 95 | - -d 옵션은 FOSSLight Dependency 실행시 argument 입력이 필요한 경우만 입력합니다.[참고](3_dependency.md) 96 | 97 | #### Ex.1 Local의 Path를 분석하는 방법 98 | ``` 99 | fosslight all -p /home/source_path 100 | ``` 101 | 102 | #### Ex.2 링크를 다운로드 받고 분석하는 방법 103 | ``` 104 | fosslight all -o test_result_wget -w "https://github.com/LGE-OSS/example.git" 105 | ``` 106 | 107 | #### Ex.3 FOSSLight Report BOM 결과 비교하여 변경/추가/삭제 내역 확인하는 방법 108 | ``` 109 | fosslight compare -p FOSSLight_before_proj.yaml FOSSLight_after_proj.yaml -o test_result 110 | ``` 111 | 112 | ### 실행 Parameter를 json으로 저장하여 호출하는 방법 113 | 1. [setting.json](https://github.com/fosslight/fosslight_scanner/blob/main/tests/setting.json) 포맷으로 실행 parameter별 값을 json 파일로 작성하여 저장 114 | 2. 실행시, -s 로 생성한 setting.json을 호출합니다. 115 | ``` 116 | fosslight -s setting.json 117 | ``` 118 | 🛈 json 파일에 작성한 parameter보다 실행시 호출한 값을 우선합니다. 119 | ex. '-f yaml -s setting.json'로 호출시, yaml 포맷의 output을 출력합니다. 120 | 121 | ## 📁 결과 122 | ### 오픈소스 분석 모드 결과 (all, source, dependency, binary) 123 | ``` 124 | test_result/ 125 | ├── fosslight_log 126 | │ └── fosslight_log_220214_1824.txt 127 | ├── fosslight_report_all_220214_1824.xlsx 128 | └── fosslight_raw_data (-r option 있는 경우) 129 | ├── fosslight_src_220214_1824.xlsx 130 | ├── fosslight_bin_220214_1824.xlsx 131 | └── fosslight_dep_220214_1824.xlsx 132 | ``` 133 | - fosslight_report_(datetime).xlsx : Source 분석, Binary 분석, Dependency 분석 결과가 작성된 FOSSLight Report 형식의 파일 134 | - fosslight_raw_data directory: 분석 결과 Raw Data 파일이 생성되는 폴더 (-r option 있는 경우) 135 | - fosslight_src_(datetime).xlsx : Source 분석 결과 파일 136 | - fosslight_dep_(datetime).xlsx : Dependency 분석 결과 파일 137 | - fosslight_bin_(datetime).xlsx : Binary 분석 결과 파일 138 | 139 | #### fosslight_report_(datetime).xlsx 140 | 1. Exclude : 체크된 Row 141 | test(s), doc(s), 숨김 파일 or 폴더는 Exclude 체크됩니다. 142 | 2. sbom-info.yaml을 load한 경우, load한 데이터를 append하고 중복된 파일에 대한 분석 결과는 Exclude 체크됩니다. 143 | 3. Comment란 : 144 | Add/Loaded by ** : ** 으로부터 load한 Row 145 | Excluded by ** : ** 으로 인해 Exclude된 Row 146 | 147 | ### compare 모드 결과 148 | ``` 149 | test_result/ 150 | ├── fosslight_log 151 | │ └── fosslight_log_20220817_114259.txt 152 | └── fosslight_compare_20220817_114259.xlsx 153 | ``` 154 | - fosslight_compare_(datetime).xlsx : 두 개의 BOM 비교 결과가 (add/delete/change) 테이블 양식으로 작성된 파일 155 | 156 | ## 🐳 Docker를 이용하여 설치 및 실행 방법 157 | > [!NOTE] 158 | > Docker로 실행시, FOSSLight Source/Binary Scanner만 동작합니다. FOSSLight Dependency Scanner는 동작하지 않습니다. 159 | 160 | 1. FOSSLight Scanner Docker 이미지 다운로드 161 | 162 | 선택 1. Dockerhub에서 fosslight_scanner 다운로드 163 | ``` 164 | $ docker pull fosslight/fosslight_scanner 165 | ``` 166 | 선택 2. [Dockerfile](https://github.com/fosslight/fosslight_scanner/blob/main/Dockerfile)을 이용하여 이미지 빌드 (선택 1에서 지원하지 않는 OS인 경우) 167 | ``` 168 | $ docker build -t fosslight_scanner . 169 | ``` 170 | 171 | 3. 빌드한 이미지로 실행합니다. 172 | ex. Output 경로 : /Users/git/temp/output, 분석 경로 : /Users/git/temp/dir_to_analyze 173 | ``` 174 | $ docker run -it -v /Users/git/temp/dir_to_analyze:/app/dir_to_analyze -v /Users/git/temp/output:/app/output fosslight_scanner -p dir_to_analyze -o output 175 | ``` 176 | -------------------------------------------------------------------------------- /scanner/etc/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | published: true 3 | title: Etc 4 | --- 5 | 6 | # Other guides to FOSSLight Scanner 7 | 8 | {% include list.liquid all=true %} 9 | -------------------------------------------------------------------------------- /scanner/etc/binary_db.md: -------------------------------------------------------------------------------- 1 | --- 2 | published: true 3 | --- 4 | 5 | # FOSSLight Binary Scanner Database 세팅 방법 6 | OSS Information (OSS Name, OSS Version, License)를 DB로부터 출력하기 위해 DB 세팅이 필요합니다. 7 | 8 | ## Prerequisite 9 | 1. [PostgreSQL][PostgreSQL]를 설치합니다. 10 | 2. 원격으로 접속하기 위해 configuration file을 수정하는 방법 : [reference link][ref_link] 11 | 12 | [PostgreSQL]: https://www.postgresql.org/download/ 13 | [ref_link]: https://www.cyberciti.biz/tips/postgres-allow-remote-access-tcp-connection.html 14 | 15 | 16 | ## How to create a database and a table 17 | 1. User와 Database를 생성합니다. 18 | ```` 19 | $ sudo -i -u postgres 20 | $ psql 21 | postgres=# CREATE USER bin_analysis_script_user PASSWORD 'script_123' ; 22 | postgres=# CREATE DATABASE bat OWNER bin_analysis_script_user ENCODING 'utf-8'; 23 | ```` 24 | 25 | 2. [fosslight_create.sql][sql_link] 파일을 다운로드합니다. 26 | 27 | 3. Table을 생성합니다. 28 | ```` 29 | $ psql -U bin_analysis_script_user -d bat -f fosslight_create.sql 30 | ```` 31 | 32 | [sql_link]: https://github.com/fosslight/fosslight_binary_scanner/blob/main/db/initdb.d/fosslight_create.sql 33 | 34 | ### Table schema 35 | table 36 | 37 | 38 | ## Example. 데이터 입력을 위한 쿼리 39 | ```` 40 | INSERT INTO public.lgematching (filename, pathname, checksum, tlshchecksum, ossname, ossversion, license, parentname, platformname, platformversion, updatedate, sourcepath) VALUES 41 | ('askalono.exe', 'third_party/askalono/askalono.exe', '3f5c6bbf06ddf53a46634bb21691ab0757f3b80c', 'T138267C12BB86A9EDC06AC470878646225B31B4CA0B25BFFF41C455743E6AAF45F3D39C', 'askalono', '', 'Apache-2.0', '[123]windows app project', 'windows', '10', '2021-02-19 17:21:52.430065', 'third_party/src/askalono') 42 | ```` 43 | - The checksum and tlshchecksum values are output to binary.txt when fosslight_binary is executed. 44 | 45 | 46 | ## FOSSLight Binary 실행시, DB와 연동하는 방법 47 | - When calling fosslight_binary, write your DB information with the -d option. 48 | ex) 49 | ```` 50 | fosslight_binary -p path_to_analyze -d postgresql://username:password@host:port/database_name 51 | ```` 52 | -------------------------------------------------------------------------------- /scanner/etc/guide_virtualenv.md: -------------------------------------------------------------------------------- 1 | --- 2 | published: true 3 | --- 4 | # Virtualenv 세팅 가이드 5 | 6 | Python package를 설치 및 실행하기 위한 virtualenv 환경 세팅하는 가이드입니다. 7 | 8 | ## Contents 9 | - [추가 Package 설치](#pre) 10 | - [Python, python-dev 설치](#python) 11 | - [virtualenv 세팅하는 법](#virtualenv) 12 | - [virtualenv 명령어](#command) 13 | 14 | ## 📋 Prerequisite 15 | macOS의 경우, 하기 package를 추가로 설치합니다. 16 | ``` 17 | brew install openssl 18 | brew install libmagic 19 | brew install postgresql 20 | ``` 21 | 22 | ## 💻 Python, python-dev 설치 23 | 24 | - Python 설치 방법은 [설치 가이드][install] 링크를 참조하세요. 25 | - 사용하는 python 버전에 맞게 python-dev, python-distutils를 설치합니다. 26 | ``` 27 | $ sudo apt-get install python3.8 python3-pip python3.8-dev python3.8-distutils 28 | ``` 29 | 30 | [install]: https://realpython.com/installing-python 31 | 32 | ## 📋 virtualenv 생성하고 활성화하는 법 33 | 34 | ``` 35 | $ pip3 install virtualenv 36 | $ virtualenv -p /usr/bin/python3.8 venv 37 | $ source venv/bin/activate 38 | ``` 39 | 자세한 virtualenv 설명: [Python virtualenv page][venv] 40 | 41 | [venv]: https://docs.python.org/3.8/library/venv.html 42 | 43 | ## ⌨️ virtualenv 명령어 44 | 45 | | Command description | command | 46 | | ------------- | ------------- | 47 | | 가상환경 생성 | virtualenv -p [python_version] [env_name] | 48 | | 가상환경 활성화 | source [env_name]/bin/activate | 49 | | 가상환경 비활성화 | deactivate | 50 | -------------------------------------------------------------------------------- /scanner/images/7_fl_ss_analysis_result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fosslight/fosslight-guide/e7b6f75dd6115b538f939a6dd679513311577ff1/scanner/images/7_fl_ss_analysis_result.png -------------------------------------------------------------------------------- /scanner/images/7_fl_ss_create_project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fosslight/fosslight-guide/e7b6f75dd6115b538f939a6dd679513311577ff1/scanner/images/7_fl_ss_create_project.png -------------------------------------------------------------------------------- /scanner/images/7_fl_ss_detected_opensource.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fosslight/fosslight-guide/e7b6f75dd6115b538f939a6dd679513311577ff1/scanner/images/7_fl_ss_detected_opensource.png -------------------------------------------------------------------------------- /scanner/images/7_fl_ss_login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fosslight/fosslight-guide/e7b6f75dd6115b538f939a6dd679513311577ff1/scanner/images/7_fl_ss_login.png -------------------------------------------------------------------------------- /scanner/images/7_fl_ss_newproject.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fosslight/fosslight-guide/e7b6f75dd6115b538f939a6dd679513311577ff1/scanner/images/7_fl_ss_newproject.png -------------------------------------------------------------------------------- /scanner/images/7_fl_ss_ssh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fosslight/fosslight-guide/e7b6f75dd6115b538f939a6dd679513311577ff1/scanner/images/7_fl_ss_ssh.png -------------------------------------------------------------------------------- /scanner/images/add.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fosslight/fosslight-guide/e7b6f75dd6115b538f939a6dd679513311577ff1/scanner/images/add.gif -------------------------------------------------------------------------------- /scanner/images/convert.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fosslight/fosslight-guide/e7b6f75dd6115b538f939a6dd679513311577ff1/scanner/images/convert.gif -------------------------------------------------------------------------------- /scanner/images/fosslight_depenency_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fosslight/fosslight-guide/e7b6f75dd6115b538f939a6dd679513311577ff1/scanner/images/fosslight_depenency_graph.png -------------------------------------------------------------------------------- /scanner/images/fosslight_prechecker_add_test_result.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fosslight/fosslight-guide/e7b6f75dd6115b538f939a6dd679513311577ff1/scanner/images/fosslight_prechecker_add_test_result.JPG -------------------------------------------------------------------------------- /scanner/images/fosslight_reuse_add_test.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fosslight/fosslight-guide/e7b6f75dd6115b538f939a6dd679513311577ff1/scanner/images/fosslight_reuse_add_test.JPG -------------------------------------------------------------------------------- /scanner/images/fosslight_reuse_report.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fosslight/fosslight-guide/e7b6f75dd6115b538f939a6dd679513311577ff1/scanner/images/fosslight_reuse_report.JPG -------------------------------------------------------------------------------- /scanner/images/fosslight_scanner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fosslight/fosslight-guide/e7b6f75dd6115b538f939a6dd679513311577ff1/scanner/images/fosslight_scanner.png -------------------------------------------------------------------------------- /scanner/images/fosslight_scanner_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fosslight/fosslight-guide/e7b6f75dd6115b538f939a6dd679513311577ff1/scanner/images/fosslight_scanner_overview.png -------------------------------------------------------------------------------- /scanner/images/lint.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fosslight/fosslight-guide/e7b6f75dd6115b538f939a6dd679513311577ff1/scanner/images/lint.gif -------------------------------------------------------------------------------- /scanner/images/table_schema.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fosslight/fosslight-guide/e7b6f75dd6115b538f939a6dd679513311577ff1/scanner/images/table_schema.png --------------------------------------------------------------------------------