Skip to content

[7.8] Add script and config for FOSSA scanning #1434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions .fossa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Generated by FOSSA CLI (https://github.com/fossas/fossa-cli)
# Visit https://fossa.com to learn more

version: 2
cli:
server: https://app.fossa.com
fetcher: custom
project: git@github.com:elastic/ml-cpp.git
analyze:
modules:
- name: 3rd_party/licenses
type: raw
target: 3rd_party/licenses
- name: 3rd_party/rapidjson/include/rapidjson
type: raw
target: 3rd_party/rapidjson/include/rapidjson
- name: include/api
type: raw
target: include/api
- name: include/config
type: raw
target: include/config
- name: include/core
type: raw
target: include/core
- name: include/maths
type: raw
target: include/maths
- name: include/model
type: raw
target: include/model
- name: include/ver
type: raw
target: include/ver
- name: include/seccomp
type: raw
target: include/seccomp
- name: lib/api
type: raw
target: lib/api
- name: lib/config
type: raw
target: lib/config
- name: lib/core
type: raw
target: lib/core
- name: lib/maths
type: raw
target: lib/maths
- name: lib/model
type: raw
target: lib/model
- name: lib/ver
type: raw
target: lib/ver
- name: lib/seccomp
type: raw
target: lib/seccomp
- name: bin/autoconfig
type: raw
target: bin/autoconfig
- name: bin/autodetect
type: raw
target: bin/autodetect
- name: bin/categorize
type: raw
target: bin/categorize
- name: bin/controller
type: raw
target: bin/controller
- name: bin/normalize
type: raw
target: bin/normalize
- name: bin/data_frame_analyzer
type: raw
target: bin/data_frame_analyzer
24 changes: 24 additions & 0 deletions dev-tools/fossa_scan.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
#
# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
# or more contributor license agreements. Licensed under the Elastic License;
# you may not use this file except in compliance with the Elastic License.
#

# Run a FOSSA scan on the repo to check for license violations

# Get the FOSSA API token from Vault
set +x
export VAULT_TOKEN=$(vault write -field=token auth/approle/login role_id="$VAULT_ROLE_ID" secret_id="$VAULT_SECRET_ID")
unset VAULT_ROLE_ID VAULT_SECRET_ID
export FOSSA_API_KEY=$(vault read -field=token secret/jenkins-ci/fossa/api-token)
unset VAULT_TOKEN
set -x

# Change directory to the top level of the repo
readonly GIT_TOPLEVEL=$(git rev-parse --show-toplevel 2> /dev/null)
cd "$GIT_TOPLEVEL"

# Run the FOSSA scan
fossa analyze