Security Scanning
Security Scanning
Section titled “Security Scanning”Understanding Scan Results
Section titled “Understanding Scan Results”Alphyn SDK performs continuous security scanning of your application and its runtime environment. The scan results provide insights into the security posture of your app.
Scan Trigger Methods:
import Alphyn
// Get latest scan resultlet scanResultString = try? AlphynSDK.getScanResult()
// Scan results are also delivered via callbacks// (Example within AlphynSecurityListener's onSuccess method)func onSuccess(_ result: AlphynCallbackResult) { if result.isScanResponse { let scanResult = result.getScanResult() processScanResult(scanResult) }}Scan Result Types
Section titled “Scan Result Types”| Result | Description | Recommended Action |
|---|---|---|
trusted | App passed all security checks | Continue normal operation |
flagged | Potential security concerns detected | Monitor and investigate |
untrusted | App failed critical security checks | Restrict functionality or terminate |
unknown | Scan result unclear or invalid | Retry scan or investigate |
initializationError | SDK failed to initialize properly | Fix initialization issues |
Scan Result Handling:
import Alphyn
private func processScanResult(_ scanResult: AlphynScanResult) { print("Alphyn Scan Result: \(scanResult.emoji) \(scanResult.displayName)")
if scanResult.isThreat { print("Alphyn Security threat detected!")
if scanResult.isCriticalThreat { print("Alphyn Critical threat - terminating app") } else { print("Alphyn Enabling enhanced security monitoring") } } else if scanResult == .trusted { print("Alphyn Application verified as secure") }}```
### Handling Scan Responses
**Comprehensive Scan Response Handler:**
```swiftimport Alphyn
class SecurityManager { func handleScanResponse(result: AlphynScanResult) { switch result { case .trusted: print("Security ✅ Application is trusted") case .flagged: print("Security ⚠️ Application flagged for review") case .untrusted: print("Security 🚨 Application untrusted - critical action required") case .initializationError: print("Security Initialization error during scan response") case .unknown: print("Security Unknown scan result") } }}