generated from oracle/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add purl as a CLI option (#401)
Signed-off-by: Trong Nhan Mai <[email protected]>
- Loading branch information
Showing
22 changed files
with
1,049 additions
and
199 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
docs/source/_static/examples/oracle-quickstart/oci-micronaut/policies/oci-micronaut-purl.dl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* Copyright (c) 2023 - 2023, Oracle and/or its affiliates. All rights reserved. */ | ||
/* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/. */ | ||
|
||
|
||
#include "prelude.dl" | ||
|
||
/** | ||
* This is an example policy for OCI Micronaut project using PURL as the identifier. | ||
* See: | ||
* https://github.com/oracle-quickstart/oci-micronaut | ||
* https://github.com/package-url/purl-spec | ||
*/ | ||
|
||
Policy("oci_micronaut_dependencies", parent, "") :- | ||
check_passed(parent, "mcn_build_service_1"), | ||
!violating_dependencies(parent, "mcn_build_service_1"), // There should not be any violating dependencies. | ||
verify_provenance(dependency, "micronaut-projects/micronaut-core"). | ||
|
||
// Projects that violate an expected check result. | ||
.decl violating_dependencies(parent: number, property: symbol) | ||
violating_dependencies(parent, property) :- | ||
is_check(property), | ||
transitive_dependency(parent, dependency), // note that since macaron by default does not traverse | ||
// to transitive, dependencies, in most cases this is | ||
// identical to `dependency(parent, repo)`. | ||
!check_passed(dependency, property), | ||
!exception_dependencies(dependency). | ||
|
||
// Exceptions for violating dependencies. | ||
.decl exception_dependencies(dependency: number) | ||
exception_dependencies(dependency) :- | ||
is_repo(dependency, "github.com/mapstruct/mapstruct", _). | ||
|
||
exception_dependencies(dependency) :- | ||
is_repo(dependency, "github.com/mysql/mysql-connector-j", _). | ||
|
||
exception_dependencies(dependency) :- | ||
is_repo(dependency, "github.com/aws/aws-msk-iam-auth", _). | ||
|
||
exception_dependencies(dependency) :- | ||
is_repo(dependency, "github.com/h2database/h2database", _). | ||
|
||
// Projects that we expect to generate a provenance. | ||
.decl verify_provenance(repo_num: number, repo_name: symbol) | ||
verify_provenance(repo_num, repo_name) :- | ||
is_repo(repo_num, repo_name, _), | ||
check_passed(repo_num, "mcn_provenance_level_three_1"), | ||
check_passed(repo_num, "mcn_provenance_expectation_1"). | ||
|
||
// Apply the policy. | ||
apply_policy_to("oci_micronaut_dependencies", component_id) :- is_component(component_id, "<target_software_component_purl>"). |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.