Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #68 from RedHatProductSecurity/root-components
Browse files Browse the repository at this point in the history
Root components
  • Loading branch information
JimFuller-RedHat authored Mar 7, 2023
2 parents 057026f + e7633e2 commit 03b45c9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 28 deletions.
21 changes: 11 additions & 10 deletions griffon/commands/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,14 @@ def queries_grp(ctx):
type=click.STRING,
shell_complete=get_product_stream_names,
)
@click.option(
"--ofuri",
"ofuri",
type=click.STRING,
shell_complete=get_product_stream_ofuris,
help="UNDER DEVELOPMENT",
)
# TODO - underlying bindings need to support 'ofuri'
# @click.option(
# "--ofuri",
# "ofuri",
# type=click.STRING,
# shell_complete=get_product_stream_ofuris,
# help="UNDER DEVELOPMENT",
# )
@click.option(
"-s",
"strict_name_search",
Expand All @@ -61,9 +62,9 @@ def queries_grp(ctx):
)
@click.pass_context
@progress_bar
def get_product_summary(ctx, product_stream_name, ofuri, strict_name_search):
def get_product_summary(ctx, product_stream_name, strict_name_search):
"""get product stream."""
if not product_stream_name and not ofuri:
if not product_stream_name:
click.echo(ctx.get_help())
exit(0)
q = query_service.invoke(core_queries.product_stream_summary, ctx.params)
Expand Down Expand Up @@ -336,7 +337,7 @@ def components_affected_by_specific_cve_query(
name="products-affected-by-flaw",
help="List Products affected by Flaw.",
)
@click.option("--cve-id", shell_complete=get_cve_ids)
@click.argument("cve_id", required=False, type=click.STRING, shell_complete=get_cve_ids)
@click.pass_context
@progress_bar
def product_versions_affected_by_cve_query(ctx, cve_id):
Expand Down
34 changes: 16 additions & 18 deletions scripts/smoke-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,35 @@
# primitive smoke test

# service queries
griffon service component-manifest --purl "pkg:oci/ubi8-minimal-container@sha256:7679eaafa608171dd159a91529804d06fa0fbc16a2ea7f046a592a5d8e22c649?repository_url=registry.redhat.io/ubi8-minimal&tag=8.8-315"
griffon service components-affected-by-flaw --cve-id CVE-2023-25166 --type NPM
griffon service component-manifest --purl "pkg:oci/ubi8-minimal-container@sha256:7679eaafa608171dd159a91529804d06fa0fbc16a2ea7f046a592a5d8e22c649?repository_url=registry.redhat.io/ubi8-minimal&tag=8.8-315"
griffon service components-affected-by-flaw CVE-2023-25166 --type NPM
griffon service components-contain-component --purl "pkg:rpm/redhat/[email protected]_7?arch=x86_64"
griffon service product-all-components --name ossm-2.3
griffon service product-components --ofuri o:redhat:openshift:4.8.z
griffon service product-components --name rhel-9.0.0.z
griffon service product-components rhel-9.0.0.z
griffon service products-contain-component is-svg
griffon service product-manifest --name ansible_automation_platform-2.2
griffon service product-manifest --name ansible_automation_platform-2.2
griffon service product-summary --ofuri o:redhat:rhel:8.7.0.z
griffon service product-summary --name ansible_automation_platform-2.2
griffon service products-affected-by-flaw --cve-id CVE-2023-25166
griffon service product-manifest ansible_automation_platform-2.2
#griffon service product-summary --ofuri o:redhat:rhel:8.7.0.z
griffon service product-summary ansible_automation_platform-2.2
griffon service products-affected-by-flaw CVE-2023-25166

griffon --format text service products-contain-component "^webkitgtk(\d)$"
griffon --format text service components-affected-by-flaw --cve-id CVE-2023-25166
griffon --format text service components-affected-by-flaw CVE-2023-25166
griffon --format text service products-contain-component nmap
griffon service products-contain-component --purl "pkg:rpm/[email protected]"


# reports
griffon service affects
griffon service report-affects

# products
griffon entities product-streams get --name pipelines-1.6.2
griffon entities product-streams list --re-name ansible
griffon entities product-streams get pipelines-1.6.2
griffon entities product-streams list ansible

# components
griffon entities components list --name curl
griffon entities components list --name curl --namespace UPSTREAM
griffon entities components list curl
griffon entities components list curl --namespace UPSTREAM
griffon entities components get --purl "pkg:rpm/redhat/[email protected]_0.3?arch=src&epoch=2"
griffon entities components get-manifest --purl "pkg:rpm/[email protected]"
griffon entities components manifest --purl "pkg:rpm/[email protected]"
griffon entities components list --ofuri o:redhat:ansible_automation_platform:2.2 --type OCI
griffon --format text entities components list --name curl

Expand All @@ -51,5 +49,5 @@ griffon entities trackers list --help
griffon manage corgi health

# plugins
griffon z_go_vuln get --cve-id CVE-2018-16873
griffon z_osv query-by-commit-hash --commit_hash 6879efc2c1596d11a6a6ad296f80063b558d5e0f
griffon plugins go_vuln get --cve-id CVE-2018-16873
griffon plugins osv query-by-commit-hash --commit_hash 6879efc2c1596d11a6a6ad296f80063b558d5e0f

0 comments on commit 03b45c9

Please sign in to comment.