Skip to content

Commit

Permalink
Generate open source notice for scanner (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
misberner authored Sep 27, 2021
1 parent 7e68302 commit 87f9970
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 2 deletions.
15 changes: 15 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@ commands:
unzip -d image/scanner/dump /tmp/k8s-definitions.zip
unzip -d image/scanner/dump /tmp/repo2cpe.zip
- install-ossls

- run:
name: Build images
command: make << parameters.make-image-target >>
Expand Down Expand Up @@ -636,6 +638,19 @@ commands:
path: /tmp/metrics
destination: metrics

install-ossls:
steps:
- run:
name: Install ossls
working_directory: /tmp
command: |
wget --quiet https://github.com/gruntwork-io/fetch/releases/download/v0.3.5/fetch_linux_amd64
sudo install fetch_linux_amd64 /usr/bin/fetch
export GITHUB_OAUTH_TOKEN="$GITHUB_TOKEN"
fetch --repo="https://github.com/stackrox/ossls" --tag="0.10.1" --release-asset="ossls_linux_amd64" .
sudo install ossls_linux_amd64 /usr/bin/ossls
ossls version
jobs:
unit-tests:
<<: *defaults
Expand Down
17 changes: 17 additions & 0 deletions .ossls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
gomod:
mod-file: go.mod

patterns:
- "*AUTHOR*"
- "*COPYING*"
- "*LICENSE*"
- "*LICENCE*"
- "*NOTICE*"
- '~^.*(?i:notice|licen[cs]e).*\.(?i:txt|md)$'
- "package.json"

excludePatterns:
- "*.go"
- "*.js"
- "*.ts"
- "*.sh"
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ $(CURDIR)/image/db/rhel/bundle.tar.gz:
$(CURDIR)/image/db/rhel/create-bundle.sh $(CURDIR)/image/db $(CURDIR)/image/db/rhel

.PHONY: scanner-image
scanner-image: scanner-build-dockerized $(CURDIR)/image/scanner/rhel/bundle.tar.gz
scanner-image: scanner-build-dockerized ossls-notice $(CURDIR)/image/scanner/rhel/bundle.tar.gz
@echo "+ $@"
@docker build -t us.gcr.io/stackrox-ci/scanner:$(TAG) -f image/scanner/rhel/Dockerfile image/scanner/rhel

Expand All @@ -192,6 +192,11 @@ deploy-dockerhub: clean-helm-rendered
helm template scanner chart/ --set tag=$(TAG),logLevel=$(LOGLEVEL),updateInterval=2m,scannerImage=stackrox/scanner,scannerDBImage=stackrox/scanner-db --output-dir rendered-chart
kubectl apply -R -f rendered-chart

.PHONY: ossls-notice
ossls-notice: deps
ossls version
ossls audit --export image/scanner/rhel/THIRD_PARTY_NOTICES

###########
## Tests ##
###########
Expand Down
2 changes: 1 addition & 1 deletion image/scanner/rhel/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ bundle.tar.gz
bundle.tar.gz.sha512
prebuild.sh
scripts

/THIRD_PARTY_NOTICES/
2 changes: 2 additions & 0 deletions image/scanner/rhel/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ COPY --from=extracted_bundle "/bundle${NVD_DEFINITIONS_DIR}/" ".${NVD_DEFINITION
COPY --from=extracted_bundle "/bundle${K8S_DEFINITIONS_DIR}/" ".${K8S_DEFINITIONS_DIR}/"
COPY --from=extracted_bundle "/bundle${REPO_TO_CPE_DIR}/" ".${REPO_TO_CPE_DIR}/"

COPY ./THIRD_PARTY_NOTICES/ /THIRD_PARTY_NOTICES/

RUN dnf upgrade -y && \
dnf install -y ca-certificates xz && \
dnf clean all && \
Expand Down

0 comments on commit 87f9970

Please sign in to comment.