feat: add comprehensive marketplace scenario testing and update production readiness workflow
🛒 Marketplace Testing Enhancement:
• Add complete marketplace workflow test with 6-step scenario
• Test GPU bidding from aitbc server to marketplace
• Test bid confirmation and job creation by aitbc1
• Test Ollama AI task submission and execution monitoring
• Test blockchain payment processing and transaction mining
• Add balance verification for both parties after payment
• Add marketplace status
This commit is contained in:
39
scripts/security_monitor.sh
Executable file
39
scripts/security_monitor.sh
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
# AITBC Security Monitoring Script
|
||||
|
||||
SECURITY_LOG="/var/log/aitbc/security.log"
|
||||
TIMESTAMP=$(date '+%Y-%m-%d %H:%M:%S')
|
||||
|
||||
# Create log directory
|
||||
mkdir -p /var/log/aitbc
|
||||
|
||||
# Function to log security events
|
||||
log_security() {
|
||||
echo "[$TIMESTAMP] SECURITY: $1" >> $SECURITY_LOG
|
||||
}
|
||||
|
||||
# Check for failed SSH attempts
|
||||
FAILED_SSH=$(grep "authentication failure" /var/log/auth.log | grep "$(date '+%b %d')" | wc -l)
|
||||
if [ "$FAILED_SSH" -gt 10 ]; then
|
||||
log_security "High number of failed SSH attempts: $FAILED_SSH"
|
||||
fi
|
||||
|
||||
# Check for unusual login activity
|
||||
UNUSUAL_LOGINS=$(last -n 20 | grep -v "reboot" | grep -v "shutdown" | wc -l)
|
||||
if [ "$UNUSUAL_LOGINS" -gt 0 ]; then
|
||||
log_security "Recent login activity detected: $UNUSUAL_LOGINS logins"
|
||||
fi
|
||||
|
||||
# Check service status
|
||||
SERVICES_DOWN=$(systemctl list-units --state=failed | grep aitbc | wc -l)
|
||||
if [ "$SERVICES_DOWN" -gt 0 ]; then
|
||||
log_security "Failed AITBC services detected: $SERVICES_DOWN"
|
||||
fi
|
||||
|
||||
# Check disk space
|
||||
DISK_USAGE=$(df / | awk 'NR==2 {print $5}' | sed 's/%//')
|
||||
if [ "$DISK_USAGE" -gt 80 ]; then
|
||||
log_security "High disk usage: $DISK_USAGE%"
|
||||
fi
|
||||
|
||||
echo "Security monitoring completed"
|
||||
Reference in New Issue
Block a user