Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 32 additions & 2 deletions app/controlplane/api/gen/frontend/attestation/v1/crafting_state.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 20 additions & 6 deletions pkg/attestation/crafter/api/attestation/v1/crafting_state.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,13 @@ message PolicyEvaluation {
PolicySASTFinding sast = 4;
PolicyLicenseViolationFinding license_violation = 5;
}

// True when the policy declared a finding_type and returned structured data,
// but validation failed at runtime. The violation was kept as a plain string
// and the finding oneof is NOT set. Consumers should treat this as a
// data-quality signal: the violation exists but structured finding data is
// missing due to a policy authoring issue.
bool finding_degraded = 6;
}

message Reference {
Expand Down
4 changes: 4 additions & 0 deletions pkg/attestation/crafter/crafter.go
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,7 @@ func (c *Crafter) addMaterial(ctx context.Context, m *schemaapi.CraftingSchema_M
c.Logger,
policies.WithAllowedHostnames(c.CraftingState.Attestation.PoliciesAllowedHostnames...),
policies.WithDefaultGate(c.CraftingState.Attestation.GetBlockOnPolicyViolation()),
policies.WithLenientFindingValidation(),
)
policyGroupResults, err := pgv.VerifyMaterial(ctx, mt, value)
if err != nil {
Expand All @@ -723,6 +724,7 @@ func (c *Crafter) addMaterial(ctx context.Context, m *schemaapi.CraftingSchema_M
c.Logger,
policies.WithAllowedHostnames(c.CraftingState.Attestation.PoliciesAllowedHostnames...),
policies.WithDefaultGate(c.CraftingState.Attestation.GetBlockOnPolicyViolation()),
policies.WithLenientFindingValidation(),
)
policyResults, err := pv.VerifyMaterial(ctx, mt, value)
if err != nil {
Expand Down Expand Up @@ -758,6 +760,7 @@ func (c *Crafter) EvaluateAttestationPolicies(ctx context.Context, attestationID
policies.WithAllowedHostnames(c.CraftingState.Attestation.PoliciesAllowedHostnames...),
policies.WithDefaultGate(c.CraftingState.Attestation.GetBlockOnPolicyViolation()),
policies.WithEvalPhase(phase),
policies.WithLenientFindingValidation(),
)
policyEvaluations, err := pv.VerifyStatement(ctx, statement)
if err != nil {
Expand All @@ -768,6 +771,7 @@ func (c *Crafter) EvaluateAttestationPolicies(ctx context.Context, attestationID
policies.WithAllowedHostnames(c.CraftingState.Attestation.PoliciesAllowedHostnames...),
policies.WithDefaultGate(c.CraftingState.Attestation.GetBlockOnPolicyViolation()),
policies.WithEvalPhase(phase),
policies.WithLenientFindingValidation(),
)
policyGroupResults, err := pgv.VerifyStatement(ctx, statement)
if err != nil {
Expand Down
Loading
Loading