Skip to content

Commit

Permalink
Merge pull request #13 from jritter/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
jritter authored Mar 16, 2024
2 parents e850e73 + 67eeccc commit e63aa5e
Show file tree
Hide file tree
Showing 14 changed files with 549 additions and 113 deletions.
158 changes: 98 additions & 60 deletions configs/grafana/dashboards/openscap_dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,11 @@
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 1,
"id": 3,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -81,7 +77,7 @@
{
"id": "color",
"value": {
"fixedColor": "semi-dark-green",
"fixedColor": "green",
"mode": "fixed"
}
}
Expand All @@ -96,7 +92,7 @@
{
"id": "color",
"value": {
"fixedColor": "semi-dark-red",
"fixedColor": "red",
"mode": "fixed"
}
}
Expand All @@ -112,21 +108,16 @@
},
"id": 2,
"options": {
"displayLabels": [
"percent"
],
"displayLabels": ["percent"],
"legend": {
"displayMode": "list",
"placement": "bottom",
"values": [
"percent"
]
"showLegend": true,
"values": ["percent"]
},
"pieType": "pie",
"pieType": "donut",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
Expand All @@ -137,25 +128,21 @@
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"editorMode": "code",
"expr": "count_values(\"openscap_result\", openscap_results)",
"disableTextWrap": false,
"editorMode": "builder",
"expr": "count_values(\"openscap_result\", openscap_results{target=~\"$target\", severity=~\"$severity\"})",
"fullMetaSearch": false,
"includeNullMetadata": true,
"legendFormat": "__auto",
"range": true,
"refId": "A"
"refId": "A",
"useBackend": false
}
],
"title": "Overall Check status",
"type": "piechart"
},
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -187,48 +174,48 @@
"id": 4,
"options": {
"displayMode": "gradient",
"maxVizHeight": 300,
"minVizHeight": 10,
"minVizWidth": 0,
"namePlacement": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
"showUnfilled": true
"showUnfilled": true,
"sizing": "auto",
"valueMode": "color"
},
"pluginVersion": "9.0.5",
"pluginVersion": "10.4.0",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"disableTextWrap": false,
"editorMode": "code",
"expr": "count by (severity) (openscap_results == 0)",
"expr": "count by(severity) (openscap_results{target=~\"$target\"} == 0)",
"fullMetaSearch": false,
"includeNullMetadata": true,
"legendFormat": "__auto",
"range": true,
"refId": "A"
"refId": "A",
"useBackend": false
}
],
"title": "Failed Rules by Severity",
"type": "bargauge"
},
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "auto",
"displayMode": "auto",
"cellOptions": {
"type": "auto"
},
"inspect": false
},
"mappings": [],
Expand Down Expand Up @@ -281,32 +268,32 @@
},
"id": 6,
"options": {
"cellHeight": "sm",
"footer": {
"countRows": false,
"fields": "",
"reducer": [
"sum"
],
"reducer": ["sum"],
"show": false
},
"showHeader": true,
"sortBy": []
},
"pluginVersion": "9.0.5",
"pluginVersion": "10.4.0",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"editorMode": "code",
"disableTextWrap": false,
"editorMode": "builder",
"exemplar": false,
"expr": "openscap_results == 0",
"expr": "openscap_results{target=~\"$target\", severity=~\"$severity\"} == 0",
"format": "table",
"fullMetaSearch": false,
"includeNullMetadata": true,
"instant": true,
"interval": "",
"legendFormat": "__auto",
"range": false,
"refId": "A"
"refId": "A",
"useBackend": false
}
],
"title": "Failed Rules",
Expand Down Expand Up @@ -336,19 +323,70 @@
"type": "table"
}
],
"schemaVersion": 36,
"style": "dark",
"refresh": "",
"schemaVersion": 39,
"tags": [],
"templating": {
"list": []
"list": [
{
"allValue": ".+",
"current": {
"selected": false,
"text": "All",
"value": "$__all"
},
"definition": "label_values(openscap_results,target)",
"hide": 0,
"includeAll": true,
"label": "OpenSCAP Target",
"multi": false,
"name": "target",
"options": [],
"query": {
"qryType": 1,
"query": "label_values(openscap_results,target)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
},
{
"allValue": ".+",
"current": {
"selected": false,
"text": "All",
"value": "$__all"
},
"definition": "label_values(openscap_results,severity)",
"hide": 0,
"includeAll": true,
"label": "Severity",
"multi": false,
"name": "severity",
"options": [],
"query": {
"qryType": 1,
"query": "label_values(openscap_results,severity)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
}
]
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "SCAPinoculars",
"title": "SCAPinoculars OpenSCAP Dashboard",
"version": 9,
"weekStart": ""
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion helm/scapinoculars/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ scapinoculars:
reportPVCs:
- ocp4-cis
- ocp4-cis-node-master
- ocp4-cis-node-worker
inputDir: /input
outputDir: /output
outputPVC:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
labels:
operators.coreos.com/grafana-operator.openshift-operators: ""
name: grafana-operator
namespace: openshift-operators
spec:
channel: v5
installPlanApproval: Automatic
name: grafana-operator
source: community-operators
sourceNamespace: openshift-marketplace
4 changes: 0 additions & 4 deletions kubernetes/openshift/prometheus/1_serviceaccount.yaml

This file was deleted.

29 changes: 0 additions & 29 deletions kubernetes/openshift/prometheus/2_clusterrole.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions kubernetes/openshift/prometheus/5_prometheus.yaml

This file was deleted.

4 changes: 4 additions & 0 deletions kubernetes/openshift/scapinoculars/1_namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: scapinoculars
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: prometheus
name: cluster-monitoring-view-grafana-scapinoculars-sa
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: prometheus
name: cluster-monitoring-view
subjects:
- kind: ServiceAccount
name: prometheus
namespace: scapinoculars
name: grafana-scapinoculars-sa
namespace: scapinoculars
Loading

0 comments on commit e63aa5e

Please sign in to comment.