Skip to content

Add a homebrew cataloger#3724

Merged
wagoodman merged 14 commits intoanchore:mainfrom
rezmoss:cataloger-homebrew2
May 13, 2025
Merged

Add a homebrew cataloger#3724
wagoodman merged 14 commits intoanchore:mainfrom
rezmoss:cataloger-homebrew2

Conversation

@rezmoss
Copy link
Copy Markdown
Contributor

@rezmoss rezmoss commented Mar 12, 2025

This PR adds a new cataloger for homebrew on macos in syft, it scans installed homebrew packages and lets users generate sboms that include homebrew-installed software

This PR is intended for macos, future updates might add support for homebrew on linux and wsl2 @popey

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have added unit tests that cover changed behavior
  • I have tested my code in common scenarios and confirmed there are no regressions
  • I have added comments to my code, particularly in hard-to-understand sections

@github-actions github-actions Bot added the json-schema Changes the json schema label Mar 12, 2025
@kzantow
Copy link
Copy Markdown
Contributor

kzantow commented Mar 13, 2025

Thanks for the contribution @rezmoss ! I haven't been able to give this a proper review, but overall it looks like you've done the right things. I just wanted to note that contributions need to have all git commits signed-off, this will get DCO passing.

@rezmoss rezmoss force-pushed the cataloger-homebrew2 branch from 5da8a21 to e0d6354 Compare March 17, 2025 19:03
rezmoss added 5 commits March 17, 2025 15:12
* homebrew cataloger

* uptd

* fixed test

* fixed test

* fixed tests

* fixed lint

* inc schema ver

* upt schema

* fixed integration test

* fixed integration tst

* fixed test

Signed-off-by: Rez Moss <hi@rezmoss.com>
Signed-off-by: Rez Moss <hi@rezmoss.com>
fixed DCO

Signed-off-by: Rez Moss <hi@rezmoss.com>



Signed-off-by: Rez Moss <hi@rezmoss.com>
add evd anno to test

Signed-off-by: Rez Moss <hi@rezmoss.com>
Signed-off-by: Rez Moss <hi@rezmoss.com>
@rezmoss rezmoss force-pushed the cataloger-homebrew2 branch from e0d6354 to ccef42e Compare March 17, 2025 19:13
Signed-off-by: Rez Moss <hi@rezmoss.com>
@rezmoss rezmoss force-pushed the cataloger-homebrew2 branch from ccef42e to d1e1ea2 Compare March 17, 2025 19:16
@rezmoss
Copy link
Copy Markdown
Contributor Author

rezmoss commented Mar 17, 2025

Thanks for your feedback! @kzantow fixed the DCO issue and it's passing now, let me know if there's anything else to adjust, looking forward to your review ;)

Copy link
Copy Markdown
Contributor

@kzantow kzantow left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution @rezmoss! I left some feedback -- some of which are just clarifying questions; overall this looks great, just a few details to get updated


case pkg.HomebrewMetadata:
typ = orgType
author = "auth"
Copy link
Copy Markdown
Contributor

@kzantow kzantow Mar 17, 2025

Choose a reason for hiding this comment

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

If we don't have a specific author, it should default to no type / empty string so it gets omitted and output as NOASSERTION for supplier, or is this intended to mean "homebrew" somehow? Maybe homebrew itself is the supplier -- is there a way to verify a package came from the main homebrew or an alternate tap?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm leaving this out since I don't have a good field for this yet

Comment thread internal/task/package_tasks.go Outdated
Comment thread syft/pkg/homebrew.go Outdated
Comment thread syft/internal/packagemetadata/names.go Outdated
Comment thread syft/pkg/cataloger/homebrew/parse_homebrew.go Outdated
Comment thread syft/pkg/cataloger/homebrew/parse_homebrew.go Outdated
Comment thread syft/pkg/cataloger/homebrew/parse_homebrew.go Outdated
Comment thread syft/pkg/cataloger/homebrew/package.go Outdated
Comment thread syft/pkg/cataloger/homebrew/package.go Outdated
Comment thread syft/pkg/cataloger/homebrew/parse_homebrew.go Outdated
@wagoodman wagoodman self-assigned this May 12, 2025
wagoodman added 4 commits May 12, 2025 12:55
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman changed the title Cataloger homebrew (#4) Add a homebrew cataloger May 13, 2025
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@github-actions

This comment was marked as outdated.

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
wagoodman added 2 commits May 13, 2025 12:08
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman merged commit 12d91f4 into anchore:main May 13, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

json-schema Changes the json schema

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Cataloger for Homebrew on macOS

3 participants