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

Updated security-ci.yml for specific license violations #300

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
17 changes: 12 additions & 5 deletions .github/workflows/security-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,33 +91,40 @@ jobs:
output_file_path = './license-scan-result.txt'
results = []
vulnerabilities = data['vulnerabilities']
flagged_license = ["GPL", "MPL", "AGPL", "OSL", "EUPL", "LGPL", "CDDL", "CC-BY"]
for vulnerability in vulnerabilities:
if 'type' in vulnerability and vulnerability['type'] == 'license':
if 'type' in vulnerability and vulnerability['type'] == 'license' and any(map(vulnerability['license'].__contains__, flagged_license)):
title = vulnerability['title']
package_name = vulnerability['name']
version = vulnerability['version']
severity = vulnerability['severity']
license = vulnerability['license']
introduced = vulnerability['from']
if len(introduced) < 3:
type = "Direct"
else:
type = "Indirect"
result = {
'Title': title,
'Package Name': package_name,
'Package Version': version,
'Severity': severity,
'License Info': license,
'Introduced': introduced
'Introduced': introduced,
'Dependency' : type
}
results.append(result)
with open(output_file_path, 'w') as file:
file.write("|Title|Package Name|Package Version|Severity|License Info|Introduced|\n")
file.write("|---|---|---|---|---|---|\n")
file.write("|Title|Package Name|Package Version|Severity|License Info|Introduced|Dependency Type|\n")
file.write("|---|---|---|---|---|---|---|\n")
for result in results:
file.write(f"{result['Title']} | ")
file.write(f"{result['Package Name']} | ")
file.write(f"{result['Package Version']} | ")
file.write(f"{result['Severity']} | ")
file.write(f"{result['License Info']} | ")
file.write(f"{result['Introduced']} |")
file.write(f"{result['Dependency']} |")
file.write("\n")
file.write(f"\nTotal License Issues: {len(results)}")
file.close()
Expand Down Expand Up @@ -155,4 +162,4 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
body: body
});
});