Skip to content

Commit

Permalink
feature. add alert ruler for tks_policy
Browse files Browse the repository at this point in the history
  • Loading branch information
ktkfree committed Apr 19, 2024
1 parent 50d7082 commit a8653f6
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 2 deletions.
21 changes: 20 additions & 1 deletion aws-msa-reference/lma/site-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,26 @@ charts:
for: 30m
labels:
severity: critical

- alert: policy-audited
annotations:
Checkpoint: 정책위반이 발생하였습니다.({{ $labels.kind }} / {{ $labels.name }})
description: 클러스터 ( {{ $labels.taco_cluster }})의 자원({{ $labels.violating_kind }} - {{ $labels.violating_namespace }} / {{ $labels.violating_nam }})에서 정책({{ $labels.kind }} / {{ $labels.name }})위반이 발생했습니다. 메시지 - {{ $labels.violation_msg }}
discriminative: $labels.kind,$labels.name,$labels.taco_cluster,$labels.violating_kind,$labels.violating_name,$labels.violating_namespace,$labels.violation_msg
message: 정책 위반({{ $labels.kind }} / {{ $labels.name }})
expr: opa_scorecard_constraint_violations{namespace!='kube-system|taco-system|gatekeeper-system', violation_enforcement='warn'} == 1
for: 1m
labels:
severity: critical
- alert: policy-blocked
annotations:
Checkpoint: "정책위반이 시도가 발생하였습니다.({{ $labels.kind }} / {{ $labels.name }})"
description: "클러스터 ( {{ $labels.taco_cluster }})의 자원({{ $labels.violating_kind }} - {{ $labels.violating_namespace }} / {{ $labels.violating_nam }})에서 정책({{ $labels.kind }} / {{ $labels.name }})위반 시도가 발생했습니다. 메시지 - {{ $labels.violation_msg }}"
discriminative: $labels.kind,$labels.name,$labels.taco_cluster,$labels.violating_kind,$labels.violating_name,$labels.violating_namespace,$labels.violation_msg
message: 정책 위반({{ $labels.kind }} / {{ $labels.name }}) 시도
expr: opa_scorecard_constraint_violations{namespace!='kube-system|taco-system|gatekeeper-system',violation_enforcement=''} == 1
for: 1m
labels:
severity: critical
- name: thanos-config
override:
objectStorage:
Expand Down
22 changes: 21 additions & 1 deletion aws-reference/lma/site-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,27 @@ charts:
for: 30m
labels:
severity: critical

- alert: policy-audited
annotations:
Checkpoint: 정책위반이 발생하였습니다.({{ $labels.kind }} / {{ $labels.name }})
description: 클러스터 ( {{ $labels.taco_cluster }})의 자원({{ $labels.violating_kind }} - {{ $labels.violating_namespace }} / {{ $labels.violating_nam }})에서 정책({{ $labels.kind }} / {{ $labels.name }})위반이 발생했습니다. 메시지 - {{ $labels.violation_msg }}
discriminative: $labels.kind,$labels.name,$labels.taco_cluster,$labels.violating_kind,$labels.violating_name,$labels.violating_namespace,$labels.violation_msg
message: 정책 위반({{ $labels.kind }} / {{ $labels.name }})
expr: opa_scorecard_constraint_violations{namespace!='kube-system|taco-system|gatekeeper-system', violation_enforcement='warn'} == 1
for: 1m
labels:
severity: critical
- alert: policy-blocked
annotations:
Checkpoint: "정책위반이 시도가 발생하였습니다.({{ $labels.kind }} / {{ $labels.name }})"
description: "클러스터 ( {{ $labels.taco_cluster }})의 자원({{ $labels.violating_kind }} - {{ $labels.violating_namespace }} / {{ $labels.violating_nam }})에서 정책({{ $labels.kind }} / {{ $labels.name }})위반 시도가 발생했습니다. 메시지 - {{ $labels.violation_msg }}"
discriminative: $labels.kind,$labels.name,$labels.taco_cluster,$labels.violating_kind,$labels.violating_name,$labels.violating_namespace,$labels.violation_msg
message: 정책 위반({{ $labels.kind }} / {{ $labels.name }}) 시도
expr: opa_scorecard_constraint_violations{namespace!='kube-system|taco-system|gatekeeper-system',violation_enforcement=''} == 1
for: 1m
labels:
severity: critical

- name: thanos-config
override:
objectStorage:
Expand Down
20 changes: 20 additions & 0 deletions byoh-reference/lma/site-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,26 @@ charts:
for: 30m
labels:
severity: critical
- alert: policy-audited
annotations:
Checkpoint: 정책위반이 발생하였습니다.({{ $labels.kind }} / {{ $labels.name }})
description: 클러스터 ( {{ $labels.taco_cluster }})의 자원({{ $labels.violating_kind }} - {{ $labels.violating_namespace }} / {{ $labels.violating_nam }})에서 정책({{ $labels.kind }} / {{ $labels.name }})위반이 발생했습니다. 메시지 - {{ $labels.violation_msg }}
discriminative: $labels.kind,$labels.name,$labels.taco_cluster,$labels.violating_kind,$labels.violating_name,$labels.violating_namespace,$labels.violation_msg
message: 정책 위반({{ $labels.kind }} / {{ $labels.name }})
expr: opa_scorecard_constraint_violations{namespace!='kube-system|taco-system|gatekeeper-system', violation_enforcement='warn'} == 1
for: 1m
labels:
severity: critical
- alert: policy-blocked
annotations:
Checkpoint: "정책위반이 시도가 발생하였습니다.({{ $labels.kind }} / {{ $labels.name }})"
description: "클러스터 ( {{ $labels.taco_cluster }})의 자원({{ $labels.violating_kind }} - {{ $labels.violating_namespace }} / {{ $labels.violating_nam }})에서 정책({{ $labels.kind }} / {{ $labels.name }})위반 시도가 발생했습니다. 메시지 - {{ $labels.violation_msg }}"
discriminative: $labels.kind,$labels.name,$labels.taco_cluster,$labels.violating_kind,$labels.violating_name,$labels.violating_namespace,$labels.violation_msg
message: 정책 위반({{ $labels.kind }} / {{ $labels.name }}) 시도
expr: opa_scorecard_constraint_violations{namespace!='kube-system|taco-system|gatekeeper-system',violation_enforcement=''} == 1
for: 1m
labels:
severity: critical

- name: thanos-config
override:
Expand Down
20 changes: 20 additions & 0 deletions eks-msa-reference/lma/site-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,26 @@ charts:
for: 30m
labels:
severity: critical
- alert: policy-audited
annotations:
Checkpoint: 정책위반이 발생하였습니다.({{ $labels.kind }} / {{ $labels.name }})
description: 클러스터 ( {{ $labels.taco_cluster }})의 자원({{ $labels.violating_kind }} - {{ $labels.violating_namespace }} / {{ $labels.violating_nam }})에서 정책({{ $labels.kind }} / {{ $labels.name }})위반이 발생했습니다. 메시지 - {{ $labels.violation_msg }}
discriminative: $labels.kind,$labels.name,$labels.taco_cluster,$labels.violating_kind,$labels.violating_name,$labels.violating_namespace,$labels.violation_msg
message: 정책 위반({{ $labels.kind }} / {{ $labels.name }})
expr: opa_scorecard_constraint_violations{namespace!='kube-system|taco-system|gatekeeper-system', violation_enforcement='warn'} == 1
for: 1m
labels:
severity: critical
- alert: policy-blocked
annotations:
Checkpoint: "정책위반이 시도가 발생하였습니다.({{ $labels.kind }} / {{ $labels.name }})"
description: "클러스터 ( {{ $labels.taco_cluster }})의 자원({{ $labels.violating_kind }} - {{ $labels.violating_namespace }} / {{ $labels.violating_nam }})에서 정책({{ $labels.kind }} / {{ $labels.name }})위반 시도가 발생했습니다. 메시지 - {{ $labels.violation_msg }}"
discriminative: $labels.kind,$labels.name,$labels.taco_cluster,$labels.violating_kind,$labels.violating_name,$labels.violating_namespace,$labels.violation_msg
message: 정책 위반({{ $labels.kind }} / {{ $labels.name }}) 시도
expr: opa_scorecard_constraint_violations{namespace!='kube-system|taco-system|gatekeeper-system',violation_enforcement=''} == 1
for: 1m
labels:
severity: critical

- name: thanos-config
override:
Expand Down
20 changes: 20 additions & 0 deletions eks-reference/lma/site-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,26 @@ charts:
for: 30m
labels:
severity: critical
- alert: policy-audited
annotations:
Checkpoint: 정책위반이 발생하였습니다.({{ $labels.kind }} / {{ $labels.name }})
description: 클러스터 ( {{ $labels.taco_cluster }})의 자원({{ $labels.violating_kind }} - {{ $labels.violating_namespace }} / {{ $labels.violating_nam }})에서 정책({{ $labels.kind }} / {{ $labels.name }})위반이 발생했습니다. 메시지 - {{ $labels.violation_msg }}
discriminative: $labels.kind,$labels.name,$labels.taco_cluster,$labels.violating_kind,$labels.violating_name,$labels.violating_namespace,$labels.violation_msg
message: 정책 위반({{ $labels.kind }} / {{ $labels.name }})
expr: opa_scorecard_constraint_violations{namespace!='kube-system|taco-system|gatekeeper-system', violation_enforcement='warn'} == 1
for: 1m
labels:
severity: critical
- alert: policy-blocked
annotations:
Checkpoint: "정책위반이 시도가 발생하였습니다.({{ $labels.kind }} / {{ $labels.name }})"
description: "클러스터 ( {{ $labels.taco_cluster }})의 자원({{ $labels.violating_kind }} - {{ $labels.violating_namespace }} / {{ $labels.violating_nam }})에서 정책({{ $labels.kind }} / {{ $labels.name }})위반 시도가 발생했습니다. 메시지 - {{ $labels.violation_msg }}"
discriminative: $labels.kind,$labels.name,$labels.taco_cluster,$labels.violating_kind,$labels.violating_name,$labels.violating_namespace,$labels.violation_msg
message: 정책 위반({{ $labels.kind }} / {{ $labels.name }}) 시도
expr: opa_scorecard_constraint_violations{namespace!='kube-system|taco-system|gatekeeper-system',violation_enforcement=''} == 1
for: 1m
labels:
severity: critical

- name: thanos-config
override:
Expand Down

0 comments on commit a8653f6

Please sign in to comment.