|
1 | | -Run started:2025-11-20 21:17:17.099743 |
| 1 | +Run started:2025-12-04 20:58:29.825928 |
2 | 2 |
|
3 | 3 | Test results: |
4 | 4 | >> Issue: [B403:blacklist] Consider possible security implications associated with pickle module. |
@@ -39,81 +39,81 @@ Test results: |
39 | 39 | Severity: Medium Confidence: Low |
40 | 40 | CWE: CWE-89 (https://cwe.mitre.org/data/definitions/89.html) |
41 | 41 | More Info: https://bandit.readthedocs.io/en/1.7.7/plugins/b608_hardcoded_sql_expressions.html |
42 | | - Location: ./sdgym/benchmark.py:944:27 |
43 | | -943 # User data script to install the library |
44 | | -944 user_data_script = f"""#!/bin/bash |
45 | | -945 sudo apt update -y |
46 | | -946 sudo apt install -y python3-pip python3-venv awscli |
47 | | -947 echo "======== Create Virtual Environment ============" |
48 | | -948 python3 -m venv ~/env |
49 | | -949 source ~/env/bin/activate |
50 | | -950 echo "======== Install Dependencies in venv ============" |
51 | | -951 pip install --upgrade pip |
52 | | -952 pip install sdgym[all] |
53 | | -953 pip install anyio |
54 | | -954 echo "======== Configure AWS CLI ============" |
55 | | -955 aws configure set aws_access_key_id {credentials.access_key} |
56 | | -956 aws configure set aws_secret_access_key {credentials.secret_key} |
57 | | -957 aws configure set region {session.region_name} |
58 | | -958 echo "======== Write Script ===========" |
59 | | -959 printf '%s\\n' "{escaped_script}" > ~/sdgym_script.py |
60 | | -960 echo "======== Run Script ===========" |
61 | | -961 python ~/sdgym_script.py |
62 | | -962 |
63 | | -963 echo "======== Complete ===========" |
64 | | -964 INSTANCE_ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id) |
65 | | -965 aws ec2 terminate-instances --instance-ids $INSTANCE_ID |
66 | | -966 """ |
67 | | -967 |
| 42 | + Location: ./sdgym/benchmark.py:992:27 |
| 43 | +991 # User data script to install the library |
| 44 | +992 user_data_script = f"""#!/bin/bash |
| 45 | +993 sudo apt update -y |
| 46 | +994 sudo apt install -y python3-pip python3-venv awscli |
| 47 | +995 echo "======== Create Virtual Environment ============" |
| 48 | +996 python3 -m venv ~/env |
| 49 | +997 source ~/env/bin/activate |
| 50 | +998 echo "======== Install Dependencies in venv ============" |
| 51 | +999 pip install --upgrade pip |
| 52 | +1000 pip install sdgym[all] |
| 53 | +1001 pip install anyio |
| 54 | +1002 echo "======== Configure AWS CLI ============" |
| 55 | +1003 aws configure set aws_access_key_id {credentials.access_key} |
| 56 | +1004 aws configure set aws_secret_access_key {credentials.secret_key} |
| 57 | +1005 aws configure set region {session.region_name} |
| 58 | +1006 echo "======== Write Script ===========" |
| 59 | +1007 printf '%s\\n' "{escaped_script}" > ~/sdgym_script.py |
| 60 | +1008 echo "======== Run Script ===========" |
| 61 | +1009 python ~/sdgym_script.py |
| 62 | +1010 |
| 63 | +1011 echo "======== Complete ===========" |
| 64 | +1012 INSTANCE_ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id) |
| 65 | +1013 aws ec2 terminate-instances --instance-ids $INSTANCE_ID |
| 66 | +1014 """ |
| 67 | +1015 |
68 | 68 |
|
69 | 69 | -------------------------------------------------- |
70 | 70 | >> Issue: [B608:hardcoded_sql_expressions] Possible SQL injection vector through string-based query construction. |
71 | 71 | Severity: Medium Confidence: Low |
72 | 72 | CWE: CWE-89 (https://cwe.mitre.org/data/definitions/89.html) |
73 | 73 | More Info: https://bandit.readthedocs.io/en/1.7.7/plugins/b608_hardcoded_sql_expressions.html |
74 | | - Location: ./sdgym/benchmark.py:1410:31 |
75 | | -1409 def _get_user_data_script(access_key, secret_key, region_name, script_content): |
76 | | -1410 return textwrap.dedent(f"""\ |
77 | | -1411 #!/bin/bash |
78 | | -1412 set -e |
79 | | -1413 |
80 | | -1414 # Always terminate the instance when the script exits (success or failure) |
81 | | -1415 trap ' |
82 | | -1416 INSTANCE_ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id); |
83 | | -1417 echo "======== Terminating EC2 instance: $INSTANCE_ID =========="; |
84 | | -1418 aws ec2 terminate-instances --instance-ids $INSTANCE_ID; |
85 | | -1419 ' EXIT |
86 | | -1420 |
87 | | -1421 exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1 |
88 | | -1422 echo "======== Update and Install Dependencies ============" |
89 | | -1423 sudo apt update -y |
90 | | -1424 sudo apt install -y python3-pip python3-venv awscli |
91 | | -1425 echo "======== Configure AWS CLI ============" |
92 | | -1426 aws configure set aws_access_key_id '{access_key}' |
93 | | -1427 aws configure set aws_secret_access_key '{secret_key}' |
94 | | -1428 aws configure set default.region '{region_name}' |
95 | | -1429 |
96 | | -1430 echo "======== Create Virtual Environment ============" |
97 | | -1431 python3 -m venv ~/env |
98 | | -1432 source ~/env/bin/activate |
99 | | -1433 |
100 | | -1434 echo "======== Install Dependencies in venv ============" |
101 | | -1435 pip install --upgrade pip |
102 | | -1436 pip install sdgym[all] |
103 | | -1437 pip install s3fs |
104 | | -1438 |
105 | | -1439 echo "======== Write Script ===========" |
106 | | -1440 cat << 'EOF' > ~/sdgym_script.py |
107 | | -1441 {script_content} |
108 | | -1442 EOF |
109 | | -1443 |
110 | | -1444 echo "======== Run Script ===========" |
111 | | -1445 python ~/sdgym_script.py |
112 | | -1446 echo "======== Complete ===========" |
113 | | -1447 INSTANCE_ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id) |
114 | | -1448 aws ec2 terminate-instances --instance-ids $INSTANCE_ID |
115 | | -1449 """).strip() |
116 | | -1450 |
| 74 | + Location: ./sdgym/benchmark.py:1475:31 |
| 75 | +1474 def _get_user_data_script(access_key, secret_key, region_name, script_content): |
| 76 | +1475 return textwrap.dedent(f"""\ |
| 77 | +1476 #!/bin/bash |
| 78 | +1477 set -e |
| 79 | +1478 |
| 80 | +1479 # Always terminate the instance when the script exits (success or failure) |
| 81 | +1480 trap ' |
| 82 | +1481 INSTANCE_ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id); |
| 83 | +1482 echo "======== Terminating EC2 instance: $INSTANCE_ID =========="; |
| 84 | +1483 aws ec2 terminate-instances --instance-ids $INSTANCE_ID; |
| 85 | +1484 ' EXIT |
| 86 | +1485 |
| 87 | +1486 exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1 |
| 88 | +1487 echo "======== Update and Install Dependencies ============" |
| 89 | +1488 sudo apt update -y |
| 90 | +1489 sudo apt install -y python3-pip python3-venv awscli |
| 91 | +1490 echo "======== Configure AWS CLI ============" |
| 92 | +1491 aws configure set aws_access_key_id '{access_key}' |
| 93 | +1492 aws configure set aws_secret_access_key '{secret_key}' |
| 94 | +1493 aws configure set default.region '{region_name}' |
| 95 | +1494 |
| 96 | +1495 echo "======== Create Virtual Environment ============" |
| 97 | +1496 python3 -m venv ~/env |
| 98 | +1497 source ~/env/bin/activate |
| 99 | +1498 |
| 100 | +1499 echo "======== Install Dependencies in venv ============" |
| 101 | +1500 pip install --upgrade pip |
| 102 | +1501 pip install sdgym[all] |
| 103 | +1502 pip install s3fs |
| 104 | +1503 |
| 105 | +1504 echo "======== Write Script ===========" |
| 106 | +1505 cat << 'EOF' > ~/sdgym_script.py |
| 107 | +1506 {script_content} |
| 108 | +1507 EOF |
| 109 | +1508 |
| 110 | +1509 echo "======== Run Script ===========" |
| 111 | +1510 python ~/sdgym_script.py |
| 112 | +1511 echo "======== Complete ===========" |
| 113 | +1512 INSTANCE_ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id) |
| 114 | +1513 aws ec2 terminate-instances --instance-ids $INSTANCE_ID |
| 115 | +1514 """).strip() |
| 116 | +1515 |
117 | 117 |
|
118 | 118 | -------------------------------------------------- |
119 | 119 | >> Issue: [B403:blacklist] Consider possible security implications associated with pickle module. |
@@ -237,7 +237,7 @@ Test results: |
237 | 237 | -------------------------------------------------- |
238 | 238 |
|
239 | 239 | Code scanned: |
240 | | - Total lines of code: 4839 |
| 240 | + Total lines of code: 4978 |
241 | 241 | Total lines skipped (#nosec): 0 |
242 | 242 | Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 0 |
243 | 243 |
|
|
0 commit comments