capacitor-freerasp 1.4.0 → 1.5.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.
Files changed (55) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +20 -384
  3. package/android/build.gradle +1 -1
  4. package/android/src/main/java/com/aheaditec/freerasp/FreeraspPlugin.kt +12 -27
  5. package/android/src/main/java/com/aheaditec/freerasp/ThreatHandler.kt +3 -0
  6. package/android/src/main/java/com/aheaditec/freerasp/Utils.kt +22 -0
  7. package/dist/esm/index.d.ts +1 -1
  8. package/dist/esm/index.js +8 -3
  9. package/dist/esm/index.js.map +1 -1
  10. package/dist/plugin.cjs.js +8 -3
  11. package/dist/plugin.cjs.js.map +1 -1
  12. package/dist/plugin.js +8 -3
  13. package/dist/plugin.js.map +1 -1
  14. package/ios/Plugin/FreeraspPlugin.swift +1 -1
  15. package/ios/Plugin/TalsecRuntime.xcframework/Info.plist +9 -5
  16. package/ios/Plugin/TalsecRuntime.xcframework/_CodeSignature/CodeDirectory +0 -0
  17. package/ios/Plugin/TalsecRuntime.xcframework/_CodeSignature/CodeRequirements-1 +0 -0
  18. package/ios/Plugin/TalsecRuntime.xcframework/_CodeSignature/CodeResources +105 -105
  19. package/ios/Plugin/TalsecRuntime.xcframework/_CodeSignature/CodeSignature +0 -0
  20. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CurlWrapper.h +1 -1
  21. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +22 -5
  22. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curl.h +57 -43
  23. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curlver.h +4 -4
  24. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/mprintf.h +13 -5
  25. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/multi.h +18 -4
  26. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/options.h +1 -1
  27. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/system.h +1 -11
  28. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/urlapi.h +5 -1
  29. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Info.plist +0 -0
  30. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.abi.json +217 -2204
  31. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.private.swiftinterface +3 -3
  32. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  33. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftinterface +3 -3
  34. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/TalsecRuntime +0 -0
  35. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CurlWrapper.h +1 -1
  36. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +44 -10
  37. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curl.h +57 -43
  38. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curlver.h +4 -4
  39. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/mprintf.h +13 -5
  40. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/multi.h +18 -4
  41. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/options.h +1 -1
  42. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/system.h +1 -11
  43. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/urlapi.h +5 -1
  44. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Info.plist +0 -0
  45. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.abi.json +220 -2186
  46. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +3 -3
  47. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  48. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftinterface +3 -3
  49. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.abi.json +220 -2186
  50. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +3 -3
  51. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  52. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +3 -3
  53. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/TalsecRuntime +0 -0
  54. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/_CodeSignature/CodeResources +39 -39
  55. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,60 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ # [1.5.0] - 2024-09-25
9
+
10
+ - Android SDK version: 11.1.0
11
+ - iOS SDK version: 6.6.0
12
+
13
+ ### Capacitor
14
+
15
+ #### Changed
16
+
17
+ - Improved error messages when validation of the freeRASP configuration fails
18
+
19
+ ### Android
20
+
21
+ #### Added
22
+
23
+ - Added the auditing of the internal execution for the future check optimization and overall security improvements.
24
+
25
+ #### Fixed
26
+
27
+ - Fixed native crashes (SEGFAULT errors) in `ifpip` method
28
+ - Fixed collision for command line tools (like ping) invoked without absolute path
29
+
30
+ #### Changed
31
+
32
+ - ❗️Breaking: Changed the way TalsecConfig is created, we introduced a Builder pattern to make the process more streamlined and readable
33
+ - Updated OpenSSL to version 3.0.14
34
+ - Updated CURL to version 8.8.0
35
+ - Refactored fetching the list of installed applications for root and hook detection.
36
+
37
+ ### iOS
38
+
39
+ #### Added
40
+
41
+ - [Dopamine](https://github.com/opa334/Dopamine) jailbreak detection.
42
+ - Enhanced and accelerated the data collection logic
43
+
44
+ #### Changed
45
+
46
+ - Updated OpenSSL to version 3.0.14
47
+ - Updated CURL to version 8.8.0
48
+
49
+ ## [1.4.1] - 2024-07-02
50
+
51
+ ### Capacitor
52
+
53
+ #### Changed
54
+ - CHANGELOG now adheres to the [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) format.
55
+
56
+ ## [1.4.0] - 2024-05-31
57
+
1
58
  # freeRASP 1.4.0
2
59
 
3
60
  - ⚡ Added new threat `systemVPN` for VPN detection
package/README.md CHANGED
@@ -8,24 +8,8 @@
8
8
 
9
9
  freeRASP for Capacitor is a mobile in-app protection and security monitoring plugin. It aims to cover the main aspects of RASP (Runtime App Self Protection) and application shielding.
10
10
 
11
- # :notebook_with_decorative_cover: Table of contents
12
-
13
- - [Overview](#overview)
14
- - [Usage](#usage)
15
- - [Step 1: Install the plugin](#step-1-install-the-plugin)
16
- - [Step 2: Set up the dependencies](#step-2-set-up-the-dependencies)
17
- - [Step 3: Setup the configuration, callbacks and initialize freeRASP](#step-3-setup-the-configuration-callbacks-and-initialize-freerasp)
18
- - [Configuration](#configuration)
19
- - [Dev vs Release version](#dev-vs-release-version)
20
- - [Callbacks](#callbacks)
21
- - [Initialization](#initialization)
22
- - [Step 4: Additional note about obfuscation](#step-4-additional-note-about-obfuscation)
23
- - [Step 5: User Data Policies](#step-5-user-data-policies)
24
- - [Security Report](#security-report)
25
- - [Commercial versions (RASP+ and more)](#bar_chart-commercial-versions-rasp-and-more)
26
- - [Plans Comparison](#plans-comparison)
27
- - [About Us](#about-us)
28
- - [License](#license)
11
+ :loudspeaker: The official documentation has been moved to a new location. You can now find it [here](https://docs.talsec.app/docs-and-articles-portal). :loudspeaker:
12
+
29
13
 
30
14
  # Overview
31
15
 
@@ -40,12 +24,12 @@ freeRASP plugin is designed to combat
40
24
 
41
25
  Key features are the detection and prevention of
42
26
 
43
- - Root/Jailbreak (e.g., unc0ver, check1rain)
27
+ - Root/Jailbreak (e.g., su, Magisk, unc0ver, check1rain, Dopamine)
44
28
  - Hooking framework (e.g., Frida, Shadow)
45
29
  - Untrusted installation method
46
30
  - App/Device (un)binding
47
31
 
48
- Additional freeRASP features include low latency, easy integration and a weekly [Security Report](#security-report) containing detailed information about detected incidents and potential threats, summarizing the state of your app security.
32
+ Additional freeRASP features include low latency, easy integration and a weekly [Security Report](https://docs.talsec.app/freerasp/security-report) containing detailed information about detected incidents and potential threats, summarizing the state of your app security.
49
33
 
50
34
  The commercial version provides a top-notch protection level, extra features, support and maintenance. One of the most valued commercial features is AppiCrypt® - App Integrity Cryptogram.
51
35
 
@@ -62,382 +46,34 @@ Learn more about commercial features at [https://talsec.app](https://talsec.app)
62
46
 
63
47
  Learn more about freemium freeRASP features at [GitHub main repository](https://github.com/talsec/Free-RASP-Community).
64
48
 
65
- # Usage
49
+ # :book: Discover the Official freeRASP Documentation
66
50
 
67
- We will guide you step-by-step, but you can always check the expected result in the example folder.
51
+ Visit the [GitBook page](https://docs.talsec.app/freerasp) for comprehensive and up-to-date guides, tutorials, and technical documentation specifically for freeRASP. It serves as your go-to resource, offering everything from basic instructions to advanced tips and tricks to help you get the most out of the project.
68
52
 
69
- ## Step 1: Install the plugin
53
+ ## :link: Integration Guide
70
54
 
71
- $ npm install capacitor-freerasp
72
- $ npx cap sync
55
+ For integrating freeRASP on the Capacitor platform, be sure to follow all the steps in the [Integration Guide](https://docs.talsec.app/freerasp/integration). This guide provides detailed instructions to help you achieve a smooth and efficient integration.
73
56
 
74
- ## Step 2: Set up the dependencies
75
-
76
- ### Android
77
-
78
- freeRASP for Android requires a **minSdkVersion** level of **>=23** and a **targetSdkVersion** level of **>=33**. Some Capacitor projects, by default, support even lower levels of minimum and target SDKs. This creates an inconsistency we must solve by updating the SDK levels of the application:
79
-
80
- 1. From the root of your project, go to **android > variables.gradle** (or equivalent).
81
- 1. In **ext**, update **minSdkVersion** to at least **23** (Android 6.0) or higher and **compileSdkVersion** to **33** (Android 13).
82
-
83
- ```groovy
84
- ext {
85
- minSdkVersion 23
86
- compileSdkVersion 33
87
- ...
88
- }
89
- ```
90
-
91
- ## Step 3: Setup the configuration, callbacks and initialize freeRASP
92
-
93
- ### Import freeRASP
94
-
95
- You should add freeRASP in the entry point to your app, which is usually `App.tsx` for React or `main.ts` for Vue or Angular projects.
96
-
97
- ```ts
98
- import { startFreeRASP } from 'capacitor-freerasp';
99
- ```
100
-
101
- ### Configuration
102
-
103
- You need to provide configuration for freeRASP to work properly and initialize it. The freeRASP configuration is an JavaScript object that contains configs for both Android and iOS, as well as common configuration. You must fill all the required values for the plugin to work. Use the following template to provide configuration to the Talsec plugin. You can find detailed description of the configuration below.
104
-
105
- ```ts
106
- // app configuration
107
- const config = {
108
- androidConfig: {
109
- packageName: 'com.capacitor.example',
110
- certificateHashes: ['yourSigningCertificateHashBase64'],
111
- supportedAlternativeStores: ['com.sec.android.app.samsungapps'],
112
- },
113
- iosConfig: {
114
- appBundleId: 'com.capacitor.example',
115
- appTeamId: 'yourTeamID',
116
- },
117
- watcherMail: 'yourEmailAddress@example.com',
118
- isProd: true,
119
- };
120
- ```
121
-
122
- #### The configuration object should consist of:
123
-
124
- 1. `androidConfig` _: object | undefined_ - required for Android devices, has following keys:
125
-
126
- - `packageName` _: string_ - package name of your app you chose when you created it
127
- - `certificateHashes` _: string[]_ - hash of the certificate of the key which was used to sign the application. **Hash which is passed here must be encoded in Base64 form.** If you are not sure how to get your certificate hash, you can check out the guide on our [Github wiki](https://github.com/talsec/Free-RASP-Community/wiki/Getting-your-signing-certificate-hash-of-app). Multiple hashes are supported, e.g. if you are using a different one for the Huawei App Gallery.
128
- - `supportedAlternativeStores` _: string[] | undefined_ - Google Play Store and Huawei AppGallery are supported out of the box, you **don't have to assign anything**. You can add other stores like the Samsung Galaxy Store in the example code (`com.sec.android.app.samsungapps`). For more information, visit the [Detecting Unofficial Installation](https://github.com/talsec/Free-RASP-Community/wiki/Threat-detection#detecting-unofficial-installation) wiki page.
129
-
130
- 1. `iosConfig` _: object | undefined_ - required for iOS devices, has following keys:
131
- - `appBundleId` _: string_ - Bundle ID of your app
132
- - `appTeamId` _: string_ - the Apple Team ID
133
- 1. `watcherMail` _: string_ - your mail address where you wish to receive reports. Mail has a strict form `name@domain.com` which is passed as String.
134
- 1. `isProd` _: boolean | undefined_ - defaults to `true` when undefined. If you want to use the Dev version to disable checks described [in the chapter below](#dev-vs-release-version), set the parameter to `false`. Make sure that you have the Release version in the production (i.e. isProd set to true)!
135
-
136
- If you are developing only for one of the platforms, you can skip the configuration part for the other one, i.e., delete the unused configuration.
137
-
138
- #### Dev vs Release version
139
-
140
- The Dev version is used to not complicate the development process of the application, e.g. if you would implement killing of the application on the debugger callback. It disables some checks which won't be triggered during the development process:
141
-
142
- - Emulator-usage (simulator)
143
- - Debugging (debug)
144
- - Signing (appIntegrity)
145
- - Unofficial store (unofficialStore)
146
-
147
- ### Callbacks
148
-
149
- freeRASP executes periodical checks when the application is running. Handle the detected threats in the **listeners**. For example, you can log the event, show a window to the user or kill the application. [Visit our wiki](https://github.com/talsec/Free-RASP-Community/wiki/Threat-detection) to learn more details about the performed checks and their importance for app security.
150
-
151
- ```ts
152
- // reactions for detected threats
153
- const actions = {
154
- // Android & iOS
155
- privilegedAccess: () => {
156
- console.log('privilegedAccess');
157
- },
158
- // Android & iOS
159
- debug: () => {
160
- console.log('debug');
161
- },
162
- // Android & iOS
163
- simulator: () => {
164
- console.log('simulator');
165
- },
166
- // Android & iOS
167
- appIntegrity: () => {
168
- console.log('appIntegrity');
169
- },
170
- // Android & iOS
171
- unofficialStore: () => {
172
- console.log('unofficialStore');
173
- },
174
- // Android & iOS
175
- hooks: () => {
176
- console.log('hooks');
177
- },
178
- // Android & iOS
179
- deviceBinding: () => {
180
- console.log('deviceBinding');
181
- },
182
- // Android & iOS
183
- secureHardwareNotAvailable: () => {
184
- console.log('secureHardwareNotAvailable');
185
- },
186
- // Android & iOS
187
- systemVPN: () => {
188
- console.log('systemVPN');
189
- },
190
- // Android & iOS
191
- passcode: () => {
192
- console.log('passcode');
193
- },
194
- // iOS only
195
- deviceID: () => {
196
- console.log('deviceID');
197
- },
198
- // Android only
199
- obfuscationIssues: () => {
200
- console.log('obfuscationIssues');
201
- },
202
- // Android only
203
- devMode: () => {
204
- console.log('devMode');
205
- },
206
- };
207
- ```
208
-
209
- ### Initialization
210
-
211
- Provide the configuration and reactions to threats you set up in previous steps.
212
-
213
- ```ts
214
- // returns `true` if freeRASP starts successfully; you can ignore this value
215
- const started = await startFreeRASP(config, actions);
216
- ```
217
-
218
- Based on your framework, we recommend:
219
-
220
- - In **React**: Wrap this function in `useEffect` with empty dependency array
221
- - In **Vue**: Call the method inside the `mounted` property
222
- - In **Angular**: Call the method inside the `ngOnInit` method
223
-
224
- ## Step 4: Additional note about obfuscation
225
-
226
- The freeRASP contains public API, so the integration process is as simple as possible. Unfortunately, this public API also creates opportunities for the attacker to use publicly available information to interrupt freeRASP operations or modify your custom reaction implementation in threat callbacks. In order to provide as much protection as possible, freeRASP obfuscates its source code. However, if all other code is not obfuscated, one can easily deduct that the obfuscated code belongs to a security library. We, therefore, encourage you to apply code obfuscation to your app, making the public API more difficult to find and also partially randomized for each application so it cannot be automatically abused by generic hooking scripts.
227
-
228
- Probably the easiest way to obfuscate your app is via code minification, a technique that reduces the size of the compiled code by removing unnecessary characters, whitespace, and renaming variables and functions to shorter names. It can be configured for Android devices in **android/app/build.gradle** like so:
229
-
230
- ```groovy
231
- android {
232
- buildTypes {
233
- release {
234
- ...
235
- minifyEnabled true
236
- shrinkResources true
237
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
238
- }
239
- }
240
- }
241
- ```
242
-
243
- Please note that some other modules in your app may rely on reflection, therefore it may be necessary to add corresponding keep rules into `proguard-rules.pro` file.
244
-
245
- If there is a problem with the obfuscation, freeRASP will notify you about it via `obfuscationIssues` callback.
246
-
247
- You can read more about Android obfuscation in the official documentation:
248
-
249
- - https://developer.android.com/studio/build/shrink-code
250
- - https://www.guardsquare.com/manual/configuration/usage
251
-
252
- ## Step 5: User Data Policies
253
-
254
- See the generic info about freeRASP data collection [here](https://github.com/talsec/Free-RASP-Community/tree/master#data-collection-processing-and-gdpr-compliance).
255
-
256
- Google Play [requires](https://support.google.com/googleplay/android-developer/answer/10787469?hl=en) all app publishers to declare how they collect and handle user data for the apps they publish on Google Play. They should inform users properly of the data collected by the apps and how the data is shared and processed. Therefore, Google will reject the apps which do not comply with the policy.
257
-
258
- Apple has a [similar approach](https://developer.apple.com/app-store/app-privacy-details/) and specifies the types of collected data.
259
-
260
- You should also visit our [Android](https://github.com/talsec/Free-RASP-Android) and [iOS](https://github.com/talsec/Free-RASP-iOS) submodules to learn more about their respective data policies.
261
-
262
- And you're done 🎉!
263
-
264
- # Security Report
57
+ Be sure to bookmark it and stay informed! :books: :sparkles:.
265
58
 
266
- The Security Report is a weekly summary describing the application's security state and characteristics of the devices it runs on in a practical and easy-to-understand way.
59
+ ## :scroll: Reference to Legacy Documentation
267
60
 
268
- The report provides a quick overview of the security incidents, their dynamics, app integrity, and reverse engineering attempts. It contains info about the security of devices, such as OS version or the ratio of devices with screen locks and biometrics. Each visualization also comes with a concise explanation.
61
+ If you have any suggestions for improvement or notice anything that could be clarified in the new GitBook documentation, please open an issue. Your feedback helps us maintain high-quality resources for all users.
269
62
 
270
- To receive Security Reports, fill out the _watcherMail_ field in [config](#configuration).
63
+ For information on older integration methods, you can refer to the [freeRASP wiki](https://github.com/talsec/Free-RASP-Capacitor/wiki), which includes comprehensive legacy details and guidance. Additionally, the old integration can be found when you checkout to a specific tag. Your input is invaluable in helping us improve our resources and provide even better support for your needs.
271
64
 
272
- ![dashboard](https://raw.githubusercontent.com/talsec/Free-RASP-Community/master/visuals/dashboard.png)
65
+ # :rocket: What's New and Changelog
273
66
 
274
- # :bar_chart: Commercial versions (RASP+ and more)
67
+ Stay informed and make the most of freeRASP by checking out [What's New and Changelog](https://docs.talsec.app/freerasp/whats-new-and-changelog)! Here, you’ll discover the latest features, enhancements, and bug fixes we’ve implemented to improve your experience across all platforms, including Android, iOS, Flutter, React Native, Capacitor, and Cordova.
275
68
 
276
- We provide app security hardening SDK: i.e. AppiCrypt®, Customer Data Encryption (local storage), End-to-end encryption, Strings protection (e.g. API keys) and Dynamic Certificate Pinning to our commercial customers as well. To get the most advanced protection compliant with PSD2 RT and eIDAS and support from our experts, contact us at [talsec.app](https://talsec.app).
69
+ Don’t miss out on any updates and explore the changelog to see how we’re continually making freeRASP better for you!
277
70
 
278
- The commercial version provides a top-notch protection level, extra features, support, and maintenance. One of the most valued commercial features is [AppiCrypt®](https://www.talsec.app/appicrypt) - App Integrity Cryptogram.
71
+ # :sparkles: Enhancements
279
72
 
280
- It allows easy to implement API protection and App Integrity verification on the backend to prevent API abuse:
73
+ If you have any ideas for improvements, feel free to [raise an issue](https://github.com/talsec/Free-RASP-Capacitor/issues) and mark it with an **enhancement** label. We track these enhancements using [GitHub Projects](https://docs.github.com/en/issues/planning-and-tracking-with-projects/learning-about-projects/about-projects) to keep tasks organized and connected to relevant issues or pull requests.
281
74
 
282
- - Bruteforce attacks
283
- - Botnets
284
- - Session-hijacking
285
- - DDoS
75
+ You can check out the project board [here](https://github.com/orgs/talsec/projects/2).
286
76
 
287
- It is a unified solution that works across all mobile platforms without dependency on external web services (i.e., without extra latency, an additional point of failure, and maintenance costs).
77
+ # :page_facing_up: License
288
78
 
289
- Learn more about commercial features at [https://talsec.app](https://talsec.app/).
290
-
291
- **TIP:** You can try freeRASP and then upgrade easily to an enterprise service.
292
-
293
- ## Plans Comparison
294
-
295
- <i>
296
- freeRASP is freemium software i.e. there is a Fair Usage Policy (FUP) that impose some limitations on the free usage. See the FUP section in the table below
297
- </i>
298
- <br/>
299
- <br/>
300
- <table>
301
- <thead>
302
- <tr>
303
- <th></th>
304
- <th>freeRASP</th>
305
- <th>Business RASP+</th>
306
- </tr>
307
- </thead>
308
- <tbody>
309
- <tr>
310
- <td colspan=5><strong>Runtime App Self Protection (RASP, app shielding)</strong></td>
311
- </tr>
312
- <tr>
313
- <td>Advanced root/jailbreak protections (including Magisk)</td>
314
- <td>basic</td>
315
- <td>advanced</td>
316
- </tr>
317
- <tr>
318
- <td>Runtime reverse engineering controls
319
- <ul>
320
- <li>Debugger</li>
321
- <li>Emulator / Simulator</li>
322
- <li>Hooking and reversing frameworks (e.g. Frida, Magisk, XPosed, Cydia Substrate and more)</li>
323
- </ul>
324
- </td>
325
- <td>basic</td>
326
- <td>advanced</td>
327
- </tr>
328
- <tr>
329
- <td>Runtime integrity controls
330
- <ul>
331
- <li>Tampering protection</li>
332
- <li>Repackaging / Cloning protection</li>
333
- <li>Device binding protection</li>
334
- <li>Unofficial store detection</li>
335
- </ul>
336
- </td>
337
- <td>basic</td>
338
- <td>advanced</td>
339
- </tr>
340
- <tr>
341
- <td>Device OS security status check
342
- <ul>
343
- <li>HW security module control</li>
344
- <li>Screen lock control</li>
345
- <li>Google Play Services enabled/disabled</li>
346
- <li>Last security patch update</li>
347
- <li>System VPN control</li>
348
- <li>Developer mode control</li>
349
- </ul>
350
- </td>
351
- <td>yes</td>
352
- <td>yes</td>
353
- </tr>
354
- <tr>
355
- <td>UI protection
356
- <ul>
357
- <li>Overlay protection</li>
358
- <li>Accessibility services misuse protection</li>
359
- </ul>
360
- </td>
361
- <td>no</td>
362
- <td>yes</td>
363
- </tr>
364
- <tr>
365
- <td colspan=5><strong>Hardening suite</strong></td>
366
- </tr>
367
- <tr>
368
- <td>Security hardening suite
369
- <ul>
370
- <li>End-to-end encryption</li>
371
- <li>Strings protection (e.g. API keys)</li>
372
- <li>Dynamic TLS certificate pinning</li>
373
- </ul>
374
- </td>
375
- <td>no</td>
376
- <td>yes</td>
377
- </tr>
378
- <tr>
379
- <td colspan=5><strong>AppiCrypt® - App Integrity Cryptogram</strong></td>
380
- </tr>
381
- <tr>
382
- <td>API protection by mobile client integrity check, online risk scoring, online fraud prevention, client App integrity check. The cryptographic proof of app & device integrity.</td>
383
- <td>no</td>
384
- <td>yes</td>
385
- </tr>
386
- <tr>
387
- <td colspan=5><strong>Security events data collection, Auditing and Monitoring tools</strong></td>
388
- </tr>
389
- <tr>
390
- <td>Threat events data collection from SDK</td>
391
- <td>yes</td>
392
- <td>configurable</td>
393
- </tr>
394
- <tr>
395
- <td>AppSec regular email reporting service</td>
396
- <td>yes (up to 100k devices)</td>
397
- <td>yes</td>
398
- </tr>
399
- <tr>
400
- <td>UI portal for Logging, Data analytics and auditing</td>
401
- <td>no</td>
402
- <td>yes</td>
403
- </tr>
404
- <tr>
405
- <td colspan=5><strong>Support and Maintenance</strong></td>
406
- </tr>
407
- <tr>
408
- <td>SLA</td>
409
- <td>Not committed</td>
410
- <td>yes</td>
411
- </tr>
412
- <tr>
413
- <td>Maintenance updates</td>
414
- <td>Not committed</td>
415
- <td>yes</td>
416
- </tr>
417
- <tr>
418
- <td colspan=5><strong>Fair usage policy</strong></td>
419
- </tr>
420
- <tr>
421
- <td>Mentioning of the App name and logo in the marketing communications of Talsec (e.g. "Trusted by" section on the web).</td>
422
- <td>over 100k downloads</td>
423
- <td>no</td>
424
- </tr>
425
- <tr>
426
- <td>Threat signals data collection to Talsec database for processing and product improvement</td>
427
- <td>yes</td>
428
- <td>no</td>
429
- </tr>
430
- </tbody>
431
- </table>
432
-
433
- For further comparison details (and planned features), follow our [discussion](https://github.com/talsec/Free-RASP-Community/discussions/5).
434
-
435
- # About Us
436
-
437
- Talsec is an academic-based and community-driven mobile security company. We deliver in-App Protection and a User Safety suite for Fintechs. We aim to bridge the gaps between the user's perception of app safety and the strong security requirements of the financial industry.
438
-
439
- Talsec offers a wide range of security solutions, such as App and API protection SDK, Penetration testing, monitoring services, and the User Safety suite. You can check out offered products at [our web](https://www.talsec.app).
440
-
441
- # License
442
-
443
- This project is provided as freemium software i.e. there is a fair usage policy that impose some limitations on the free usage. The SDK software consists of opensource and binary part which is property of Talsec. The opensource part is licensed under the MIT License - see the [LICENSE](https://github.com/talsec/Free-RASP-Community/blob/master/LICENSE) file for details.
79
+ This project is provided as freemium software, i.e. there is a fair usage policy that imposes some limitations on the free usage. The SDK software consists of open-source and binary parts, which is the property of Talsec. The open-source part is licensed under the MIT License - see the LICENSE file for details.
@@ -71,5 +71,5 @@ dependencies {
71
71
  androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
72
72
  androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
73
73
 
74
- implementation 'com.aheaditec.talsec.security:TalsecSecurity-Community-Capacitor:9.6.0'
74
+ implementation 'com.aheaditec.talsec.security:TalsecSecurity-Community-Capacitor:11.1.0'
75
75
  }
@@ -26,12 +26,15 @@ class FreeraspPlugin : Plugin() {
26
26
  return
27
27
  }
28
28
  try {
29
- val talsecConfig = parseTalsecConfigThrowing(config)
29
+ val talsecConfig = buildTalsecConfigThrowing(config)
30
30
  listener.registerListener(context)
31
+ bridge.activity.runOnUiThread {
32
+ Talsec.start(context, talsecConfig)
33
+ }
31
34
  Talsec.start(context, talsecConfig)
32
35
  call.resolve(JSObject().put("started", true))
33
36
  } catch (e: Exception) {
34
- call.reject("Error during Talsec Native plugin initialization - ${e.message}", null, e)
37
+ call.reject("Error during Talsec Native plugin initialization - ${e.message}", "TalsecInitializationError", e)
35
38
  }
36
39
  }
37
40
 
@@ -86,34 +89,16 @@ class FreeraspPlugin : Plugin() {
86
89
  notifyListeners(THREAT_CHANNEL_NAME, JSObject().put(THREAT_CHANNEL_KEY, threat.value), true)
87
90
  }
88
91
 
89
- private fun parseTalsecConfigThrowing(configJson: JSObject): TalsecConfig {
92
+ private fun buildTalsecConfigThrowing(configJson: JSObject): TalsecConfig {
90
93
  val androidConfig = configJson.getJSONObject("androidConfig")
91
94
  val packageName = androidConfig.getString("packageName")
92
- val certificateHashes = mutableListOf<String>()
93
- val hashes = androidConfig.getJSONArray("certificateHashes")
94
- if (hashes.length() == 0) {
95
- throw IllegalArgumentException("At least 1 certificate hash is required.")
96
- }
97
- for (i in 0 until hashes.length()) {
98
- certificateHashes.add(hashes.getString(i))
99
- }
100
- val watcherMail = configJson.getString("watcherMail")
101
- val alternativeStores = mutableListOf<String>()
102
- if (androidConfig.has("supportedAlternativeStores")) {
103
- val stores = androidConfig.getJSONArray("supportedAlternativeStores")
104
- for (i in 0 until stores.length()) {
105
- alternativeStores.add(stores.getString(i))
106
- }
107
- }
108
- val isProd = configJson.getBool("isProd") ?: true
95
+ val certificateHashes = androidConfig.getArraySafe("certificateHashes")
96
+ val talsecBuilder = TalsecConfig.Builder(packageName, certificateHashes)
97
+ .watcherMail(configJson.getString("watcherMail"))
98
+ .supportedAlternativeStores(androidConfig.getArraySafe("supportedAlternativeStores"))
99
+ .prod(configJson.getBool("isProd") ?: true)
109
100
 
110
- return TalsecConfig(
111
- packageName,
112
- certificateHashes.toTypedArray(),
113
- watcherMail,
114
- alternativeStores.toTypedArray(),
115
- isProd
116
- )
101
+ return talsecBuilder.build()
117
102
  }
118
103
 
119
104
  companion object {
@@ -1,5 +1,6 @@
1
1
  package com.aheaditec.freerasp
2
2
 
3
+ import com.aheaditec.talsec_security.security.api.SuspiciousAppInfo
3
4
  import com.aheaditec.talsec_security.security.api.ThreatListener
4
5
 
5
6
  internal class TalsecThreatHandler(private val instance: FreeraspPlugin) :
@@ -37,6 +38,8 @@ internal class TalsecThreatHandler(private val instance: FreeraspPlugin) :
37
38
  instance.notifyListeners(Threat.ObfuscationIssues)
38
39
  }
39
40
 
41
+ override fun onMalwareDetected(p0: MutableList<SuspiciousAppInfo>?) {}
42
+
40
43
  override fun onUnlockedDeviceDetected() {
41
44
  instance.notifyListeners(Threat.Passcode)
42
45
  }
@@ -0,0 +1,22 @@
1
+ package com.aheaditec.freerasp
2
+
3
+ import org.json.JSONArray
4
+ import org.json.JSONObject
5
+
6
+ class Utils {}
7
+
8
+ internal fun JSONArray.toArray(): Array<String> {
9
+ val output = mutableListOf<String>()
10
+ for (i in 0 until this.length()) {
11
+ this.getString(i)?.let(output::add)
12
+ }
13
+ return output.toTypedArray()
14
+ }
15
+
16
+ internal fun JSONObject.getArraySafe(key: String): Array<String> {
17
+ if (this.has(key)) {
18
+ val inputArray = this.getJSONArray(key)
19
+ return inputArray.toArray()
20
+ }
21
+ return arrayOf()
22
+ }
@@ -2,6 +2,6 @@ import type { FreeraspPlugin, FreeraspConfig, NativeEventEmitterActions } from '
2
2
  declare const Freerasp: FreeraspPlugin;
3
3
  declare const setThreatListeners: <T extends NativeEventEmitterActions>(callbacks: T & Record<Exclude<keyof T, keyof NativeEventEmitterActions>, []>) => Promise<void>;
4
4
  declare const removeThreatListeners: () => void;
5
- declare const startFreeRASP: <T extends NativeEventEmitterActions>(config: FreeraspConfig, reactions: T & Record<Exclude<keyof T, keyof NativeEventEmitterActions>, []>) => Promise<boolean>;
5
+ declare const startFreeRASP: <T extends NativeEventEmitterActions>(config: FreeraspConfig, reactions: T & Record<Exclude<keyof T, keyof NativeEventEmitterActions>, []>) => Promise<boolean | undefined>;
6
6
  export * from './definitions';
7
7
  export { Freerasp, startFreeRASP, setThreatListeners, removeThreatListeners };
package/dist/esm/index.js CHANGED
@@ -84,12 +84,17 @@ const setThreatListeners = async (callbacks) => {
84
84
  });
85
85
  };
86
86
  const removeThreatListeners = () => {
87
- activeListeners.forEach((listener) => listener.remove());
87
+ activeListeners.forEach(listener => listener.remove());
88
88
  };
89
89
  const startFreeRASP = async (config, reactions) => {
90
90
  await setThreatListeners(reactions);
91
- const { started } = await Freerasp.talsecStart({ config });
92
- return started;
91
+ try {
92
+ const { started } = await Freerasp.talsecStart({ config });
93
+ return started;
94
+ }
95
+ catch (e) {
96
+ console.error(`${e.code}: ${e.message}`);
97
+ }
93
98
  };
94
99
  export * from './definitions';
95
100
  export { Freerasp, startFreeRASP, setThreatListeners, removeThreatListeners };