1
0
Fork 0

feat: add default rule selector

This commit is contained in:
ssube 2019-06-30 21:03:12 -05:00
parent 93df975575
commit 15933ba620
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
6 changed files with 2 additions and 11 deletions

View File

@ -7,7 +7,6 @@ rules:
- ansible
- playbook
select: '$'
check:
type: array
items:
@ -38,7 +37,6 @@ rules:
- ansible
- role
select: '$'
check:
type: array
items:

View File

@ -7,7 +7,6 @@ rules:
- gitlab
- optional
select: '$'
check:
type: object
required: [stages]
@ -24,7 +23,6 @@ rules:
- gitlab
- optional
select: '$'
check:
type: object
patternProperties:
@ -42,7 +40,6 @@ rules:
- gitlab
- important
select: '$'
check:
type: object
patternProperties:

View File

@ -69,8 +69,6 @@ rules:
- grafana
- dashboard
# this is not the ideal selector for this rule, but tags are located at $.dashboard.tags, while notification
# channels are nested under $.dashboard.panels[*].alert.notifications[*].uid
select: '$.dashboard'
filter:

View File

@ -108,7 +108,6 @@ rules:
- kubernetes
- labels
select: '$'
check:
type: object
required: [metadata]

View File

@ -10,7 +10,6 @@ definitions:
- level
- tags
# data
- select
- check
properties:
name:
@ -34,6 +33,7 @@ definitions:
pattern: "[-:a-z0-9]+"
select:
type: string
default: '$'
minLength: 1
filter:
type: object
@ -59,7 +59,6 @@ rules:
- important
- salty-dog
select: '$'
check:
type: object
additionalProperties: false

View File

@ -162,7 +162,7 @@ export class Rule implements RuleData, Visitor<RuleResult> {
this.desc = data.desc;
this.level = data.level;
this.name = data.name;
this.select = data.select;
this.select = data.select || '$';
this.tags = Array.from(data.tags);
// copy schema objects