Compare commits
2 commits
c7d5694cd3
...
e8f702191f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8f702191f | ||
|
|
943722cd95 |
1 changed files with 7 additions and 3 deletions
|
|
@ -68,11 +68,15 @@ class TestDetectDestructivePatterns(unittest.TestCase):
|
||||||
results = [self._make_result("DROP TABLE users;")]
|
results = [self._make_result("DROP TABLE users;")]
|
||||||
self.assertGreater(len(_detect_destructive_operations(results)), 0)
|
self.assertGreater(len(_detect_destructive_operations(results)), 0)
|
||||||
|
|
||||||
# (6) DELETE FROM detected
|
# (6) DELETE FROM без WHERE — детектируется; с WHERE — нет (KIN-SEC-001)
|
||||||
def test_delete_from_detected(self):
|
def test_delete_from_no_where_detected(self):
|
||||||
results = [self._make_result("DELETE FROM sessions WHERE expired = 1;")]
|
results = [self._make_result("DELETE FROM sessions;")]
|
||||||
self.assertGreater(len(_detect_destructive_operations(results)), 0)
|
self.assertGreater(len(_detect_destructive_operations(results)), 0)
|
||||||
|
|
||||||
|
def test_delete_from_with_where_not_detected(self):
|
||||||
|
results = [self._make_result("DELETE FROM sessions WHERE expired = 1;")]
|
||||||
|
self.assertEqual(len(_detect_destructive_operations(results)), 0)
|
||||||
|
|
||||||
# (7) unlink detected
|
# (7) unlink detected
|
||||||
def test_unlink_detected(self):
|
def test_unlink_detected(self):
|
||||||
results = [self._make_result("unlink /var/run/app.pid")]
|
results = [self._make_result("unlink /var/run/app.pid")]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue