Control: 3.2.3 Ensure packages are automatically scanned for license implications
Description
A software license is a document that provides legal conditions and guidelines for the use and distribution of software, usually defined by the author. It is recommended to scan for any legal implications automatically.
Rationale
When using packages with software licenses, especially commercial ones which tend to be the strictest, it is important to verify that the use of the package meets the conditions of the license. If the use of the package violates the licensing agreement, it exposes the organization to possible lawsuits. Scanning used packages for such license implications leads to faster detection and quicker fixes of such violations, and also reduces the risk for a lawsuit.
Audit
Ensure license implication rules are configured and are scanned automatically.
Remediation
Set automatic package scanning for license implications.
Usage
Run the control in your terminal:
powerpipe control run github_compliance.control.cis_supply_chain_v100_3_2_3
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run github_compliance.control.cis_supply_chain_v100_3_2_3 --share
SQL
This control uses a named query:
with repositories as ( select name_with_owner, url from github_my_repository order by name_with_owner),pipelines as ( select name, repository_full_name, pipeline from github_workflow where repository_full_name in (select name_with_owner from repositories)),vulnerability_task_repos as ( select distinct p.repository_full_name from pipelines as p, jsonb_array_elements(pipeline -> 'jobs') as job, jsonb_array_elements(job -> 'steps') as step where step ->> 'type' = 'task' and (step -> 'task' ->> 'name')::text in ( 'argonsecurity/scanner-action', 'aquasecurity/trivy-action' ))select -- Required Columns r.url as resource, case when v.repository_full_name is null then 'alarm' else 'ok' end as status, case when v.repository_full_name is null then 'Automated vulnerabilities scanning is not set for pipelines.' else 'Automated vulnerabilities scanning is set for pipelines.' end as reason, -- Additional Dimensions r.name_with_ownerfrom repositories as r left join vulnerability_task_repos as v on r.name_with_owner = v.repository_full_name;