@@ -35,17 +35,17 @@ jobs:
3535
3636 # Check for unsafe eval usage
3737 if grep -n "eval" phpvm.sh; then
38- echo "⚠️ Found eval usage - review for security"
38+ echo "Found eval usage - review for security"
3939 fi
4040
4141 # Check for unsafe rm operations
4242 if grep -n "rm -rf \$" phpvm.sh; then
43- echo "⚠️ Found variable-based rm -rf - review for safety"
43+ echo "Found variable-based rm -rf - review for safety"
4444 fi
4545
4646 # Check for direct sudo usage without validation
4747 if grep -n "sudo.*\$" phpvm.sh | grep -v "run_with_sudo"; then
48- echo "⚠️ Found direct sudo with variables - review for safety"
48+ echo "Found direct sudo with variables - review for safety"
4949 fi
5050
5151 - name : Input Validation Security Test
@@ -70,10 +70,10 @@ jobs:
7070 for input in "${malicious_inputs[@]}"; do
7171 echo "Testing malicious input: $input"
7272 if ./phpvm.sh install "$input" 2>/dev/null; then
73- echo "❌ SECURITY ISSUE: Accepted malicious input: $input"
73+ echo "SECURITY ISSUE: Accepted malicious input: $input"
7474 exit 1
7575 else
76- echo "✅ Correctly rejected: $input"
76+ echo "Correctly rejected: $input"
7777 fi
7878 done
7979
@@ -97,10 +97,10 @@ jobs:
9797 echo "$input" > security_test/.phpvmrc
9898 cd security_test
9999 if ../phpvm.sh auto 2>/dev/null; then
100- echo "❌ SECURITY ISSUE: Accepted path traversal: $input"
100+ echo "SECURITY ISSUE: Accepted path traversal: $input"
101101 exit 1
102102 else
103- echo "✅ Correctly rejected path traversal: $input"
103+ echo "Correctly rejected path traversal: $input"
104104 fi
105105 cd ..
106106 done
@@ -123,10 +123,10 @@ jobs:
123123 chmod 000 perm_test/.phpvmrc
124124 cd perm_test
125125 if ../phpvm.sh auto 2>/dev/null; then
126- echo "❌ Should have failed with unreadable .phpvmrc"
126+ echo "Should have failed with unreadable .phpvmrc"
127127 exit 1
128128 else
129- echo "✅ Correctly handled unreadable .phpvmrc"
129+ echo "Correctly handled unreadable .phpvmrc"
130130 fi
131131 cd ..
132132
@@ -137,9 +137,9 @@ jobs:
137137 # Test with malicious environment variables
138138 export PHPVM_DIR="/tmp/malicious; rm -rf /"
139139 if ./phpvm.sh version 2>/dev/null; then
140- echo "⚠️ Script executed with malicious PHPVM_DIR"
140+ echo "Script executed with malicious PHPVM_DIR"
141141 else
142- echo "✅ Handled malicious PHPVM_DIR safely"
142+ echo "Handled malicious PHPVM_DIR safely"
143143 fi
144144
145145 # Reset environment
@@ -158,9 +158,9 @@ jobs:
158158
159159 cd symlink_test
160160 if ../phpvm.sh auto 2>/dev/null; then
161- echo "⚠️ Script followed symlink to /etc/passwd"
161+ echo "Script followed symlink to /etc/passwd"
162162 else
163- echo "✅ Safely handled symlink attack"
163+ echo "Safely handled symlink attack"
164164 fi
165165 cd ..
166166
@@ -185,16 +185,16 @@ jobs:
185185
186186 # Test sudo usage validation
187187 if grep -n "sudo" phpvm.sh | grep -v "run_with_sudo"; then
188- echo "⚠️ Found sudo usage outside of run_with_sudo helper"
188+ echo "Found sudo usage outside of run_with_sudo helper"
189189 fi
190190
191191 # Ensure run_with_sudo function exists and is used properly
192192 if ! grep -q "run_with_sudo()" phpvm.sh; then
193- echo "❌ run_with_sudo function not found"
193+ echo "run_with_sudo function not found"
194194 exit 1
195195 fi
196196
197- echo "✅ Privilege escalation tests passed"
197+ echo "Privilege escalation tests passed"
198198
199199 - name : Test Sudo Command Validation
200200 run : |
@@ -204,10 +204,10 @@ jobs:
204204 # Look for any direct variable expansion in sudo calls
205205
206206 if grep -n "sudo.*\$[^{]" phpvm.sh | grep -v "run_with_sudo"; then
207- echo "⚠️ Found potentially unsafe sudo variable expansion"
207+ echo "Found potentially unsafe sudo variable expansion"
208208 fi
209209
210- echo "✅ Sudo validation tests completed"
210+ echo "Sudo validation tests completed"
211211
212212 code-quality-security :
213213 name : Code Quality and Security Standards
@@ -232,46 +232,46 @@ jobs:
232232
233233 for pattern in "${secret_patterns[@]}"; do
234234 if grep -i "$pattern" phpvm.sh; then
235- echo "⚠️ Found potential secret pattern: $pattern"
235+ echo "Found potential secret pattern: $pattern"
236236 fi
237237 done
238238
239- echo "✅ Secret scanning completed"
239+ echo "Secret scanning completed"
240240
241241 - name : Check Error Handling Security
242242 run : |
243243 echo "=== Checking Error Handling Security ==="
244244
245245 # Ensure errors don't leak sensitive information
246246 if grep -n "echo.*\$" phpvm.sh | grep -i "error"; then
247- echo "⚠️ Found error messages that might leak information"
247+ echo "Found error messages that might leak information"
248248 fi
249249
250250 # Check for proper error code usage
251251 if ! grep -q "return 1" phpvm.sh; then
252- echo "❌ No proper error returns found"
252+ echo "No proper error returns found"
253253 exit 1
254254 fi
255255
256- echo "✅ Error handling security check completed"
256+ echo "Error handling security check completed"
257257
258258 - name : Validate Safe Defaults
259259 run : |
260260 echo "=== Validating Safe Defaults ==="
261261
262262 # Check that DEBUG defaults to false
263263 if ! grep -q "DEBUG=false" phpvm.sh; then
264- echo "❌ DEBUG should default to false"
264+ echo "DEBUG should default to false"
265265 exit 1
266266 fi
267267
268268 # Check for safe directory defaults
269269 if ! grep -q "PHPVM_DIR.*HOME" phpvm.sh; then
270- echo "❌ PHPVM_DIR should default to user's home directory"
270+ echo "PHPVM_DIR should default to user's home directory"
271271 exit 1
272272 fi
273273
274- echo "✅ Safe defaults validation completed"
274+ echo "Safe defaults validation completed"
275275
276276 penetration-test :
277277 name : Security Testing
@@ -289,15 +289,15 @@ jobs:
289289 # Test with extremely long inputs
290290 very_long_input=$(printf 'A%.0s' {1..1000})
291291 if ./phpvm.sh install "$very_long_input" 2>/dev/null; then
292- echo "❌ SECURITY ISSUE: Accepted extremely long input"
292+ echo "SECURITY ISSUE: Accepted extremely long input"
293293 exit 1
294294 else
295- echo "✅ Correctly rejected extremely long input"
295+ echo "Correctly rejected extremely long input"
296296 fi
297297
298298 # Test concurrent operations and state validation
299299 mkdir -p ~/.phpvm
300300 echo "corrupted_state" > ~/.phpvm/active_version
301- ./phpvm.sh list || echo "✅ Handled corrupted state gracefully"
301+ ./phpvm.sh list || echo "Handled corrupted state gracefully"
302302
303- echo "✅ Security tests completed"
303+ echo "Security tests completed"
0 commit comments