Skip to content
Merged
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
31 changes: 25 additions & 6 deletions app/controlplane/api/controlplane/v1/response_messages.pb.go

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

4 changes: 4 additions & 0 deletions app/controlplane/api/controlplane/v1/response_messages.proto
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ message AttestationItem {
bool blocked = 3;
bool has_violations = 4;
bool has_gated_violations = 5;
// Total number of policy evaluations
int32 evaluations_count = 6;
// Total number of policy violations across all evaluations
int32 violations_count = 7;
}

message EnvVariable {
Expand Down

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.

2 changes: 2 additions & 0 deletions app/controlplane/internal/service/attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,8 @@ func bizAttestationToPb(att *biz.Attestation, predicate chainloop.NormalizablePr
Blocked: policyEvaluationStatus.Blocked,
HasViolations: policyEvaluationStatus.HasViolations,
HasGatedViolations: policyEvaluationStatus.HasGatedViolations,
EvaluationsCount: int32(policyEvaluationStatus.EvaluationsCount),
ViolationsCount: int32(policyEvaluationStatus.ViolationsCount),
},
Bundle: att.Bundle,
}, nil
Expand Down
4 changes: 4 additions & 0 deletions pkg/attestation/renderer/chainloop/chainloop.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ type PolicyEvaluationStatus struct {
HasViolations bool
// Whether the attestation has gated policy violations
HasGatedViolations bool
// Total number of policy evaluations
EvaluationsCount int
// Total number of policy violations across all evaluations
ViolationsCount int
}

type NormalizedMaterial struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@
"policyAttBlocked": false,
"policyBlockBypassEnabled": false,
"policyCheckBlockingStrategy": "ADVISORY",
"policyEvaluationsCount": 0,
"policyHasViolations": false,
"policyViolationsCount": 0,
"runnerType": "RUNNER_TYPE_UNSPECIFIED"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@
"policyAttBlocked": false,
"policyBlockBypassEnabled": false,
"policyCheckBlockingStrategy": "ADVISORY",
"policyEvaluationsCount": 0,
"policyHasViolations": false,
"policyViolationsCount": 0,
"runnerType": "RUNNER_TYPE_UNSPECIFIED"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@
}
]
},
"policyEvaluationsCount": 1,
"policyHasViolations": true,
"policyViolationsCount": 1,
"runnerType": "GITHUB_ACTION"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@
}
]
},
"policyEvaluationsCount": 1,
"policyHasViolations": true,
"policyViolationsCount": 1,
"runnerType": "GITHUB_ACTION"
}
}
Loading
Loading