Skip to content

Conversation

@arorasoham9
Copy link
Contributor

@arorasoham9 arorasoham9 commented Jul 30, 2025

Description of the PR

This PR adds a command to guacone which utilizes the guac analyze package, PR.
guacone analyze diff --uri --sboms=https://anchore.com/syft/image/k8s.gcr.io/kube-apiserver-v1.24.1-583a02ce-8f7e-4794-91af-35f27ffeb73d,https://anchore.com/syft/image/k8s.gcr.io/kube-apiserver-v1.24.2-ee7e0a81-87de-4761-9689-4f7162d81e44
Screenshot 2024-11-19 at 10 01 36 AM

CI will likely fail as this PR is dependent on #2733. Do not review or merge.

PR Checklist

  • All commits have a Developer Certificate of Origin (DCO) -- they are generated using -s flag to git commit.
  • All new changes are covered by tests
  • If GraphQL schema is changed, make generate has been run
  • If GraphQL schema is changed, GraphQL client updates/additions have been made
  • If OpenAPI spec is changed, make generate has been run
  • If ent schema is changed, make generate has been run
  • If collectsub protobuf has been changed, make proto has been run
  • All CI checks are passing (tests and formatting)
  • All dependent PRs have already been merged

@arorasoham9 arorasoham9 requested a review from jeffmendoza as a code owner July 30, 2025 16:35
@arorasoham9 arorasoham9 marked this pull request as draft July 30, 2025 16:35
@kusari-inspector
Copy link

kusari-inspector bot commented Jul 30, 2025

Kusari Analysis Results

Analysis for commit: bc57a19, performed at: 2025-08-11T05:20:18Z

@kusari-inspector rerun - Trigger a re-analysis of this PR

@kusari-inspector feedback [your message] - Send feedback to our AI and team


Recommendation

✅ PROCEED with this Pull Request

Summary

No Flagged Issues Detected

All values appear to be within acceptable risk parameters.

No pinned version dependency changes, code issues or exposed secrets detected!

Found this helpful? Give it a 👍 or 👎 reaction!

Signed-off-by: arorasoham9 <[email protected]>
@kusari-inspector
Copy link

Kusari PR Analysis rerun based on - bc57a19 performed at: 2025-08-11T05:19:59Z - link to updated analysis

}

switch args[0] {
case "diff":
Copy link
Contributor Author

Choose a reason for hiding this comment

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

enum?


var analyzeCmd = &cobra.Command{
Use: "analyze <operation> <sboms> [flags] ",
Short: "analyze is a CLI tool tailored for comparing, intersecting, and merging Software Bill of Materials (SBOMs) within GUAC",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Description can be improved

logger.Fatalf("unable to print intersect analysis: %v", err)
}

case "union":
Copy link
Contributor Author

Choose a reason for hiding this comment

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

enum, reuse from pkg

set.StringSlice("analyze-slsa", []string{}, "two slsa to analyze")
set.Bool("analyze-uri-input", false, "input is a URI")
set.Bool("analyze-purl-input", false, "input is a pURL")
set.Bool("analyze-id-input", false, "input is an Id")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Inconsistency in flag hints case.

set.StringSlice("analyze-slsa", []string{}, "two slsa to analyze")
set.Bool("analyze-uri-input", false, "input is a URI")
set.Bool("analyze-purl-input", false, "input is a pURL")
set.Bool("analyze-id-input", false, "input is an Id")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

What id?


func init() {
set, err := cli.BuildFlags([]string{
"analyze-sboms",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Change to just sbom and slsa?

set.Bool("kubescape-filtered", false, "If false: get/watch \"sbomsyfts\", if true: get/watch \"sbomsyftfiltereds\"")

// SBOM Analyzer flags
set.StringSlice("analyze-sboms", []string{}, "two sboms to analyze")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

change to "sbom"

}

if args[0] != "intersect" && args[0] != "union" && args[0] != "diff" {
fmt.Println("invalid positional argument. Must be one of: intersect, union or diff.")
Copy link
Contributor Author

@arorasoham9 arorasoham9 Aug 12, 2025

Choose a reason for hiding this comment

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

just call it intersection, union, and difference?

Copy link
Contributor Author

@arorasoham9 arorasoham9 left a comment

Choose a reason for hiding this comment

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

small naming issues and description fixes

@stale
Copy link

stale bot commented Oct 11, 2025

This pull request has been automatically marked as stale because it has not had recent activity (60 days of inactivity).
It will be closed in 30 days if no further activity occurs.
Thank you for your contribution!

@stale stale bot added the wontfix This will not be worked on label Oct 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant