Get list of projects
- endorctl
- curl
- HTTP
meta.name to only get the name and UUID of all projects. The UUID is always returned.
- endorctl
- curl
- HTTP
Get project UUID
The project UUID connects all the objects for a given project. One way to get the project UUID is to extract it from theuuid field in the Project object. For more information, see Resource kinds.
- endorctl
- curl
- HTTP
Get list of findings for a project
Use the following filter to get a list of findings for a given project:spec.project_uuid==<project-uuid>
- endorctl
- curl
- HTTP
Get number of findings for a project
Add the--count flag to just get the number of findings. This is much faster than retrieving the objects.
- endorctl
- curl
- HTTP
Get number of findings for a project by severity
Use grouping to get the number of findings by severity.- endorctl
- curl
- HTTP
Get list of findings for reachable functions
Use the following filter to get a list of findings for reachable functions:spec.finding_tags contains FINDING_TAGS_REACHABLE_FUNCTION
For a list of all finding attributes, see Finding tags.
- endorctl
- curl
- HTTP
Get list of findings for reachable functions for a project
Combine the previous filters to get a list of findings for reachable functions for a given project:spec.project_uuid==<project-uuid> and spec.finding_tags contains FINDING_TAGS_REACHABLE_FUNCTION
- endorctl
- curl
- HTTP
Get list of findings in a category
Use the following filter to get a list of findings in the RSPM category:spec.finding_categories contains FINDING_CATEGORY_SCPM
For a list of all finding categories, see Finding categories.
- endorctl
- curl
- HTTP
Get list of findings for a vulnerability
Use the following filter to get a list of findings for a given vulnerability, for example"CVE-2024-53677" or "GHSA-43mq-6xmg-29vm":
spec.finding_metadata.vulnerability.spec.aliases contains CVE-2024-53677
Note: You can replace the CVE ID in the example with any other vulnerability ID type, such as GHSA, BIT, GO, PYSEC, or OVAL.
- endorctl
- curl
- HTTP
Get list of findings for a code owner
Use thespec.code_owners.owners field to filter findings based on code owner.
Note: Code owners are automatically assigned based on the CodeOwners object for the project, which Endor Labs generates from the CODEOWNERS file in the default branch. For projects without a CODEOWNERS file, manage the CodeOwners object through the API.
- endorctl
- curl
- HTTP
Group findings by code owner
Use thespec.code_owners.owners field to group findings based on code owner.
Note: Code owners are automatically assigned based on the CodeOwners object for the project, which Endor Labs generates from the CODEOWNERS file in the default branch. For projects without a CODEOWNERS file, manage the CodeOwners object through the API.
- endorctl
- curl
- HTTP
Get finding snooze history
Endor Labs captures snooze updates as FindingLog objects.- endorctl
- curl
- HTTP
Get Endor Labs scores for an OSS package
-
Set the namespace to
"oss"because the OSS tenant stores data for OSS packages. -
Endor Labs stores package version scores in the
"package_version_scorecard"Metric object, in thespec.metric_values.scorecard.score_card.category_scoresfield, so you need to get this Metric object for the given OSS package. For more information, see the Metric resource kind documentation. -
To get Metric objects belonging to a given package version, get the UUID of the corresponding PackageVersion object. The PackageVersion object name must be in the format
<ecosystem>://<name>@<version>, for example:"mvn://ch.qos.logback:logback-core@1.3.3". For more information, see the PackageVersion resource kind documentation. Once you have the PackageVersion object, use the followingjqcommand to extract the UUID:jq '.list.object[].uuid' -
Get the Metric object corresponding to the PackageVersion UUID using the following two filters:
meta.name==package_version_scorecardmeta.parent_uuid==<package-version-uuid>
-
Use the following
jqcommand to extract just the Endor Labs scores from the Metric object:jq '.list.objects[].spec.metric_values.scorecard.score_card.category_scores'
- endorctl
- curl
- HTTP
Get license text from a license finding
-
Look up a license-related Finding object for a dependency using the following filter:
spec.finding_categories contains [FINDING_CATEGORY_LICENSE_RISK] and spec.finding_tags not contains [FINDING_TAGS_SELF] -
Get the name of the corresponding PackageVersion object from the
spec.target_dependency_package_namefield. If we have a list of Finding objects, we can use the followingjqcommand to get the PackageVersion name:jq '.list.objects[].spec.target_dependency_package_name' -
Look up the PackageVersion object and store the UUID.
Note: If this is an OSS dependency we must use the “
oss” namespace. -
Look up the corresponding
pkg_version_info_for_licenseMetric object using the following filter:meta.name==pkg_version_info_for_license&meta.parent_uuid==$UUIDNote: The Metric is in the same namespace as the PackageVersion.
-
Use the following
jqcommand to extract the license text from the Metric object:jq '.list.objects[].spec.metric_values.licenseInfoType.license_info.all_licenses[].matched_text'
- endorctl
- curl
Get list of projects using a tool
-
Endor Labs stores CI/CD tool metrics in the
version_cicd_toolsMetric object, in thespec.metric_values.CiCdTools.ci_cd_tools.toolslist. Use the following filter to get all such Metrics with entries for the given tool name (GitHub Actions in this example). For more information, see the Metric resource kind documentation.meta.name==version_cicd_tools and spec.metric_values.CiCdTools.ci_cd_tools.tools.name=='GitHub Actions' -
Use the following
jqcommand to get the UUIDs of the corresponding Project objects:.list.objects[].spec.project_uuid - Remove duplicate Project UUIDs (a Project can have multiple repository versions).
- Use the UUIDs to get the corresponding Project objects.
- endorctl
- curl
Get the latest scan result
-
To get the latest object, first sort the objects in descending order, based on the
meta.create_timefield:list_parameters.sort.order=SORT_ENTRY_ORDER_DESC&list_parameters.sort.path=meta.create_time -
Then, to get only the latest object, set the page size to 1:
list_parameters.page_size=1
- endorctl
- curl
- HTTP
Create a policy
The following example uses the Create Policy endpoint to create a new policy.- endorctl
- curl
- HTTP
Update a policy to include a project
The following example uses the Update Policy endpoint to apply a policy to a given project by updating thespec.project_selector tag list.
- endorctl
- curl
- HTTP
Update a policy to exclude a project
The following example uses the Update Policy endpoint to exclude a given project from a policy by updating thespec.project_exceptions tag list.
- endorctl
- curl
- HTTP
Update an exception policy to apply custom tags to matching findings
The following example uses the Update Policy endpoint to specify a list of custom tags to apply to findings matching a given exception policy.- endorctl
- curl
- HTTP
Upgrade a policy to use the latest template version
The following example uses the Update Policy endpoint to upgrade a given policy to use the latest template version.- endorctl
- curl
- HTTP
Delete a policy
The following example uses the Delete Policy endpoint to delete a policy.- endorctl
- curl
- HTTP
Add meta tags to an object
The following example uses the Update Finding endpoint to add custom tags to a finding by updating themeta.tags field.
- endorctl
- curl
- HTTP
Get data from child namespaces
Use thetraverse option to include data from child namespaces as well as the parent namespace.
- endorctl
- curl
- HTTP