Skip to content

Commit 13f46bc

Browse files
theresa-mnathaniel.wert
authored and
nathaniel.wert
committed
✨ Add Sonatype Lift as a dependency update tool, doc upgrade (ossf#2328)
* Add Sonatype Lift as a dependency update tool, doc upgrade Signed-off-by: Theresa Mammarella <[email protected]> * Fix integration tests Signed-off-by: Theresa Mammarella <[email protected]> * Generate docs Signed-off-by: Theresa Mammarella <[email protected]> Signed-off-by: Theresa Mammarella <[email protected]> Signed-off-by: nathaniel.wert <[email protected]>
1 parent 54ce878 commit 13f46bc

7 files changed

+52
-25
lines changed

checks/dependency_update_tool_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func TestDependencyUpdateTool(t *testing.T) {
7575
SearchCommits: []clients.Commit{{Committer: clients.User{ID: 111111111}}},
7676
CallSearchCommits: 1,
7777
expected: scut.TestReturn{
78-
NumberOfWarn: 2,
78+
NumberOfWarn: 1,
7979
},
8080
},
8181
{
@@ -87,7 +87,7 @@ func TestDependencyUpdateTool(t *testing.T) {
8787
SearchCommits: []clients.Commit{},
8888
CallSearchCommits: 1,
8989
expected: scut.TestReturn{
90-
NumberOfWarn: 2,
90+
NumberOfWarn: 1,
9191
},
9292
},
9393

checks/evaluation/dependency_update_tool.go

+2-6
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,8 @@ func DependencyUpdateTool(name string, dl checker.DetailLogger,
3333
// Apply the policy evaluation.
3434
if r.Tools == nil || len(r.Tools) == 0 {
3535
dl.Warn(&checker.LogMessage{
36-
Text: `dependabot config file not detected in source location.
37-
We recommend setting this configuration in code so it can be easily verified by others.`,
38-
})
39-
dl.Warn(&checker.LogMessage{
40-
Text: `renovatebot config file not detected in source location.
41-
We recommend setting this configuration in code so it can be easily verified by others.`,
36+
Text: `Config file not detected in source location for dependabot, renovatebot, Sonatype Lift, or
37+
PyUp (Python). We recommend setting this configuration in code so it can be easily verified by others.`,
4238
})
4339
return checker.CreateMinScoreResult(name, "no update tool detected")
4440
}

checks/evaluation/dependency_update_tool_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func TestDependencyUpdateTool(t *testing.T) {
7676
err: false,
7777
expected: scut.TestReturn{
7878
Score: 0,
79-
NumberOfWarn: 2,
79+
NumberOfWarn: 1,
8080
},
8181
},
8282
{

checks/raw/dependency_update_tool.go

+13
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,19 @@ var checkDependencyFileExists fileparser.DoWhileTrueOnFilename = func(name strin
112112
},
113113
},
114114
})
115+
case ".lift.toml", ".lift/config.toml":
116+
*ptools = append(*ptools, checker.Tool{
117+
Name: "Sonatype Lift",
118+
URL: asPointer("https://lift.sonatype.com"),
119+
Desc: asPointer("Automated dependency updates. Multi-platform and multi-language."),
120+
Files: []checker.File{
121+
{
122+
Path: name,
123+
Type: checker.FileTypeSource,
124+
Offset: checker.OffsetDefault,
125+
},
126+
},
127+
})
115128
default:
116129
// Continue iterating.
117130
return true, nil

checks/raw/dependency_update_tool_test.go

+18
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,24 @@ func Test_checkDependencyFileExists(t *testing.T) {
119119
want: false,
120120
wantErr: false,
121121
},
122+
{
123+
name: ".lift.toml",
124+
args: args{
125+
name: ".lift.toml",
126+
data: &[]checker.Tool{},
127+
},
128+
want: false,
129+
wantErr: false,
130+
},
131+
{
132+
name: ".lift/config.toml",
133+
args: args{
134+
name: ".lift/config.toml",
135+
data: &[]checker.Tool{},
136+
},
137+
want: false,
138+
wantErr: false,
139+
},
122140
}
123141
for _, tt := range tests {
124142
tt := tt

docs/checks.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,12 @@ The highest score is awarded when all workflows avoid the dangerous code pattern
292292
Risk: `High` (possibly vulnerable to attacks on known flaws)
293293

294294
This check tries to determine if the project uses a dependency update tool,
295-
specifically [dependabot](https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates) or
296-
[renovatebot](https://docs.renovatebot.com/configuration-options/). Out-of-date
297-
dependencies make a project vulnerable to known flaws and prone to attacks.
295+
specifically one of:
296+
- [dependabot](https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates)
297+
- [renovatebot](https://docs.renovatebot.com/configuration-options/)
298+
- [Sonatype Lift](https://help.sonatype.com/lift/getting-started)
299+
- [PyUp](https://docs.pyup.io/docs) (Python)
300+
Out-of-date dependencies make a project vulnerable to known flaws and prone to attacks.
298301
These tools automate the process of updating dependencies by scanning for
299302
outdated or insecure requirements, and opening a pull request to update them if
300303
found.
@@ -310,7 +313,7 @@ low score is therefore not a definitive indication that the project is at risk.
310313

311314

312315
**Remediation steps**
313-
- Signup for automatic dependency updates with [dependabot](https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates) or [renovatebot](https://docs.renovatebot.com/configuration-options/) and place the config file in the locations that are recommended by these tools. Due to https://github.com/dependabot/dependabot-core/issues/2804 Dependabot can be enabled for forks where security updates have ever been turned on so projects maintaining stable forks should evaluate whether this behavior is satisfactory before turning it on.
316+
- Signup for automatic dependency updates with one of the previously listed dependency update tools and place the config file in the locations that are recommended by these tools. Due to https://github.com/dependabot/dependabot-core/issues/2804 Dependabot can be enabled for forks where security updates have ever been turned on so projects maintaining stable forks should evaluate whether this behavior is satisfactory before turning it on.
314317
- Unlike dependabot, renovatebot has support to migrate dockerfiles' dependencies from version pinning to hash pinning via the [pinDigests setting](https://docs.renovatebot.com/configuration-options/#pindigests) without aditional manual effort.
315318

316319
## Fuzzing
@@ -478,9 +481,7 @@ dependencies using the [GitHub dependency graph](https://docs.github.com/en/code
478481
- If your project is producing an application and the package manager supports lock files (e.g. `package-lock.json` for npm), make sure to check these in the source code as well. These files maintain signatures for the entire dependency tree and saves from future exploitation in case the package is compromised.
479482
- For Dockerfiles used in building and releasing your project, pin dependencies by hash. See [Dockerfile](https://github.com/ossf/scorecard/blob/main/cron/internal/worker/Dockerfile) for example. If you are using a manifest list to support builds across multiple architectures, you can pin to the manifest list hash instead of a single image hash. You can use a tool like [crane](https://github.com/google/go-containerregistry/blob/main/cmd/crane/README.md) to obtain the hash of the manifest list like in this [example](https://github.com/ossf/scorecard/issues/1773#issuecomment-1076699039).
480483
- For GitHub workflows used in building and releasing your project, pin dependencies by hash. See [main.yaml](https://github.com/ossf/scorecard/blob/f55b86d6627cc3717e3a0395e03305e81b9a09be/.github/workflows/main.yml#L27) for example. To determine the permissions needed for your workflows, you may use [StepSecurity's online tool](https://app.stepsecurity.io/) by ticking the "Pin actions to a full length commit SHA". You may also tick the "Restrict permissions for GITHUB_TOKEN" to fix issues found by the Token-Permissions check.
481-
- To help update your dependencies after pinning them, use tools such as
482-
Github's [dependabot](https://github.blog/2020-06-01-keep-all-your-packages-up-to-date-with-dependabot/)
483-
or [renovate bot](https://github.com/renovatebot/renovate).
484+
- To help update your dependencies after pinning them, use tools such as those listed for the dependency update tool check.
484485

485486
## SAST
486487

docs/checks/internal/checks.yaml

+8-9
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,12 @@ checks:
5757
Risk: `High` (possibly vulnerable to attacks on known flaws)
5858
5959
This check tries to determine if the project uses a dependency update tool,
60-
specifically [dependabot](https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates) or
61-
[renovatebot](https://docs.renovatebot.com/configuration-options/). Out-of-date
62-
dependencies make a project vulnerable to known flaws and prone to attacks.
60+
specifically one of:
61+
- [dependabot](https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates)
62+
- [renovatebot](https://docs.renovatebot.com/configuration-options/)
63+
- [Sonatype Lift](https://help.sonatype.com/lift/getting-started)
64+
- [PyUp](https://docs.pyup.io/docs) (Python)
65+
Out-of-date dependencies make a project vulnerable to known flaws and prone to attacks.
6366
These tools automate the process of updating dependencies by scanning for
6467
outdated or insecure requirements, and opening a pull request to update them if
6568
found.
@@ -75,9 +78,7 @@ checks:
7578
7679
remediation:
7780
- >-
78-
Signup for automatic dependency updates with
79-
[dependabot](https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates) or
80-
[renovatebot](https://docs.renovatebot.com/configuration-options/) and place
81+
Signup for automatic dependency updates with one of the previously listed dependency update tools and place
8182
the config file in the locations that are recommended by these tools. Due to
8283
https://github.com/dependabot/dependabot-core/issues/2804 Dependabot can
8384
be enabled for forks where security updates have ever been turned on so projects
@@ -506,9 +507,7 @@ checks:
506507
the "Pin actions to a full length commit SHA". You may also tick the "Restrict permissions for GITHUB_TOKEN" to fix issues found
507508
by the Token-Permissions check.
508509
- >-
509-
To help update your dependencies after pinning them, use tools such as
510-
Github's [dependabot](https://github.blog/2020-06-01-keep-all-your-packages-up-to-date-with-dependabot/)
511-
or [renovate bot](https://github.com/renovatebot/renovate).
510+
To help update your dependencies after pinning them, use tools such as those listed for the dependency update tool check.
512511
SAST:
513512
risk: Medium
514513
tags: supply-chain, security, testing

0 commit comments

Comments
 (0)