Skip to content
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

Add dependency license scanning linting #801

Closed
dfarrell07 opened this issue Sep 10, 2020 · 15 comments · Fixed by #1326
Closed

Add dependency license scanning linting #801

dfarrell07 opened this issue Sep 10, 2020 · 15 comments · Fixed by #1326
Assignees
Labels
automation cncf priority:high size:medium This can be implemented in a single sprint
Milestone

Comments

@dfarrell07
Copy link
Member

What would you like to be added:

License scanning paralleling the CNCF periodic license scanning, to make sure that all of our code and dependencies use a CNCF-approved license.

Some CNCF scanning details are here, but need to dig for more details about our tooling options:

kubernetes/steering#57

Why is this needed:

To ease integration with other CNCF projects.

@dfarrell07 dfarrell07 added this to the 0.7.0 milestone Sep 10, 2020
@dfarrell07 dfarrell07 added this to To do in Submariner Project v0.7.0 via automation Sep 10, 2020
@dfarrell07 dfarrell07 self-assigned this Sep 10, 2020
@dfarrell07
Copy link
Member Author

This might be a good option: https://github.com/google/go-licenses

@dfarrell07 dfarrell07 removed this from To do in Submariner Project v0.7.0 Oct 7, 2020
@dfarrell07 dfarrell07 added this to To do in Submariner Project v0.8.0 via automation Oct 7, 2020
@dfarrell07 dfarrell07 modified the milestones: 0.7.0, 0.8.0 Oct 7, 2020
@dfarrell07 dfarrell07 moved this from To do to Backlog in Submariner Project v0.8.0 Oct 7, 2020
@stale
Copy link

stale bot commented Dec 6, 2020

This issue has been automatically marked as stale because it has not had activity for 60 days. It will be closed if no further activity occurs. Please make a comment if this issue/pr is still valid. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Dec 6, 2020
@dfarrell07
Copy link
Member Author

Bump

@stale stale bot removed the wontfix This will not be worked on label Dec 7, 2020
@dfarrell07 dfarrell07 removed this from Backlog in Submariner Project v0.8.0 Dec 14, 2020
@dfarrell07 dfarrell07 removed this from the 0.8.0 milestone Dec 14, 2020
@dfarrell07
Copy link
Member Author

This was done by @skitt in a series of PRs like #1066.

@dfarrell07 dfarrell07 moved this from Backlog to Done in Submariner Project v0.9 Jan 28, 2021
@dfarrell07
Copy link
Member Author

This was done by @skitt in a series of PRs like #1066.

NVM, this issue is actually about checking the licenses of dependencies, not Submariner. Still should look into google/go-license.

@dfarrell07 dfarrell07 reopened this Jan 28, 2021
@dfarrell07 dfarrell07 moved this from Done to To Do in Submariner Project v0.9 Jan 28, 2021
@dfarrell07 dfarrell07 changed the title Add license scanning linting Add dependency license scanning linting Jan 28, 2021
@dfarrell07 dfarrell07 added this to the 0.9-m1 milestone Jan 28, 2021
@dfarrell07
Copy link
Member Author

The CNCF application process says we need to follow CNCF IP rules, which in turn say:

All projects evaluated for inclusion in the CNCF shall be completely licensed under an OSI-approved open source license. If the license for a project included in CNCF is not Apache License, Version 2.0, approval of the Governing Board shall be required.

I guess that means we need to be confident that all of our dependencies use OSI-approved licenses.

@skitt
Copy link
Member

skitt commented Feb 3, 2021

The CNCF application process says we need to follow CNCF IP rules, which in turn say:

All projects evaluated for inclusion in the CNCF shall be completely licensed under an OSI-approved open source license. If the license for a project included in CNCF is not Apache License, Version 2.0, approval of the Governing Board shall be required.

I guess that means we need to be confident that all of our dependencies use OSI-approved licenses.

A quick check through our vendor directories shows ASL 2, MPL 2, ISC, MIT, 2- or 3-clause BSD, and “unlicense”, which are all fine.

@dfarrell07 dfarrell07 removed this from the 0.9-m1 milestone Feb 10, 2021
@stale stale bot closed this as completed Apr 18, 2021
@skitt
Copy link
Member

skitt commented Apr 26, 2021

This is still relevant.

@skitt skitt reopened this Apr 26, 2021
@stale stale bot removed the wontfix This will not be worked on label Apr 26, 2021
@dfarrell07 dfarrell07 mentioned this issue Apr 29, 2021
87 tasks
@skitt skitt self-assigned this Apr 30, 2021
@skitt
Copy link
Member

skitt commented Apr 30, 2021

I’m looking into Snyk for this (see also https://twitter.com/snyksec/status/1387089315465998343).

@skitt
Copy link
Member

skitt commented Apr 30, 2021

So Snyk isn’t great; it looks at all transitive dependencies, including those which we don’t use (basically, it uses go mod graph when what we really care about is go list -deps -test). https://app.fossa.io/reports/dce31219-52a8-4d88-903d-3885f427bba6 suggests that FOSSA might be better, I’ll look into that next.

However, I think it would be good to make this part of our PR checks, so that variations in dependencies and their licenses are flagged at PR merge time and not in a periodic report. We should only care about adding dependencies on PRs, so I’m not suggesting we run security scans in PRs, but storing the known list of calculated dependencies and the licenses used by artifacts which end up in our binaries (see https://github.com/mitchellh/golicense) would be good — that way, if developers don’t realise they’re changing the dependency tree, the PR will fail, but they can fix it by updating the catalog (and tooling will be provided to do this). We did this successfully in OpenDaylight for the odlparent project.

@skitt
Copy link
Member

skitt commented Apr 30, 2021

https://app.snyk.io/org/skitt/project/88cc8844-35fa-4fdc-8e74-61bfa8231dd7 is a report on Submariner’s go.mod. It highlights some relevant issues (or rather, CVEs in dependencies we really do use, although the security issues themselves don’t affect us — I’ll fix those), but most of the report lists dependencies which we don’t actually use (etcd, miekg/dns, Docker...).

@skitt
Copy link
Member

skitt commented Apr 30, 2021

I’m also filing issues or submitting PRs for our dependencies as appropriate, e.g. onsi/gomega#441 and kubernetes-sigs/mcs-api#6.

@skitt
Copy link
Member

skitt commented Apr 30, 2021

FOSSA sign-up is failing for me currently.

@dfarrell07 dfarrell07 moved this from "General" Backlog to To Do in Submariner Project 0.10 May 4, 2021
@mkolesnik mkolesnik added the size:medium This can be implemented in a single sprint label May 4, 2021
@dfarrell07 dfarrell07 added this to the 0.10-m1 milestone May 5, 2021
@dfarrell07
Copy link
Member Author

We talked about this on the automation sync today and will focus on https://github.com/mitchellh/golicense

skitt added a commit to skitt/submariner that referenced this issue May 12, 2021
This uses https://github.com/uw-labs/lichen, which is closer to our
requirements for CNCF validation than
https://github.com/mitchellh/golicense and performs validation using
local information.

The references for the Allowlist and the approved exceptions are
described in the lichen configuration file.

Fixes: submariner-io#801
Signed-off-by: Stephen Kitt <skitt@redhat.com>
skitt added a commit to skitt/submariner that referenced this issue May 17, 2021
This uses https://github.com/uw-labs/lichen, which is closer to our
requirements for CNCF validation than
https://github.com/mitchellh/golicense and performs validation using
local information.

The references for the Allowlist and the approved exceptions are
described in the lichen configuration file.

Fixes: submariner-io#801
Signed-off-by: Stephen Kitt <skitt@redhat.com>
skitt added a commit to skitt/submariner that referenced this issue May 21, 2021
This uses https://github.com/uw-labs/lichen, which is closer to our
requirements for CNCF validation than
https://github.com/mitchellh/golicense and performs validation using
local information.

The references for the Allowlist and the approved exceptions are
described in the lichen configuration file.

Fixes: submariner-io#801
Signed-off-by: Stephen Kitt <skitt@redhat.com>
skitt added a commit to skitt/submariner that referenced this issue May 21, 2021
This uses https://github.com/uw-labs/lichen, which is closer to our
requirements for CNCF validation than
https://github.com/mitchellh/golicense and performs validation using
local information.

The references for the Allowlist and the approved exceptions are
described in the lichen configuration file.

Fixes: submariner-io#801
Signed-off-by: Stephen Kitt <skitt@redhat.com>
@skitt skitt moved this from To Do to In review in Submariner Project 0.10 May 25, 2021
@skitt skitt modified the milestones: 0.10-m1, 0.10-m2 May 25, 2021
skitt added a commit that referenced this issue May 25, 2021
This uses https://github.com/uw-labs/lichen, which is closer to our
requirements for CNCF validation than
https://github.com/mitchellh/golicense and performs validation using
local information.

The references for the Allowlist and the approved exceptions are
described in the lichen configuration file.

Fixes: #801
Signed-off-by: Stephen Kitt <skitt@redhat.com>
@nyechiel nyechiel modified the milestones: 0.10-m2, 0.10-m1 May 25, 2021
@nyechiel nyechiel moved this from In review to Done in Submariner Project 0.10 May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation cncf priority:high size:medium This can be implemented in a single sprint
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants