ai_root_shield 0.4.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,6 +15,21 @@ require_relative "ai_root_shield/certificate_pinning_helper"
15
15
  require_relative "ai_root_shield/advanced_proxy_detector"
16
16
  require_relative "ai_root_shield/enterprise_policy_manager"
17
17
 
18
+ # v0.5.0 Platform-specific security modules
19
+ require_relative "ai_root_shield/platform/android_security_module"
20
+ require_relative "ai_root_shield/platform/ios_security_module"
21
+ require_relative "ai_root_shield/platform/hardware_security_analyzer"
22
+ require_relative "ai_root_shield/platform/unified_report_generator"
23
+
24
+ # v0.5.0 CI/CD and developer tools
25
+ require_relative "ai_root_shield/ci_cd/security_test_module"
26
+
27
+ # v0.5.0 Dashboard and visualization
28
+ require_relative "ai_root_shield/dashboard/web_dashboard"
29
+
30
+ # v0.5.0 Third-party integrations
31
+ require_relative "ai_root_shield/integrations/siem_connector"
32
+
18
33
  module AiRootShield
19
34
  class Error < StandardError; end
20
35
 
@@ -23,6 +38,12 @@ module AiRootShield
23
38
  @policy_manager = nil
24
39
  @certificate_pinning = nil
25
40
  @proxy_detector = nil
41
+ @android_module = nil
42
+ @ios_module = nil
43
+ @hardware_analyzer = nil
44
+ @report_generator = nil
45
+ @ci_cd_module = nil
46
+ @siem_connector = nil
26
47
 
27
48
  # Main entry point for device scanning
28
49
  # @param device_logs_path [String] Path to device logs JSON file
@@ -133,6 +154,128 @@ module AiRootShield
133
154
  @proxy_detector
134
155
  end
135
156
 
157
+ # v0.5.0 Platform-specific security analysis
158
+ # Analyze Android device security using SafetyNet and Play Integrity APIs
159
+ # @param device_logs [Hash] Device logs data
160
+ # @param config [Hash] Configuration options
161
+ # @return [Hash] Android security analysis results
162
+ def self.analyze_android_security(device_logs, config = {})
163
+ @android_module ||= Platform::AndroidSecurityModule.new(config)
164
+ @android_module.analyze_device_security(device_logs)
165
+ end
166
+
167
+ # Analyze iOS device security with advanced jailbreak detection
168
+ # @param device_logs [Hash] Device logs data
169
+ # @return [Hash] iOS security analysis results
170
+ def self.analyze_ios_security(device_logs)
171
+ @ios_module ||= Platform::IosSecurityModule.new
172
+ @ios_module.analyze_device_security(device_logs)
173
+ end
174
+
175
+ # Analyze hardware security features (TEE/SE, biometrics)
176
+ # @param device_logs [Hash] Device logs data
177
+ # @param platform [String] Platform type ('android' or 'ios')
178
+ # @return [Hash] Hardware security analysis results
179
+ def self.analyze_hardware_security(device_logs, platform)
180
+ @hardware_analyzer ||= Platform::HardwareSecurityAnalyzer.new
181
+ @hardware_analyzer.analyze_hardware_security(device_logs, platform)
182
+ end
183
+
184
+ # Generate unified cross-platform security report
185
+ # @param android_results [Hash] Android analysis results
186
+ # @param ios_results [Hash] iOS analysis results
187
+ # @param metadata [Hash] Report metadata
188
+ # @return [Hash] Unified security report
189
+ def self.generate_unified_report(android_results: nil, ios_results: nil, metadata: {})
190
+ @report_generator ||= Platform::UnifiedReportGenerator.new
191
+ @report_generator.generate_unified_report(
192
+ android_results: android_results,
193
+ ios_results: ios_results,
194
+ metadata: metadata
195
+ )
196
+ end
197
+
198
+ # Run CI/CD security tests
199
+ # @param device_logs_path [String] Path to device logs file
200
+ # @param options [Hash] Test configuration options
201
+ # @return [Hash] CI/CD test results
202
+ def self.run_ci_cd_tests(device_logs_path, options = {})
203
+ @ci_cd_module ||= CiCd::SecurityTestModule.new(options)
204
+ @ci_cd_module.run_security_tests(device_logs_path, options)
205
+ end
206
+
207
+ # Generate CI/CD configuration for specified platform
208
+ # @param platform [String] CI/CD platform name
209
+ # @param options [Hash] Configuration options
210
+ # @return [String] CI/CD configuration content
211
+ def self.generate_ci_config(platform, options = {})
212
+ @ci_cd_module ||= CiCd::SecurityTestModule.new
213
+ @ci_cd_module.generate_ci_config(platform, options)
214
+ end
215
+
216
+ # Configure SIEM integration
217
+ # @param platform [Symbol] SIEM platform (:splunk, :elastic, etc.)
218
+ # @param config [Hash] SIEM configuration
219
+ # @return [Integrations::SiemConnector] SIEM connector instance
220
+ def self.configure_siem(platform, config = {})
221
+ @siem_connector = Integrations::SiemConnector.new(platform, config)
222
+ end
223
+
224
+ # Send security events to SIEM
225
+ # @param analysis_results [Hash] Security analysis results
226
+ # @param metadata [Hash] Event metadata
227
+ # @return [Hash] SIEM response
228
+ def self.send_to_siem(analysis_results, metadata = {})
229
+ return { error: "SIEM not configured" } unless @siem_connector
230
+
231
+ @siem_connector.send_security_event(analysis_results, metadata)
232
+ end
233
+
234
+ # Start web dashboard
235
+ # @param port [Integer] Port number
236
+ def self.start_dashboard(port = 4567)
237
+ dashboard = AiRootShield::Dashboard::WebDashboard.new
238
+ dashboard.start(port)
239
+ end
240
+
241
+ # Platform-specific analysis methods for CLI
242
+ def self.analyze_android_device(device_logs_path, config = {})
243
+ device_logs = JSON.parse(File.read(device_logs_path))
244
+ android_module = AiRootShield::Platform::AndroidSecurityModule.new(
245
+ api_key: config[:safetynet_api_key],
246
+ package_name: config[:package_name]
247
+ )
248
+ android_module.analyze_device_security(device_logs)
249
+ end
250
+
251
+ def self.analyze_ios_device(device_logs_path, config = {})
252
+ device_logs = JSON.parse(File.read(device_logs_path))
253
+ ios_module = AiRootShield::Platform::IosSecurityModule.new
254
+ ios_module.analyze_device_security(device_logs)
255
+ end
256
+
257
+ # CI/CD integration method for CLI
258
+ def self.run_ci_cd_tests(device_logs_path, config = {})
259
+ ci_module = AiRootShield::CiCd::SecurityTestModule.new
260
+ ci_module.run_security_tests(device_logs_path, config)
261
+ end
262
+
263
+ # Generate CI configuration for CLI
264
+ def self.generate_ci_config(platform)
265
+ ci_module = AiRootShield::CiCd::SecurityTestModule.new
266
+ ci_module.generate_ci_config(platform)
267
+ end
268
+
269
+ # Generate unified cross-platform report for CLI
270
+ def self.generate_unified_report(android_results: nil, ios_results: nil, metadata: {})
271
+ report_generator = AiRootShield::Platform::UnifiedReportGenerator.new
272
+ report_generator.generate_unified_report(
273
+ android_results: android_results,
274
+ ios_results: ios_results,
275
+ metadata: metadata
276
+ )
277
+ end
278
+
136
279
  # Check if RASP protection is active
137
280
  # @return [Boolean] True if RASP protection is active
138
281
  def self.rasp_active?
@@ -148,11 +291,19 @@ module AiRootShield
148
291
  policy_configured: !@policy_manager.nil?,
149
292
  certificate_pinning_configured: !@certificate_pinning.nil?,
150
293
  proxy_detection_configured: !@proxy_detector.nil?,
294
+ siem_configured: !@siem_connector.nil?,
295
+ platform_modules: {
296
+ android_module: !@android_module.nil?,
297
+ ios_module: !@ios_module.nil?,
298
+ hardware_analyzer: !@hardware_analyzer.nil?,
299
+ report_generator: !@report_generator.nil?
300
+ },
151
301
  components: {
152
302
  rasp: @rasp_protection&.protection_status,
153
303
  policy: @policy_manager&.policy_statistics,
154
304
  certificate_pinning: @certificate_pinning&.pinning_status,
155
- proxy_detection: @proxy_detector&.detection_statistics
305
+ proxy_detection: @proxy_detector&.detection_statistics,
306
+ siem: @siem_connector ? { platform: @siem_connector.instance_variable_get(:@platform) } : nil
156
307
  }
157
308
  }
158
309
  end
@@ -0,0 +1,124 @@
1
+ {
2
+ "metadata": {
3
+ "test_suite_version": "1.0",
4
+ "ai_root_shield_version": "0.5.0",
5
+ "execution_timestamp": "2025-09-09T21:01:42Z",
6
+ "ci_environment": "Unknown",
7
+ "test_configuration": {},
8
+ "git_information": {
9
+ "commit_sha": "6a1360b16d119ffcb11973d68aed1fa5ebb58622",
10
+ "branch": "main",
11
+ "commit_message": "Release v0.4.0: Add advanced network security and enterprise policy management\n\n- Add certificate pinning helper with common CA support\n- Implement advanced proxy detection (VPN, Tor, custom DNS, MITM)\n- Add enterprise policy management with JSON-based rules\n- Include policy templates for banking, enterprise, and development\n- Add comprehensive network analysis integration\n- Update CLI with new network security options\n- Enhance documentation with new features",
12
+ "author": "oynaxo"
13
+ },
14
+ "build_information": {}
15
+ },
16
+ "test_results": [
17
+ {
18
+ "test_name": "Android Security Analysis",
19
+ "platform": "android",
20
+ "status": "PASSED",
21
+ "risk_score": 18,
22
+ "risk_factors": [
23
+ "TEE_NOT_AVAILABLE",
24
+ "HARDWARE_KEYSTORE_UNAVAILABLE"
25
+ ],
26
+ "details": {
27
+ "safetynet": {
28
+ "basic_integrity": true,
29
+ "cts_profile_match": true,
30
+ "evaluation_type": "BASIC",
31
+ "nonce_verified": false,
32
+ "timestamp": 1640995200000,
33
+ "advice": [
34
+ {
35
+ "type": "SECURITY",
36
+ "message": "Device has secure lock screen"
37
+ }
38
+ ]
39
+ },
40
+ "play_integrity": {
41
+ "device_verdict": [
42
+ "MEETS_DEVICE_INTEGRITY",
43
+ "MEETS_BASIC_INTEGRITY"
44
+ ],
45
+ "app_verdict": "PLAY_RECOGNIZED",
46
+ "account_verdict": "LICENSED",
47
+ "environment_verdict": "MEETS_BASIC_INTEGRITY",
48
+ "meets_device_integrity": {
49
+ "meets_device_integrity": true,
50
+ "meets_basic_integrity": true,
51
+ "meets_strong_integrity": false
52
+ },
53
+ "app_licensing_verdict": "LICENSED"
54
+ },
55
+ "hardware_security": {
56
+ "tee_available": false,
57
+ "secure_element_available": false,
58
+ "hardware_keystore": false,
59
+ "biometric_hardware": {
60
+ "fingerprint_available": true,
61
+ "face_available": false,
62
+ "iris_available": false,
63
+ "biometric_prompt_supported": false,
64
+ "hardware_level": "strong",
65
+ "enrolled_biometrics": 0
66
+ },
67
+ "strongbox_available": false,
68
+ "verified_boot": false,
69
+ "dm_verity_enabled": false
70
+ },
71
+ "system_integrity": {
72
+ "selinux_enforcing": true,
73
+ "verified_boot_state": "green",
74
+ "bootloader_locked": true,
75
+ "system_partition_verified": true,
76
+ "vendor_partition_verified": true,
77
+ "build_tags": {
78
+ "secure": true,
79
+ "tags": [
80
+ "release-keys"
81
+ ],
82
+ "has_release_keys": true,
83
+ "has_test_keys": false,
84
+ "has_debug_keys": false
85
+ },
86
+ "adb_enabled": false,
87
+ "developer_options_enabled": false
88
+ }
89
+ },
90
+ "recommendations": [],
91
+ "execution_time": 0.054442
92
+ },
93
+ {
94
+ "test_name": "Cross-Platform Security Analysis",
95
+ "platform": "cross_platform",
96
+ "status": "PASSED",
97
+ "risk_score": 0,
98
+ "risk_factors": [],
99
+ "details": {
100
+ "network_security": {
101
+ "proxy_enabled": false,
102
+ "vpn_active": false,
103
+ "custom_certificates": 0,
104
+ "tls_version": "1.3"
105
+ }
106
+ },
107
+ "recommendations": [],
108
+ "execution_time": 0.054453
109
+ }
110
+ ],
111
+ "summary": {
112
+ "total_tests": 2,
113
+ "passed": 2,
114
+ "failed": 0,
115
+ "warnings": 0,
116
+ "success_rate": 100.0,
117
+ "max_risk_score": 18,
118
+ "overall_status": "SECURE",
119
+ "total_risk_factors": 2,
120
+ "critical_risk_factors": [],
121
+ "execution_time": 0.054473
122
+ },
123
+ "artifacts": []
124
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
3
+ "version": "2.1.0",
4
+ "runs": [
5
+ {
6
+ "tool": {
7
+ "driver": {
8
+ "name": "AI Root Shield",
9
+ "version": "0.5.0",
10
+ "informationUri": "https://github.com/ahmetxhero/ai-root-shield"
11
+ }
12
+ },
13
+ "results": []
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,3 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <testsuites name="AI Root Shield Security Tests" tests="2" failures="0" time="0.054473">
3
+ </testsuites>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ai_root_shield
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ahmet KAHRAMAN
@@ -169,7 +169,12 @@ files:
169
169
  - LICENSE
170
170
  - README.md
171
171
  - Rakefile
172
+ - bindings/python/README.md
173
+ - bindings/python/ai_root_shield.py
174
+ - bindings/python/setup.py
175
+ - examples/device_logs/android_safetynet_device.json
172
176
  - examples/device_logs/clean_device.json
177
+ - examples/device_logs/ios_jailbroken_device.json
173
178
  - examples/device_logs/rooted_android.json
174
179
  - examples/policies/banking_policy.json
175
180
  - examples/policies/development_policy.json
@@ -184,13 +189,27 @@ files:
184
189
  - lib/ai_root_shield/analyzers/network_analyzer.rb
185
190
  - lib/ai_root_shield/analyzers/root_detector.rb
186
191
  - lib/ai_root_shield/certificate_pinning_helper.rb
192
+ - lib/ai_root_shield/ci_cd/security_test_module.rb
193
+ - lib/ai_root_shield/dashboard/web_dashboard.rb
187
194
  - lib/ai_root_shield/detector.rb
188
195
  - lib/ai_root_shield/device_log_parser.rb
196
+ - lib/ai_root_shield/enterprise/alert_system.rb
197
+ - lib/ai_root_shield/enterprise/hybrid_detection_engine.rb
198
+ - lib/ai_root_shield/enterprise/performance_optimizer.rb
199
+ - lib/ai_root_shield/enterprise/policy_manager.rb
189
200
  - lib/ai_root_shield/enterprise_policy_manager.rb
201
+ - lib/ai_root_shield/integrations/siem_connector.rb
202
+ - lib/ai_root_shield/platform/android_security_module.rb
203
+ - lib/ai_root_shield/platform/hardware_security_analyzer.rb
204
+ - lib/ai_root_shield/platform/ios_security_module.rb
205
+ - lib/ai_root_shield/platform/unified_report_generator.rb
190
206
  - lib/ai_root_shield/rasp_protection.rb
191
207
  - lib/ai_root_shield/risk_calculator.rb
192
208
  - lib/ai_root_shield/version.rb
193
209
  - models/README.md
210
+ - security_test_artifacts/security_report.json
211
+ - security_test_artifacts/security_results.sarif
212
+ - security_test_artifacts/security_tests.xml
194
213
  homepage: https://github.com/ahmetxhero/ai-root-shield
195
214
  licenses:
196
215
  - MIT