|
| 1 | +--- |
| 2 | +linkTitle: "API Reference" |
| 3 | +weight: 10 |
| 4 | +description: > |
| 5 | + OpenReports API Reference |
| 6 | +--- |
| 7 | + |
| 8 | +# API Reference |
| 9 | + |
| 10 | +## Packages |
| 11 | +- [reports.x-k8s.io/v1beta2](#reportsx-k8siov1beta2) |
| 12 | + |
| 13 | + |
| 14 | +## reports.x-k8s.io/v1beta2 |
| 15 | + |
| 16 | +Package v1beta2 contains API Schema definitions for the policy v1beta2 API group |
| 17 | + |
| 18 | +Package v1beta2 contains API Schema definitions for the policy v1beta2 API group |
| 19 | + |
| 20 | +### Resource Types |
| 21 | +- [ClusterPolicyReport](#clusterpolicyreport) |
| 22 | +- [ClusterPolicyReportList](#clusterpolicyreportlist) |
| 23 | +- [PolicyReport](#policyreport) |
| 24 | +- [PolicyReportList](#policyreportlist) |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | +#### ClusterPolicyReport |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | +ClusterPolicyReport is the Schema for the clusterpolicyreports API |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | +_Appears in:_ |
| 37 | +- [ClusterPolicyReportList](#clusterpolicyreportlist) |
| 38 | + |
| 39 | +| Field | Description | Default | Validation | |
| 40 | +| --- | --- | --- | --- | |
| 41 | +| `apiVersion` _string_ | `reports.x-k8s.io/v1beta2` | | | |
| 42 | +| `kind` _string_ | `ClusterPolicyReport` | | | |
| 43 | +| `metadata` _[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#objectmeta-v1-meta)_ | Refer to Kubernetes API documentation for fields of `metadata`. | | | |
| 44 | +| `source` _string_ | Source is an identifier for the source e.g. a policy engine that manages this report.<br />Use this field if all the results are produced by a single policy engine.<br />If the results are produced by multiple sources e.g. different engines or scanners,<br />then use the Source field at the PolicyReportResult level. | | | |
| 45 | +| `scope` _[ObjectReference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#objectreference-v1-core)_ | Scope is an optional reference to the report scope (e.g. a Deployment, Namespace, or Node) | | | |
| 46 | +| `scopeSelector` _[LabelSelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#labelselector-v1-meta)_ | ScopeSelector is an optional selector for multiple scopes (e.g. Pods).<br />Either one of, or none of, but not both of, Scope or ScopeSelector should be specified. | | | |
| 47 | +| `configuration` _[PolicyReportConfiguration](#policyreportconfiguration)_ | Configuration is an optional field which can be used to specify<br />a contract between PolicyReport generators and consumers | | | |
| 48 | +| `summary` _[PolicyReportSummary](#policyreportsummary)_ | PolicyReportSummary provides a summary of results | | | |
| 49 | +| `results` _[PolicyReportResult](#policyreportresult) array_ | PolicyReportResult provides result details | | | |
| 50 | + |
| 51 | + |
| 52 | +#### ClusterPolicyReportList |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | +ClusterPolicyReportList contains a list of ClusterPolicyReport |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | +| Field | Description | Default | Validation | |
| 63 | +| --- | --- | --- | --- | |
| 64 | +| `apiVersion` _string_ | `reports.x-k8s.io/v1beta2` | | | |
| 65 | +| `kind` _string_ | `ClusterPolicyReportList` | | | |
| 66 | +| `metadata` _[ListMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#listmeta-v1-meta)_ | Refer to Kubernetes API documentation for fields of `metadata`. | | | |
| 67 | +| `items` _[ClusterPolicyReport](#clusterpolicyreport) array_ | | | | |
| 68 | + |
| 69 | + |
| 70 | +#### Limits |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | +_Appears in:_ |
| 79 | +- [PolicyReportConfiguration](#policyreportconfiguration) |
| 80 | + |
| 81 | +| Field | Description | Default | Validation | |
| 82 | +| --- | --- | --- | --- | |
| 83 | +| `maxResults` _integer_ | MaxResults is the maximum number of results contained in the report | | | |
| 84 | +| `statusFilter` _[StatusFilter](#statusfilter) array_ | StatusFilter indicates that the PolicyReport contains only those reports with statuses specified in this list | | Enum: [pass fail warn error skip] <br /> | |
| 85 | + |
| 86 | + |
| 87 | +#### PolicyReport |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | +PolicyReport is the Schema for the policyreports API |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | +_Appears in:_ |
| 96 | +- [PolicyReportList](#policyreportlist) |
| 97 | + |
| 98 | +| Field | Description | Default | Validation | |
| 99 | +| --- | --- | --- | --- | |
| 100 | +| `apiVersion` _string_ | `reports.x-k8s.io/v1beta2` | | | |
| 101 | +| `kind` _string_ | `PolicyReport` | | | |
| 102 | +| `metadata` _[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#objectmeta-v1-meta)_ | Refer to Kubernetes API documentation for fields of `metadata`. | | | |
| 103 | +| `source` _string_ | Source is an identifier for the source e.g. a policy engine that manages this report.<br />Use this field if all the results are produced by a single policy engine.<br />If the results are produced by multiple sources e.g. different engines or scanners,<br />then use the Source field at the PolicyReportResult level. | | | |
| 104 | +| `scope` _[ObjectReference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#objectreference-v1-core)_ | Scope is an optional reference to the report scope (e.g. a Deployment, Namespace, or Node) | | | |
| 105 | +| `scopeSelector` _[LabelSelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#labelselector-v1-meta)_ | ScopeSelector is an optional selector for multiple scopes (e.g. Pods).<br />Either one of, or none of, but not both of, Scope or ScopeSelector should be specified. | | | |
| 106 | +| `configuration` _[PolicyReportConfiguration](#policyreportconfiguration)_ | Configuration is an optional field which can be used to specify<br />a contract between PolicyReport generators and consumers | | | |
| 107 | +| `summary` _[PolicyReportSummary](#policyreportsummary)_ | PolicyReportSummary provides a summary of results | | | |
| 108 | +| `results` _[PolicyReportResult](#policyreportresult) array_ | PolicyReportResult provides result details | | | |
| 109 | + |
| 110 | + |
| 111 | +#### PolicyReportConfiguration |
| 112 | + |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | + |
| 118 | + |
| 119 | +_Appears in:_ |
| 120 | +- [ClusterPolicyReport](#clusterpolicyreport) |
| 121 | +- [PolicyReport](#policyreport) |
| 122 | + |
| 123 | +| Field | Description | Default | Validation | |
| 124 | +| --- | --- | --- | --- | |
| 125 | +| `limits` _[Limits](#limits)_ | | | | |
| 126 | + |
| 127 | + |
| 128 | +#### PolicyReportList |
| 129 | + |
| 130 | + |
| 131 | + |
| 132 | +PolicyReportList contains a list of PolicyReport |
| 133 | + |
| 134 | + |
| 135 | + |
| 136 | + |
| 137 | + |
| 138 | +| Field | Description | Default | Validation | |
| 139 | +| --- | --- | --- | --- | |
| 140 | +| `apiVersion` _string_ | `reports.x-k8s.io/v1beta2` | | | |
| 141 | +| `kind` _string_ | `PolicyReportList` | | | |
| 142 | +| `metadata` _[ListMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#listmeta-v1-meta)_ | Refer to Kubernetes API documentation for fields of `metadata`. | | | |
| 143 | +| `items` _[PolicyReport](#policyreport) array_ | | | | |
| 144 | + |
| 145 | + |
| 146 | +#### PolicyReportResult |
| 147 | + |
| 148 | + |
| 149 | + |
| 150 | +PolicyReportResult provides the result for an individual policy |
| 151 | + |
| 152 | + |
| 153 | + |
| 154 | +_Appears in:_ |
| 155 | +- [ClusterPolicyReport](#clusterpolicyreport) |
| 156 | +- [PolicyReport](#policyreport) |
| 157 | + |
| 158 | +| Field | Description | Default | Validation | |
| 159 | +| --- | --- | --- | --- | |
| 160 | +| `source` _string_ | Source is an identifier for the policy engine that manages this report<br />If the Source is specified at this level, it will override the Source<br />field set at the PolicyReport level | | | |
| 161 | +| `policy` _string_ | Policy is the name or identifier of the policy | | | |
| 162 | +| `rule` _string_ | Rule is the name or identifier of the rule within the policy | | | |
| 163 | +| `category` _string_ | Category indicates policy category | | | |
| 164 | +| `severity` _[PolicyResultSeverity](#policyresultseverity)_ | Severity indicates policy check result criticality | | Enum: [critical high low medium info] <br /> | |
| 165 | +| `timestamp` _[Timestamp](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#timestamp-v1-meta)_ | Timestamp indicates the time the result was found | | | |
| 166 | +| `result` _[PolicyResult](#policyresult)_ | Result indicates the outcome of the policy rule execution | | Enum: [pass fail warn error skip] <br /> | |
| 167 | +| `scored` _boolean_ | Scored indicates if this result is scored | | | |
| 168 | +| `resources` _[ObjectReference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#objectreference-v1-core) array_ | Subjects is an optional reference to the checked Kubernetes resources | | | |
| 169 | +| `resourceSelector` _[LabelSelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#labelselector-v1-meta)_ | ResourceSelector is an optional label selector for checked Kubernetes resources.<br />For example, a policy result may apply to all pods that match a label.<br />Either a Subject or a ResourceSelector can be specified. If neither are provided, the<br />result is assumed to be for the policy report scope. | | | |
| 170 | +| `message` _string_ | Description is a short user friendly message for the policy rule | | | |
| 171 | +| `properties` _object (keys:string, values:string)_ | Properties provides additional information for the policy rule | | | |
| 172 | + |
| 173 | + |
| 174 | +#### PolicyReportSummary |
| 175 | + |
| 176 | + |
| 177 | + |
| 178 | +PolicyReportSummary provides a status count summary |
| 179 | + |
| 180 | + |
| 181 | + |
| 182 | +_Appears in:_ |
| 183 | +- [ClusterPolicyReport](#clusterpolicyreport) |
| 184 | +- [PolicyReport](#policyreport) |
| 185 | + |
| 186 | +| Field | Description | Default | Validation | |
| 187 | +| --- | --- | --- | --- | |
| 188 | +| `pass` _integer_ | Pass provides the count of policies whose requirements were met | | | |
| 189 | +| `fail` _integer_ | Fail provides the count of policies whose requirements were not met | | | |
| 190 | +| `warn` _integer_ | Warn provides the count of non-scored policies whose requirements were not met | | | |
| 191 | +| `error` _integer_ | Error provides the count of policies that could not be evaluated | | | |
| 192 | +| `skip` _integer_ | Skip indicates the count of policies that were not selected for evaluation | | | |
| 193 | + |
| 194 | + |
| 195 | +#### PolicyResult |
| 196 | + |
| 197 | +_Underlying type:_ _string_ |
| 198 | + |
| 199 | +PolicyResult has one of the following values: |
| 200 | + - pass: the policy requirements are met |
| 201 | + - fail: the policy requirements are not met |
| 202 | + - warn: the policy requirements are not met and the policy is not scored |
| 203 | + - error: the policy could not be evaluated |
| 204 | + - skip: the policy was not selected based on user inputs or applicability |
| 205 | + |
| 206 | +_Validation:_ |
| 207 | +- Enum: [pass fail warn error skip] |
| 208 | + |
| 209 | +_Appears in:_ |
| 210 | +- [PolicyReportResult](#policyreportresult) |
| 211 | + |
| 212 | + |
| 213 | + |
| 214 | +#### PolicyResultSeverity |
| 215 | + |
| 216 | +_Underlying type:_ _string_ |
| 217 | + |
| 218 | +PolicyResultSeverity has one of the following values: |
| 219 | + - critical |
| 220 | + - high |
| 221 | + - low |
| 222 | + - medium |
| 223 | + - info |
| 224 | + |
| 225 | +_Validation:_ |
| 226 | +- Enum: [critical high low medium info] |
| 227 | + |
| 228 | +_Appears in:_ |
| 229 | +- [PolicyReportResult](#policyreportresult) |
| 230 | + |
| 231 | + |
| 232 | + |
| 233 | +#### StatusFilter |
| 234 | + |
| 235 | +_Underlying type:_ _string_ |
| 236 | + |
| 237 | +StatusFilter is used by PolicyReport generators to write only those reports whose status is specified by the filters |
| 238 | + |
| 239 | +_Validation:_ |
| 240 | +- Enum: [pass fail warn error skip] |
| 241 | + |
| 242 | +_Appears in:_ |
| 243 | +- [Limits](#limits) |
0 commit comments