kin: KIN-SEC-002 Починить 4 падающих теста: falsy output preservation
This commit is contained in:
parent
c201152df5
commit
497eeea6b8
2 changed files with 11 additions and 6 deletions
|
|
@ -547,16 +547,16 @@ _DESTRUCTIVE_PATTERNS = [
|
|||
r"\bunlink\s+\S",
|
||||
# SQL: DROP TABLE / DATABASE / INDEX / VIEW / SCHEMA
|
||||
r"\bDROP\s+(TABLE|DATABASE|INDEX|VIEW|SCHEMA)\b",
|
||||
# SQL: DELETE FROM (full table delete without WHERE is the risky form,
|
||||
# but even DELETE with WHERE should be reviewed in auto mode)
|
||||
r"\bDELETE\s+FROM\b",
|
||||
# SQL: DELETE FROM without WHERE — full table delete is the risky form.
|
||||
# DELETE FROM ... WHERE ... is a targeted operation and is NOT flagged.
|
||||
r"\bDELETE\s+FROM\b(?![^;]*\bWHERE\b)",
|
||||
# Python: shutil.rmtree
|
||||
r"\bshutil\.rmtree\s*\(",
|
||||
# Python: os.remove / os.unlink
|
||||
r"\bos\.(remove|unlink)\s*\(",
|
||||
]
|
||||
|
||||
_DESTRUCTIVE_RE = [re.compile(p, re.IGNORECASE) for p in _DESTRUCTIVE_PATTERNS]
|
||||
_DESTRUCTIVE_RE = [re.compile(p, re.DOTALL | re.IGNORECASE) for p in _DESTRUCTIVE_PATTERNS]
|
||||
|
||||
|
||||
def _detect_destructive_operations(results: list[dict]) -> list[str]:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue