2021-02-23 20:41:11 +01:00
|
|
|
{
|
|
|
|
"id": "http://www.sonarsource.org/rule-schema-v1.1",
|
|
|
|
"title": "Rule Implementation",
|
|
|
|
"type": "object",
|
|
|
|
"description": "we must have one of these files for each implemented rule",
|
2021-06-11 07:58:58 +02:00
|
|
|
"additionalProperties": false,
|
2021-02-23 20:41:11 +01:00
|
|
|
"properties": {
|
|
|
|
"title": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"type": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": ["CODE_SMELL","BUG","VULNERABILITY","SECURITY_HOTSPOT"]
|
|
|
|
},
|
|
|
|
"status": {
|
|
|
|
"type": "string",
|
2021-05-25 11:00:40 +02:00
|
|
|
"enum": ["beta","ready","deprecated","superseded", "closed"]
|
2021-02-23 20:41:11 +01:00
|
|
|
},
|
2021-06-11 07:58:58 +02:00
|
|
|
"extra": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"additionalProperties": false,
|
|
|
|
"replacementRules": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"type": "string",
|
|
|
|
"uniqueItems": true
|
|
|
|
},
|
|
|
|
"description": "The rule ids that replace this rule"
|
2021-09-24 09:08:46 +02:00
|
|
|
},
|
|
|
|
"legacyKeys": {
|
|
|
|
"type": "array",
|
|
|
|
"items": { "type": "string" },
|
|
|
|
"uniqueItems": true
|
2021-06-11 07:58:58 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2021-02-23 20:41:11 +01:00
|
|
|
"remediation": {
|
|
|
|
"type": "object",
|
|
|
|
"oneOf": [
|
|
|
|
{
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"func": {
|
|
|
|
"const": "Constant/Issue"
|
|
|
|
},
|
|
|
|
"constantCost": {
|
|
|
|
"$ref": "#/definitions/time"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"func": {
|
|
|
|
"const": "Linear"
|
|
|
|
},
|
|
|
|
"linearDesc": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"linearFactor": {
|
|
|
|
"$ref": "#/definitions/time"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"func": {
|
|
|
|
"const": "Linear with offset"
|
|
|
|
},
|
|
|
|
"linearDesc": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"linearOffset": {
|
|
|
|
"$ref": "#/definitions/time"
|
|
|
|
},
|
|
|
|
"linearFactor": {
|
|
|
|
"$ref": "#/definitions/time"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"tags": {
|
|
|
|
"type": "array",
|
|
|
|
"minItems": 0,
|
|
|
|
"items": { "type": "string" },
|
|
|
|
"uniqueItems": true
|
|
|
|
},
|
|
|
|
"standards": {
|
|
|
|
"type": "array",
|
|
|
|
"minItems": 0,
|
|
|
|
"items": { "type": "string" },
|
|
|
|
"uniqueItems": true
|
|
|
|
},
|
|
|
|
"defaultSeverity": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": ["Info","Minor","Major","Critical","Blocker"]
|
|
|
|
},
|
|
|
|
|
|
|
|
"ruleSpecification": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "id of the RSPEC, in the form 'RSPEC-XXXX'"
|
|
|
|
},
|
|
|
|
"sqKey": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "the key used to save issues on SQ. Often a legacy key"
|
|
|
|
},
|
|
|
|
"compatibleLanguages": {
|
|
|
|
"type": "array",
|
|
|
|
"minItems": 1,
|
|
|
|
"items": { "type": "string" },
|
|
|
|
"uniqueItems": true
|
|
|
|
},
|
|
|
|
"scope": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": ["Main","Tests","All"],
|
|
|
|
"description": "scope the rule applies to"
|
|
|
|
},
|
|
|
|
"template": {
|
|
|
|
"type": "boolean"
|
|
|
|
},
|
|
|
|
"securityStandards": {
|
|
|
|
"type": "object",
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"CWE": {
|
|
|
|
"type": "array",
|
|
|
|
"minItems": 0,
|
|
|
|
"items": { "type": "integer" },
|
|
|
|
"uniqueItems": true
|
|
|
|
},
|
|
|
|
"OWASP": {
|
|
|
|
"type": "array",
|
|
|
|
"minItems": 0,
|
2022-05-25 16:36:49 +02:00
|
|
|
"items": {
|
|
|
|
"type": "string",
|
|
|
|
"pattern": "^A([1-9]|10)$"
|
|
|
|
},
|
|
|
|
"uniqueItems": true
|
2021-06-07 11:20:46 +02:00
|
|
|
},
|
2021-10-15 09:37:46 +02:00
|
|
|
"OWASP Top 10 2021": {
|
|
|
|
"type": "array",
|
|
|
|
"minItems": 0,
|
2022-05-25 16:36:49 +02:00
|
|
|
"items": {
|
|
|
|
"type": "string",
|
|
|
|
"pattern": "^A([1-9]|10)$"
|
|
|
|
},
|
|
|
|
"uniqueItems": true
|
2021-10-15 09:37:46 +02:00
|
|
|
},
|
2021-06-07 11:20:46 +02:00
|
|
|
"OWASP Mobile": {
|
|
|
|
"type": "array",
|
|
|
|
"minItems": 0,
|
2022-05-25 16:36:49 +02:00
|
|
|
"items": {
|
|
|
|
"type": "string",
|
|
|
|
"pattern": "^M([1-9]|10)$"
|
|
|
|
},
|
|
|
|
"uniqueItems": true
|
2021-06-07 19:13:19 +02:00
|
|
|
},
|
2025-02-19 17:19:00 +01:00
|
|
|
"OWASP Mobile Top 10 2024": {
|
|
|
|
"type": "array",
|
|
|
|
"minItems": 0,
|
|
|
|
"items": {
|
|
|
|
"type": "string",
|
|
|
|
"pattern": "^M([1-9]|10)$"
|
|
|
|
},
|
|
|
|
"uniqueItems": true
|
|
|
|
},
|
2022-04-12 21:58:21 +02:00
|
|
|
"PCI DSS 3.2": {
|
2021-06-07 19:13:19 +02:00
|
|
|
"type": "array",
|
|
|
|
"minItems": 0,
|
2022-05-24 16:19:27 +02:00
|
|
|
"items": {
|
|
|
|
"type": "string",
|
|
|
|
"pattern": "^([0-9]{1,3}\\.?){1,4}$"
|
|
|
|
},
|
|
|
|
"uniqueItems": true
|
|
|
|
},
|
|
|
|
"PCI DSS 4.0": {
|
|
|
|
"type": "array",
|
|
|
|
"minItems": 0,
|
|
|
|
"items": {
|
|
|
|
"type": "string",
|
|
|
|
"pattern": "^([0-9]{1,3}\\.?){1,4}$"
|
|
|
|
},
|
|
|
|
"uniqueItems": true
|
2021-06-07 19:13:19 +02:00
|
|
|
},
|
|
|
|
"CIS": {
|
|
|
|
"type": "array",
|
|
|
|
"minItems": 0,
|
2022-05-25 16:36:49 +02:00
|
|
|
"items": {
|
|
|
|
"type": "string",
|
|
|
|
"pattern": "^([0-9]{1,3}\\.?){1,3}$"
|
|
|
|
},
|
|
|
|
"uniqueItems": true
|
2021-06-07 19:13:19 +02:00
|
|
|
},
|
|
|
|
"HIPAA": {
|
|
|
|
"type": "array",
|
|
|
|
"minItems": 0,
|
2022-05-25 16:36:49 +02:00
|
|
|
"items": {
|
|
|
|
"type": "string",
|
|
|
|
"pattern": "^([0-9]{1,3}\\.?){2}$"
|
|
|
|
},
|
|
|
|
"uniqueItems": true
|
2021-06-07 19:13:19 +02:00
|
|
|
},
|
|
|
|
"CERT": {
|
|
|
|
"type": "array",
|
|
|
|
"minItems": 0,
|
2022-05-25 16:36:49 +02:00
|
|
|
"items": {
|
|
|
|
"type": "string",
|
|
|
|
"pattern": "^[A-Z0-9]+-[A-Z]+\\.$"
|
|
|
|
},
|
|
|
|
"uniqueItems": true
|
2021-06-07 19:13:19 +02:00
|
|
|
},
|
|
|
|
"MASVS": {
|
|
|
|
"type": "array",
|
|
|
|
"minItems": 0,
|
2022-05-25 16:36:49 +02:00
|
|
|
"items": {
|
|
|
|
"type": "string",
|
|
|
|
"pattern": "^MSTG-[A-Z]+-[0-9]+$"
|
|
|
|
},
|
|
|
|
"uniqueItems": true
|
2021-10-08 10:23:39 +02:00
|
|
|
},
|
2022-07-29 13:35:38 +02:00
|
|
|
"ASVS 4.0": {
|
2021-10-08 10:23:39 +02:00
|
|
|
"type": "array",
|
|
|
|
"minItems": 0,
|
2022-05-25 16:36:49 +02:00
|
|
|
"items": {
|
|
|
|
"type": "string",
|
|
|
|
"pattern": "^\\d+\\.\\d+\\.\\d+$"
|
|
|
|
},
|
|
|
|
"uniqueItems": true
|
2024-05-06 07:56:31 +01:00
|
|
|
},
|
2024-07-30 15:10:03 +01:00
|
|
|
"STIG ASD_V5R3": {
|
2024-05-06 07:56:31 +01:00
|
|
|
"type": "array",
|
|
|
|
"minItems": 0,
|
|
|
|
"items": {
|
|
|
|
"type": "string",
|
|
|
|
"pattern": "^V-\\d+$"
|
|
|
|
},
|
|
|
|
"uniqueItems": true
|
2021-02-23 20:41:11 +01:00
|
|
|
}
|
|
|
|
}
|
2021-06-11 07:58:58 +02:00
|
|
|
},
|
|
|
|
"defaultQualityProfiles": {
|
|
|
|
"type": "array",
|
|
|
|
"items": { "type": "string"},
|
|
|
|
"uniqueItems": true
|
2021-10-07 11:23:15 +02:00
|
|
|
},
|
2022-08-09 12:06:31 +02:00
|
|
|
"educationPrinciples": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": ["defense_in_depth", "never_trust_user_input"]
|
|
|
|
},
|
|
|
|
"uniqueItems": true
|
|
|
|
},
|
2021-10-07 11:23:15 +02:00
|
|
|
"quickfix": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
|
|
|
"unknown",
|
|
|
|
"covered",
|
|
|
|
"partial",
|
|
|
|
"infeasible",
|
|
|
|
"targeted"
|
|
|
|
],
|
|
|
|
"description": "Can issues of the rule have a quick fix?"
|
2023-08-04 16:55:03 +02:00
|
|
|
},
|
|
|
|
"code": {
|
|
|
|
"type": "object",
|
|
|
|
"description": "Information related to clean code taxonomy",
|
|
|
|
"additionalProperties": false,
|
|
|
|
"properties": {
|
|
|
|
"impacts": {
|
|
|
|
"type": "object",
|
|
|
|
"description": "Software qualities",
|
|
|
|
"additionalProperties": false,
|
|
|
|
"minProperties": 1,
|
|
|
|
"properties": {
|
|
|
|
"MAINTAINABILITY": {
|
|
|
|
"type": "string",
|
2024-10-31 16:24:31 +01:00
|
|
|
"enum": ["INFO", "LOW", "MEDIUM", "HIGH", "BLOCKER"]
|
2023-08-04 16:55:03 +02:00
|
|
|
},
|
|
|
|
"RELIABILITY": {
|
|
|
|
"type": "string",
|
2024-10-31 16:24:31 +01:00
|
|
|
"enum": ["INFO", "LOW", "MEDIUM", "HIGH", "BLOCKER"]
|
2023-08-04 16:55:03 +02:00
|
|
|
},
|
|
|
|
"SECURITY": {
|
|
|
|
"type": "string",
|
2024-10-31 16:24:31 +01:00
|
|
|
"enum": ["INFO", "LOW", "MEDIUM", "HIGH", "BLOCKER"]
|
2023-08-04 16:55:03 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"attribute": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "Clean code attribute",
|
|
|
|
"enum": ["FORMATTED", "CONVENTIONAL", "IDENTIFIABLE", "CLEAR", "LOGICAL", "COMPLETE", "EFFICIENT", "FOCUSED", "DISTINCT", "MODULAR", "TESTED", "LAWFUL", "TRUSTWORTHY", "RESPECTFUL"]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"required": ["impacts", "attribute"]
|
2021-02-23 20:41:11 +01:00
|
|
|
}
|
|
|
|
},
|
2021-04-30 14:11:09 +02:00
|
|
|
"if": {
|
2021-05-25 11:00:40 +02:00
|
|
|
"properties": {"status": {"const": "closed"}}
|
2021-04-30 14:11:09 +02:00
|
|
|
},
|
|
|
|
"then": {
|
2021-05-25 11:00:40 +02:00
|
|
|
"required": []
|
2021-04-30 14:11:09 +02:00
|
|
|
},
|
|
|
|
"else": {
|
2021-05-25 11:00:40 +02:00
|
|
|
"if": {
|
|
|
|
"properties": {"type": {"const": "SECURITY_HOTSPOT"}}
|
|
|
|
},
|
|
|
|
"then": {
|
|
|
|
"required": ["title","type","status","tags","defaultSeverity","ruleSpecification","sqKey","scope"]
|
|
|
|
},
|
|
|
|
"else": {
|
2021-10-07 11:23:15 +02:00
|
|
|
"required": ["title","type","status","remediation","tags","defaultSeverity","ruleSpecification","sqKey","scope", "quickfix"]
|
2021-05-25 11:00:40 +02:00
|
|
|
}
|
2021-04-30 14:11:09 +02:00
|
|
|
},
|
2021-02-23 20:41:11 +01:00
|
|
|
"definitions": {
|
|
|
|
"time": {
|
|
|
|
"type": "string",
|
2022-07-13 15:02:38 +02:00
|
|
|
"pattern": "^[ ]*[0-9]+[ ]*(min|h|d)$"
|
2021-02-23 20:41:11 +01:00
|
|
|
}
|
|
|
|
}
|
2021-04-30 14:11:09 +02:00
|
|
|
}
|