Skip to content

Commit af214ba

Browse files
committed
fix: improve skill validation and adjust issue severities
- Refine skill type detection to use parent directory name instead of string matching - Add warning for empty issues dictionaries in injection skills - Add section comments to injection YAML files for better organization - Reduce severity of several issues from medium/high to low for more accurate categorization
1 parent cc97e4b commit af214ba

40 files changed

Lines changed: 377 additions & 160 deletions

.github/scripts/validate_skills.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ def validate_skill_file(self, file_path: Path) -> bool:
6464
self.errors.append(f"{relative_path}: File must contain a YAML dictionary")
6565
return False
6666

67-
# Determine skill type based on directory
68-
if "injection" in str(file_path):
67+
# Determine skill type based on parent directory name
68+
parent_dir = Path(file_path).parent.name
69+
if parent_dir == "injection":
6970
return self._validate_injection_skill(relative_path, data)
70-
elif "device" in str(file_path) or "feature" in str(file_path):
71+
elif parent_dir in ("device", "feature"):
7172
return self._validate_device_skill(relative_path, data)
7273
else:
7374
self.warnings.append(f"{relative_path}: Unknown skill type, skipping format validation")
@@ -111,6 +112,8 @@ def _validate_injection_skill(self, file_path: Path, data: dict) -> bool:
111112
if not isinstance(data["issues"], dict):
112113
self.errors.append(f"{file_path}: 'issues' must be a dictionary")
113114
valid = False
115+
elif len(data["issues"]) == 0:
116+
self.warnings.append(f"{file_path}: 'issues' dictionary is empty - no faults defined")
114117
else:
115118
for issue_key, issue_data in data["issues"].items():
116119
if not self._validate_issue(file_path, issue_key, issue_data):

injection/access_control_issues.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ protocols:
1616
- acl
1717

1818
issues:
19+
# Basic ACL Configuration Issues
20+
1921
blocking_acl:
2022
name: "Blocking ACL"
2123
description: "Apply an ACL that blocks legitimate traffic"
@@ -77,6 +79,8 @@ issues:
7779
- "Verify direction matches intent"
7880
applicability: "ACLs applied to interfaces"
7981

82+
# ACL Design and Advanced Features
83+
8084
acl_overlap_conflict:
8185
name: "ACL Overlap or Conflict"
8286
description: "Multiple ACLs with overlapping or conflicting rules"
@@ -99,6 +103,8 @@ issues:
99103
- "Test each ACL separately to identify conflicts"
100104
applicability: "Multiple ACLs on same interface or across the traffic path"
101105

106+
# Security and Specialized ACLs
107+
102108
zone_based_firewall:
103109
name: "Zone-Based Firewall Policy Missing"
104110
description: "Configure zone-based firewall but forget to allow traffic between zones"
@@ -171,7 +177,7 @@ issues:
171177
acl_time_based:
172178
name: "Time-Based ACL / Time Range Configuration Error"
173179
description: "Configure time-based ACL with incorrect time range causing rules to be active when they shouldn't"
174-
severity: "medium"
180+
severity: "low"
175181
difficulty: "intermediate"
176182
protocols:
177183
- acl

injection/bfd_issues.yaml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ protocols:
1919
- vrrp
2020

2121
issues:
22+
# BFD Session Configuration Issues
23+
2224
bfd_not_enabled:
2325
name: "BFD Not Configured on Interface"
2426
description: "Disable BFD on the required interface preventing fast failure detection"
25-
severity: "high"
27+
severity: "low"
2628
difficulty: "beginner"
2729
protocols:
2830
- bfd
@@ -43,7 +45,7 @@ issues:
4345
bfd_timer_mismatch:
4446
name: "BFD Interval / Multiplier Negotiation Issue"
4547
description: "Configure mismatched BFD timers causing session rejection or asymmetric failure detection"
46-
severity: "high"
48+
severity: "low"
4749
difficulty: "intermediate"
4850
protocols:
4951
- bfd
@@ -64,7 +66,7 @@ issues:
6466
bfd_no_auth:
6567
name: "BFD Authentication / MD5 SHA Key Mismatch"
6668
description: "Configure BFD authentication on one side but mismatched key on the other"
67-
severity: "high"
69+
severity: "low"
6870
difficulty: "intermediate"
6971
protocols:
7072
- bfd
@@ -82,10 +84,12 @@ issues:
8284
- "Disable auth on one side for testing: 'no bfd authentication'"
8385
applicability: "BFD deployments requiring authentication"
8486

87+
# BFD Protocol Integration Issues
88+
8589
bfd_protocol_not_registered:
8690
name: "BFD Client Not Registered with BFD Process"
8791
description: "Configure routing protocol with BFD but BFD client registration missing"
88-
severity: "high"
92+
severity: "low"
8993
difficulty: "beginner"
9094
protocols:
9195
- bfd
@@ -129,7 +133,7 @@ issues:
129133
bfd_ospf_integration:
130134
name: "OSPF BFD Integration Not Working"
131135
description: "Configure OSPF with BFD but OSPF does not respond to BFD down event"
132-
severity: "high"
136+
severity: "low"
133137
difficulty: "intermediate"
134138
protocols:
135139
- bfd
@@ -151,7 +155,7 @@ issues:
151155
bfd_bgp_integration:
152156
name: "BGP BFD Integration / Fall-Over Not Configured"
153157
description: "Configure BGP with BFD but BGP fall-over BFD missing causing slow BGP convergence"
154-
severity: "high"
158+
severity: "low"
155159
difficulty: "intermediate"
156160
protocols:
157161
- bfd
@@ -173,7 +177,7 @@ issues:
173177
bfd_isis_integration:
174178
name: "IS-IS BFD Integration Failure"
175179
description: "Configure IS-IS with BFD but adjacency per-interface BFD missing"
176-
severity: "high"
180+
severity: "low"
177181
difficulty: "intermediate"
178182
protocols:
179183
- bfd
@@ -192,10 +196,12 @@ issues:
192196
- "Without BFD: IS-IS uses hello timers (3.3s P2P, 10s broadcast)"
193197
applicability: "IS-IS with BFD fast convergence"
194198

199+
# BFD Scaling and Advanced Features
200+
195201
bfd_session_limit:
196202
name: "BFD Session Hardware / Platform Limit Exceeded"
197203
description: "Configure BFD on too many neighbors exceeding platform session limit"
198-
severity: "high"
204+
severity: "medium"
199205
difficulty: "intermediate"
200206
protocols:
201207
- bfd

injection/bgp_flowspec_issues.yaml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ protocols:
1414
- rtbh
1515

1616
issues:
17+
# BGP FlowSpec Basic Configuration
18+
1719
flowspec_af:
1820
name: "BGP FlowSpec Address-Family Not Activated"
1921
description: "FlowSpec address-family not activated under BGP causing FlowSpec routes not exchanged"
20-
severity: "high"
22+
severity: "low"
2123
difficulty: "intermediate"
2224
protocols:
2325
- bgp
@@ -39,7 +41,7 @@ issues:
3941
flowspec_action:
4042
name: "BGP FlowSpec Action Community Misconfiguration"
4143
description: "Configure FlowSpec action extended community (drop/rate-limit/redirect) incorrectly"
42-
severity: "high"
44+
severity: "low"
4345
difficulty: "advanced"
4446
protocols:
4547
- bgp
@@ -80,6 +82,8 @@ issues:
8082
- "Check 'show bgp ipv4 flowspec <prefix>' for match fields"
8183
applicability: "DDoS mitigation with BGP FlowSpec"
8284

85+
# RTBH and DDoS Mitigation
86+
8387
rtbh_community:
8488
name: "RTBH (Remotely Triggered Black Hole) Community Misconfiguration"
8589
description: "Configure RTBH community on trigger router but not matched on edge routers"
@@ -124,6 +128,8 @@ issues:
124128
- "Verify 'show ip route <prefix>' on edge for null0 next-hop"
125129
applicability: "RTBH blackhole filtering"
126130

131+
# FlowSpec Advanced and Hardware Issues
132+
127133
flowspec_validation:
128134
name: "BGP FlowSpec Validation / Origination Issue"
129135
description: "FlowSpec route not originated or rejected due to validation failure"
@@ -149,7 +155,7 @@ issues:
149155
flowspec_send_community:
150156
name: "BGP FlowSpec Send-Community Missing"
151157
description: "Configure FlowSpec without send-community extended, preventing action community propagation"
152-
severity: "high"
158+
severity: "low"
153159
difficulty: "beginner"
154160
protocols:
155161
- bgp
@@ -171,7 +177,7 @@ issues:
171177
flowspec_route_policy:
172178
name: "BGP FlowSpec Route Policy / Origination via Policy"
173179
description: "Configure FlowSpec route origination via local policy but policy not correctly applied"
174-
severity: "high"
180+
severity: "low"
175181
difficulty: "advanced"
176182
protocols:
177183
- bgp
@@ -193,7 +199,7 @@ issues:
193199
flowspec_hw_offload:
194200
name: "BGP FlowSpec Hardware Offload / TCAM Programming"
195201
description: "Configure BGP FlowSpec but rules not programmed in hardware forwarding"
196-
severity: "high"
202+
severity: "low"
197203
difficulty: "advanced"
198204
protocols:
199205
- bgp
@@ -215,7 +221,7 @@ issues:
215221
flowspec_v6_validation:
216222
name: "BGP IPv6 FlowSpec Validation / Inter-AS Deployment"
217223
description: "Configure IPv6 FlowSpec across AS boundaries but validation check prevents propagation"
218-
severity: "high"
224+
severity: "low"
219225
difficulty: "advanced"
220226
protocols:
221227
- bgp
@@ -238,7 +244,7 @@ issues:
238244
flowspec_rate_limit:
239245
name: "BGP FlowSpec Rate-Limit / Traffic-Rate Action Failure"
240246
description: "Configure FlowSpec traffic-rate action but rate limiting not applied correctly"
241-
severity: "high"
247+
severity: "low"
242248
difficulty: "advanced"
243249
protocols:
244250
- bgp
@@ -260,7 +266,7 @@ issues:
260266
flowspec_redirect_next_hop:
261267
name: "BGP FlowSpec Redirect-to-Next-Hop / Redirect VRF Issue"
262268
description: "Configure FlowSpec redirect action but traffic not redirected to next-hop or VRF"
263-
severity: "high"
269+
severity: "low"
264270
difficulty: "advanced"
265271
protocols:
266272
- bgp
@@ -282,7 +288,7 @@ issues:
282288
flowspec_service_provider:
283289
name: "BGP FlowSpec Service Provider / Customer Inter-AS Issue"
284290
description: "Configure BGP FlowSpec between customer and provider AS but validation policies block rules"
285-
severity: "high"
291+
severity: "low"
286292
difficulty: "advanced"
287293
protocols:
288294
- bgp

injection/dhcp_snooping_dai_issues.yaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ protocols:
1515
- private-vlan
1616

1717
issues:
18+
# DHCP Snooping Configuration Issues
19+
1820
dhcp_snooping_disabled:
1921
name: "DHCP Snooping Disabled on Trusted Ports"
2022
description: "Disable DHCP snooping or configure wrong trust state"
@@ -39,7 +41,7 @@ issues:
3941
dhcp_snooping_rate:
4042
name: "DHCP Snooping Rate Limit Exceeded"
4143
description: "Configure DHCP snooping rate limit too low causing DHCP packets dropped"
42-
severity: "high"
44+
severity: "low"
4345
difficulty: "intermediate"
4446
protocols:
4547
- dhcp-snooping
@@ -60,7 +62,7 @@ issues:
6062
dhcp_snooping_option82:
6163
name: "DHCP Snooping Option 82 Misconfiguration"
6264
description: "Configure DHCP snooping option 82 incorrectly (disable or wrong format)"
63-
severity: "medium"
65+
severity: "low"
6466
difficulty: "intermediate"
6567
protocols:
6668
- dhcp-snooping
@@ -78,10 +80,12 @@ issues:
7880
- "Disable option 82 for non-Cisco DHCP servers: 'no ip dhcp snooping information option'"
7981
applicability: "DHCP snooping with centralized DHCP servers"
8082

83+
# DAI and IP Source Guard Issues
84+
8185
dai_disabled:
8286
name: "DAI (Dynamic ARP Inspection) Not Configured"
8387
description: "DAI not enabled on VLANs where ARP spoofing protection is needed"
84-
severity: "high"
88+
severity: "low"
8589
difficulty: "intermediate"
8690
protocols:
8791
- dai
@@ -144,6 +148,8 @@ issues:
144148
- "Err-disabled: 'errdisable recovery cause arp-inspection'"
145149
applicability: "DAI on high-traffic VLANs"
146150

151+
# Private VLAN Issues
152+
147153
pvlan_mismatch:
148154
name: "Private VLAN Association Mismatch"
149155
description: "Configure wrong private VLAN type (primary, community, isolated) or incorrect association"
@@ -189,7 +195,7 @@ issues:
189195
ipsg_missing:
190196
name: "IP Source Guard Not Configured"
191197
description: "Configure DHCP snooping but IP Source Guard not enabled on untrusted ports"
192-
severity: "high"
198+
severity: "low"
193199
difficulty: "beginner"
194200
protocols:
195201
- dhcp-snooping
@@ -210,7 +216,7 @@ issues:
210216
dhcp_snooping_binding_db:
211217
name: "DHCP Snooping Binding Database / Persistence Issue"
212218
description: "Configure DHCP snooping binding database not persisted across reloads causing binding loss"
213-
severity: "medium"
219+
severity: "low"
214220
difficulty: "intermediate"
215221
protocols:
216222
- dhcp-snooping

0 commit comments

Comments
 (0)