mirror of
https://github.com/github/codeql.git
synced 2026-05-04 05:05:12 +02:00
Python: Move query tests to reflect new file layout
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
edges
|
||||
| test_cryptography.py:5:17:5:30 | a password | test_cryptography.py:8:29:8:37 | a password |
|
||||
| test_cryptography.py:5:17:5:30 | a password | test_cryptography.py:8:29:8:37 | a password |
|
||||
| test_pycrypto.py:5:17:5:30 | a password | test_pycrypto.py:7:27:7:35 | a password |
|
||||
| test_pycrypto.py:5:17:5:30 | a password | test_pycrypto.py:7:27:7:35 | a password |
|
||||
#select
|
||||
| test_cryptography.py:8:29:8:37 | dangerous | test_cryptography.py:5:17:5:30 | a password | test_cryptography.py:8:29:8:37 | a password | $@ is used in a broken or weak cryptographic algorithm. | test_cryptography.py:5:17:5:30 | get_password() | Sensitive data |
|
||||
| test_pycrypto.py:7:27:7:35 | dangerous | test_pycrypto.py:5:17:5:30 | a password | test_pycrypto.py:7:27:7:35 | a password | $@ is used in a broken or weak cryptographic algorithm. | test_pycrypto.py:5:17:5:30 | get_password() | Sensitive data |
|
||||
@@ -0,0 +1 @@
|
||||
Security/Crypto/WeakCryptoAlgorithm/WeakCryptoAlgorithm.ql
|
||||
@@ -0,0 +1,12 @@
|
||||
| Taint Crypto.Cipher.ARC4 | test_pycrypto.py:6:14:6:27 | test_pycrypto.py:6 | test_pycrypto.py:6:14:6:27 | Attribute() | |
|
||||
| Taint Crypto.Cipher.ARC4 | test_pycrypto.py:7:12:7:17 | test_pycrypto.py:7 | test_pycrypto.py:7:12:7:17 | cipher | |
|
||||
| Taint cryptography.Cipher.RC4 | test_cryptography.py:6:14:6:47 | test_cryptography.py:6 | test_cryptography.py:6:14:6:47 | Cipher() | |
|
||||
| Taint cryptography.Cipher.RC4 | test_cryptography.py:7:17:7:22 | test_cryptography.py:7 | test_cryptography.py:7:17:7:22 | cipher | |
|
||||
| Taint cryptography.encryptor.RC4 | test_cryptography.py:7:17:7:34 | test_cryptography.py:7 | test_cryptography.py:7:17:7:34 | Attribute() | |
|
||||
| Taint cryptography.encryptor.RC4 | test_cryptography.py:8:12:8:20 | test_cryptography.py:8 | test_cryptography.py:8:12:8:20 | encryptor | |
|
||||
| Taint cryptography.encryptor.RC4 | test_cryptography.py:8:42:8:50 | test_cryptography.py:8 | test_cryptography.py:8:42:8:50 | encryptor | |
|
||||
| Taint sensitive.data.password | test_cryptography.py:5:17:5:30 | test_cryptography.py:5 | test_cryptography.py:5:17:5:30 | get_password() | |
|
||||
| Taint sensitive.data.password | test_cryptography.py:8:29:8:37 | test_cryptography.py:8 | test_cryptography.py:8:29:8:37 | dangerous | |
|
||||
| Taint sensitive.data.password | test_cryptography.py:8:42:8:50 | test_cryptography.py:8 | test_cryptography.py:8:42:8:50 | encryptor | |
|
||||
| Taint sensitive.data.password | test_pycrypto.py:5:17:5:30 | test_pycrypto.py:5 | test_pycrypto.py:5:17:5:30 | get_password() | |
|
||||
| Taint sensitive.data.password | test_pycrypto.py:7:27:7:35 | test_pycrypto.py:7 | test_pycrypto.py:7:27:7:35 | dangerous | |
|
||||
@@ -0,0 +1,9 @@
|
||||
import python
|
||||
import semmle.python.dataflow.TaintTracking
|
||||
import python
|
||||
import semmle.python.security.SensitiveData
|
||||
import semmle.python.security.Crypto
|
||||
|
||||
from TaintedNode n, AstNode src
|
||||
where src = n.getAstNode() and src.getLocation().getFile().getAbsolutePath().matches("%test%")
|
||||
select "Taint " + n.getTaintKind(), n.getLocation(), src, n.getContext()
|
||||
@@ -0,0 +1 @@
|
||||
semmle-extractor-options: -p ../../lib --max-import-depth=3
|
||||
@@ -0,0 +1,9 @@
|
||||
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms
|
||||
from secrets_store import get_password
|
||||
|
||||
def get_badly_encrypted_password():
|
||||
dangerous = get_password()
|
||||
cipher = Cipher(algorithms.ARC4(key), _, _)
|
||||
encryptor = cipher.encryptor()
|
||||
return encryptor.update(dangerous) + encryptor.finalize()
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
from Crypto.Cipher import ARC4
|
||||
from secrets_store import get_password
|
||||
|
||||
def get_badly_encrypted_password():
|
||||
dangerous = get_password()
|
||||
cipher = ARC4.new(_, _)
|
||||
return cipher.encrypt(dangerous)
|
||||
|
||||
Reference in New Issue
Block a user