-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat(swift): add vulns for cocoapods #5037
feat(swift): add vulns for cocoapods #5037
Conversation
20eab75
to
1394573
Compare
pkg/sbom/cyclonedx/unmarshal_test.go
Outdated
@@ -313,6 +313,50 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { | |||
}, | |||
}, | |||
}, | |||
{ | |||
name: "happy path for cocoapods with purl subpath", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any specific logic for the combination of CycloneDX and CocoaPods besides PURL? If not, we don't need to test the same thing again here as we test the PURL logic in the purl
package enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't test Package() function in purl
package.
I only found 1 my mistake with subpath
when testing SBOM manually.
That is why i added tests in SBOM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, we should add TestPackage
then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed added test for SBOM and added TestPackage
.
docs/docs/coverage/language/swift.md
Outdated
Trivy parses [Package.resolved][package-resolved] file to find dependencies. Don't forger to update (`swift package update` command) this file before scanning. | ||
|
||
## cocoapods | ||
Cocoapods uses package names in `PodFile.lock`, but [GitHub advisory database][ghsa] uses git links. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should mention the limitation that all modules are detected under the same git URL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
docs/docs/coverage/language/swift.md
Outdated
| Package manager | File | Transitive dependencies | Dev dependencies | [Dependency graph][dependency-graph] | Position | | ||
|:---------------:|------------------|:-----------------------:|:----------------:|:------------------------------------:|:--------:| | ||
| Swift | Package.resolved | ✓ | Included | - | ✓ | | ||
| Cocoapods | Podfile.lock | ✓ | Included | ✓ | - | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Cocoapods | Podfile.lock | ✓ | Included | ✓ | - | | |
| CocoaPods | Podfile.lock | ✓ | Included | ✓ | - | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
docs/docs/coverage/language/swift.md
Outdated
These may be enabled or disabled depending on the target. | ||
See [here](./index.md) for the detail. | ||
|
||
## swift |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## swift | |
## Swift |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
docs/docs/coverage/language/swift.md
Outdated
## swift | ||
Trivy parses [Package.resolved][package-resolved] file to find dependencies. Don't forger to update (`swift package update` command) this file before scanning. | ||
|
||
## cocoapods |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## cocoapods | |
## CocoaPods |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
docs/docs/coverage/language/swift.md
Outdated
[ghsa]: https://github.com/advisories?query=type%3Areviewed+ecosystem%3Aswift | ||
[swift]: https://www.swift.org/package-manager/ | ||
[package-resolved]: https://github.com/apple/swift-package-manager/blob/main/Documentation/Usage.md#resolving-versions-packageresolved-file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link should be permanent. The main branch can be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
docs/docs/coverage/language/swift.md
Outdated
Trivy parses [Package.resolved][package-resolved] file to find dependencies. Don't forger to update (`swift package update` command) this file before scanning. | ||
|
||
## cocoapods | ||
Cocoapods uses package names in `PodFile.lock`, but [GitHub advisory database][ghsa] uses git links. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cocoapods uses package names in `PodFile.lock`, but [GitHub advisory database][ghsa] uses git links. | |
CocoaPods uses package names in `PodFile.lock`, but [GitHub Advisory Database][ghsa] uses git links. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Description
Add vulnerability detection for
Cocoapods
.Update
purl
- usesubpath
.Related issues
Related PRs
utils.PackageID
for ID go-dep-parser#252Checklist