Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ Patches SARIF result files from the relative working directory path to the Actio

This tools allows users to split up SARIF files that use submodules into multiple SARIF files that are then published to there appropriate repository.

### [SARIF Splitter](./splitter/README.md)

Splits large SARIF files into smaller, categorized files based on file paths or security severity levels. Helps overcome upload size restrictions and improves organization for GitHub Advanced Security dashboards.

## Support

Please create issues for any feature requests, bugs, or documentation problems.
Expand Down
268 changes: 268 additions & 0 deletions examples/comprehensive-test.sarif
Original file line number Diff line number Diff line change
@@ -0,0 +1,268 @@
{
"$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
"version": "2.1.0",
"runs": [
{
"tool": {
"driver": {
"name": "TestTool",
"semanticVersion": "1.0.0",
"rules": [
{
"id": "critical-rule-1",
"name": "Critical Security Issue 1",
"properties": {
"security-severity": "9.8"
}
},
{
"id": "critical-rule-2",
"name": "Critical Security Issue 2",
"properties": {
"security-severity": "9.2"
}
},
{
"id": "high-rule-1",
"name": "High Security Issue 1",
"properties": {
"security-severity": "8.5"
}
},
{
"id": "high-rule-2",
"name": "High Security Issue 2",
"properties": {
"security-severity": "7.8"
}
},
{
"id": "high-rule-3",
"name": "High Security Issue 3",
"properties": {
"security-severity": "7.0"
}
},
{
"id": "medium-rule-1",
"name": "Medium Security Issue 1",
"properties": {
"security-severity": "6.5"
}
},
{
"id": "medium-rule-2",
"name": "Medium Security Issue 2",
"properties": {
"security-severity": "5.0"
}
},
{
"id": "medium-rule-3",
"name": "Medium Security Issue 3",
"properties": {
"security-severity": "4.2"
}
},
{
"id": "low-rule-1",
"name": "Low Security Issue 1",
"properties": {
"security-severity": "3.5"
}
},
{
"id": "low-rule-2",
"name": "Low Security Issue 2",
"properties": {
"security-severity": "2.1"
}
}
]
}
},
"results": [
{
"ruleId": "critical-rule-1",
"message": {
"text": "Critical security vulnerability found in authentication module"
},
"locations": [
{
"physicalLocation": {
"artifactLocation": {
"uri": "src/auth/login.py"
}
}
}
]
},
{
"ruleId": "critical-rule-1",
"message": {
"text": "Critical security vulnerability found in password handling"
},
"locations": [
{
"physicalLocation": {
"artifactLocation": {
"uri": "src/auth/password.py"
}
}
}
]
},
{
"ruleId": "critical-rule-2",
"message": {
"text": "Critical injection vulnerability"
},
"locations": [
{
"physicalLocation": {
"artifactLocation": {
"uri": "src/database/query.py"
}
}
}
]
},
{
"ruleId": "high-rule-1",
"message": {
"text": "High severity security issue in API"
},
"locations": [
{
"physicalLocation": {
"artifactLocation": {
"uri": "src/api/endpoints.py"
}
}
}
]
},
{
"ruleId": "high-rule-2",
"message": {
"text": "High severity validation issue"
},
"locations": [
{
"physicalLocation": {
"artifactLocation": {
"uri": "src/validation/input.py"
}
}
}
]
},
{
"ruleId": "high-rule-2",
"message": {
"text": "High severity validation issue in forms"
},
"locations": [
{
"physicalLocation": {
"artifactLocation": {
"uri": "src/forms/validator.py"
}
}
}
]
},
{
"ruleId": "high-rule-3",
"message": {
"text": "High severity crypto issue"
},
"locations": [
{
"physicalLocation": {
"artifactLocation": {
"uri": "src/crypto/encryption.py"
}
}
}
]
},
{
"ruleId": "medium-rule-1",
"message": {
"text": "Medium severity logging issue"
},
"locations": [
{
"physicalLocation": {
"artifactLocation": {
"uri": "src/logging/logger.py"
}
}
}
]
},
{
"ruleId": "medium-rule-2",
"message": {
"text": "Medium severity configuration issue"
},
"locations": [
{
"physicalLocation": {
"artifactLocation": {
"uri": "src/config/settings.py"
}
}
}
]
},
{
"ruleId": "medium-rule-3",
"message": {
"text": "Medium severity file handling issue"
},
"locations": [
{
"physicalLocation": {
"artifactLocation": {
"uri": "src/utils/files.py"
}
}
}
]
},
{
"ruleId": "low-rule-1",
"message": {
"text": "Low severity code quality issue"
},
"locations": [
{
"physicalLocation": {
"artifactLocation": {
"uri": "src/helpers/utils.py"
}
}
}
]
},
{
"ruleId": "low-rule-2",
"message": {
"text": "Low severity documentation issue"
},
"locations": [
{
"physicalLocation": {
"artifactLocation": {
"uri": "src/docs/readme.py"
}
}
}
]
}
]
}
]
}
59 changes: 59 additions & 0 deletions examples/splitter-configs/path-rules.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"path_rules": [
{
"name": "Tests",
"patterns": [
"**/test/**",
"**/tests/**",
"**/*test*",
"**/spec/**",
"**/*spec*"
]
},
{
"name": "Frontend",
"patterns": [
"**/web/**",
"**/frontend/**",
"**/client/**",
"**/ui/**",
"**/*.js",
"**/*.jsx",
"**/*.ts",
"**/*.tsx",
"**/*.vue",
"**/*.html",
"**/*.css"
]
},
{
"name": "Backend",
"patterns": [
"**/api/**",
"**/server/**",
"**/service/**",
"**/services/**",
"**/backend/**",
"**/*.py",
"**/*.java",
"**/*.cs",
"**/*.go"
]
},
{
"name": "Infrastructure",
"patterns": [
"**/terraform/**",
"**/infra/**",
"**/infrastructure/**",
"**/deploy/**",
"**/deployment/**",
"**/*.tf",
"**/*.yaml",
"**/*.yml",
"**/Dockerfile*",
"**/docker-compose*"
]
}
]
}
20 changes: 20 additions & 0 deletions examples/splitter-configs/severity-rules.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"severity_rules": [
{
"name": "Critical",
"severities": ["critical"]
},
{
"name": "High",
"severities": ["high"]
},
{
"name": "Medium",
"severities": ["medium"]
},
{
"name": "Low-and-Others",
"severities": ["*"]
}
]
}
Loading