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

feat(php): add installed.json file support #4865

Merged
merged 28 commits into from
Jun 28, 2024

Conversation

DmitriyLewen
Copy link
Contributor

@DmitriyLewen DmitriyLewen commented Jul 24, 2023

Description

Add installed.json file support.
Supported modes - image and rootfs.

Scanning composer.lock files is only possible in fs and repo modes now

Example of work:

➜  ./trivy rootfs ./installed.json 
2023-08-29T13:24:06.376+0600    INFO    Vulnerability scanning is enabled
2023-08-29T13:24:06.376+0600    INFO    Secret scanning is enabled
2023-08-29T13:24:06.376+0600    INFO    If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2023-08-29T13:24:06.376+0600    INFO    Please see also https://aquasecurity.github.io/trivy/dev/docs/scanner/secret/#recommendation for faster secret detection
2023-08-29T13:24:06.387+0600    INFO    Number of language-specific files: 1
2023-08-29T13:24:06.387+0600    INFO    Detecting composer-installed vulnerabilities...

installed.json (composer-installed)

Total: 2 (UNKNOWN: 0, LOW: 0, MEDIUM: 2, HIGH: 0, CRITICAL: 0)

┌─────────────────┬────────────────┬──────────┬────────┬───────────────────┬───────────────┬────────────────────────────────────────────────────┐
│     Library     │ Vulnerability  │ Severity │ Status │ Installed Version │ Fixed Version │                       Title                        │
├─────────────────┼────────────────┼──────────┼────────┼───────────────────┼───────────────┼────────────────────────────────────────────────────┤
│ guzzlehttp/psr7 │ CVE-2022-24775 │ MEDIUM   │ fixed  │ 1.8.3             │ 1.8.4, 2.1.1  │ Improper Input Validation in guzzlehttp/psr7       │
│                 │                │          │        │                   │               │ https://avd.aquasec.com/nvd/cve-2022-24775         │
│                 ├────────────────┤          │        │                   ├───────────────┼────────────────────────────────────────────────────┤
│                 │ CVE-2023-29197 │          │        │                   │ 1.9.1, 2.4.5  │ Improper header name validation in guzzlehttp/psr7 │
│                 │                │          │        │                   │               │ https://avd.aquasec.com/nvd/cve-2023-29197         │
└─────────────────┴────────────────┴──────────┴────────┴───────────────────┴───────────────┴────────────────────────────────────────────────────┘

Related Issues:

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@DmitriyLewen DmitriyLewen self-assigned this Jul 24, 2023
@DmitriyLewen DmitriyLewen marked this pull request as ready for review July 26, 2023 01:22
@github-actions
Copy link

This PR is stale because it has been labeled with inactivity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and will be auto-closed. label Oct 29, 2023
@DmitriyLewen DmitriyLewen removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and will be auto-closed. label Oct 30, 2023
Copy link

This PR is stale because it has been labeled with inactivity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and will be auto-closed. label Dec 30, 2023
@knqyf263 knqyf263 removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and will be auto-closed. label Jan 1, 2024
Copy link

This PR is stale because it has been labeled with inactivity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and will be auto-closed. label Mar 10, 2024
@DmitriyLewen DmitriyLewen removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and will be auto-closed. label Mar 11, 2024
Copy link

This PR is stale because it has been labeled with inactivity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and will be auto-closed. label May 26, 2024
@github-actions github-actions bot closed this Jun 16, 2024
@DmitriyLewen DmitriyLewen reopened this Jun 17, 2024
@DmitriyLewen DmitriyLewen removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and will be auto-closed. label Jun 17, 2024
Copy link
Collaborator

@knqyf263 knqyf263 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to be late

@@ -49,7 +49,8 @@ const (
TypeCargo Type = "cargo"

// PHP
TypeComposer Type = "composer"
TypeComposer Type = "composer"
TypeComposerInstalled Type = "composer-installed"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about composer-vendor?

Suggested change
TypeComposerInstalled Type = "composer-installed"
TypeComposerInstalled Type = "composer-vendor"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

intalled.json file placed in path_to_app/vendor/... dir.
So it make sense.
Updated.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this file should be located under php/composer as installed.json is a composer-specific file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved

@knqyf263 knqyf263 added this pull request to the merge queue Jun 28, 2024
Merged via the queue into aquasecurity:main with commit edc556b Jun 28, 2024
17 checks passed
skahn007gl pushed a commit to skahn007gl/trivy that referenced this pull request Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(php): add installed.json files support
3 participants