Baseline Revision Tripwire: Definition & CodeQL Example
A baseline revision tripwire is a type of tripwire that compares a revision of a specified file with the baseline revision of that same file and looks for certain changes, e.g.:
- The addition or deletion of specific lines
- The modification or deletion of specific comments
- The modification of specific methods
- etc.
If the specified file doesn't exist or if any defined checks fail, an incident is created.
Here's an example configuration for a baseline revision tripwire in CodeQL to detect the addition or deletion of specific comments in a given source code file:
```yaml
queries:
- BaselineRevisionTripwire.ql
policies:
- name: BaselineRevisionTripwirePolicy
enabled: true
severity: Medium
query_ids:
- BaselineRevisionTripwire
conditions:
- BaselineRevisionTripwireCondition:
file: src/main/java/org/example/Service.java
comment_checks:
- match: "TODO(@[a-zA-Z0-9]+)"
```
Travel Safety - Related Articles
- Best Mobility Scooters for Seniors: Find the Right Fit
- Traffic Light Cameras: Pros, Cons & Impact on Drivers
- Staying Safe: What to Do If You Think You're Being Followed
- Freeway Sign Colors: What Color is the 'Hospital Next Exit' Sign?
- Convex vs. Concave Mirrors: Why Car Side Mirrors are Convex
- Travel Restrictions and Pandemic Control: A Comprehensive Overview
- Airbags: Safety Features, Risks & Proper Use - A Comprehensive Guide
