freerasp-react-native 2.0.0 → 2.0.2

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 (2) hide show
  1. package/README.md +108 -10
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -16,12 +16,18 @@ freeRASP for React Native is a mobile in-app protection and security monitoring
16
16
  - [Step 2: Set up the dependencies](#step-2-set-up-the-dependencies)
17
17
  - [Step 3: Import freeRASP into the app](#step-3-import-freerasp-into-the-app)
18
18
  - [Step 4: Setup the configuration, callbacks and initialize freeRASP](#step-4-setup-the-configuration-callbacks-and-initialize-freerasp)
19
+ - [Configuration](#configuration)
20
+ - [Dev vs Release version](#dev-vs-release-version)
21
+ - [Callbacks](#callbacks)
22
+ - [Initialization](#initialization)
23
+ - [Alternative: Initialize freeRASP in a Class component](#alternative-initialize-freerasp-in-a-class-component)
19
24
  - [Step 5: Additional note about obfuscation](#step-5-additional-note-about-obfuscation)
20
25
  - [Step 6: User Data Policies](#step-6-user-data-policies)
21
26
  - [Security Report](#security-report)
22
- - [Enterprise Services](#bar_chart-enterprise-services)
23
- - [Commercial version](#commercial-version)
27
+ - [Commercial versions (RASP+ and more)](#bar_chart-commercial-versions-rasp-and-more)
24
28
  - [Plans Comparison](#plans-comparison)
29
+ - [About Us](#about-us)
30
+ - [License](#license)
25
31
 
26
32
  # Overview
27
33
 
@@ -60,14 +66,14 @@ Learn more about freemium freeRASP features at [GitHub main repository](https://
60
66
 
61
67
  # Requirements
62
68
 
63
- Following minimal version requirements has to be met
69
+ Following minimal version requirements have to be met
64
70
  in order to run freeRASP in your app:
65
71
 
66
72
  - `react-native` >= `0.65.3`
67
73
 
68
74
  # Usage
69
75
 
70
- We will guide you step-by-step, but you can always check the expected result in the example.
76
+ We will guide you step-by-step, but you can always check the expected result in the example folder.
71
77
 
72
78
  ## (Optional) Create a new React Native demo application
73
79
 
@@ -77,11 +83,11 @@ Create a new React Native project:
77
83
 
78
84
  ## Step 1: Install the plugin
79
85
 
80
- $ npm install https://github.com/talsec/Free-RASP-ReactNative.git
86
+ $ npm install freerasp-react-native
81
87
 
82
88
  or
83
89
 
84
- $ yarn add https://github.com/talsec/Free-RASP-ReactNative.git
90
+ $ yarn add freerasp-react-native
85
91
 
86
92
  ## Step 2: Set up the dependencies
87
93
 
@@ -95,9 +101,20 @@ freeRASP React Native plugin uses Pods. Navigate to the `ios` folder and run:
95
101
 
96
102
  $ pod install
97
103
 
104
+ **IMPORTANT:** If you are upgrading from a previous version of freeRASP, please remove the old TalsecRuntime.xcframework and integration script from your project:
105
+
106
+ 1. Open up the **.xcworkspace** file
107
+ 1. Go to **Target -> Build Phases -> Link Binary With Libraries**
108
+ 1. Remove **TalsecRuntime.xcframework**
109
+ 1. On top bar select **Product -> Scheme -> Edit Scheme...**
110
+ 1. On the left side select **Build -> Pre-actions**
111
+ 1. Find integration script and click trash icon on the right side to remove it
112
+ 1. Update freeRASP. If you are getting any errors, check that in `node_modules/freerasp-react-native/ios`, TalsecRuntime.xcframework is a folder, not a symlink. If it is a symlink, remove it and reinstall the module.
113
+ 1. run `pod install`
114
+
98
115
  ## Step 3: Import freeRASP into the app
99
116
 
100
- We provide a custom hook that handles all required logic as registration of freeRASP, mounting and unmounting of listeners for you. Import the hook into your app:
117
+ We provide a React Custom Hook that handles all required logic as registration of freeRASP, mounting and unmounting of listeners for you. Import the Hook into your app:
101
118
 
102
119
  ```ts
103
120
  import { useFreeRasp } from 'freerasp-react-native';
@@ -213,10 +230,46 @@ const actions = {
213
230
  useFreeRasp(config, actions);
214
231
  ```
215
232
 
233
+ _Please note that useFreeRasp Hook should be called outside useEffect._
234
+
216
235
  When freeRASP initializes correctly, you should see `freeRASP initialized` message in logs. Otherwise, you'll see warning with description of what went wrong.
217
236
 
218
237
  _You can override this default behavior by extending the `actions` object with `started` key (to change action after successful initialization), and `initializationError` key (to set up action after unsuccessful initialization)_
219
238
 
239
+ ### Alternative: Initialize freeRASP in a Class component
240
+
241
+ - import methods from the freeRASP plugin:
242
+
243
+ ```ts
244
+ import {
245
+ talsecStart,
246
+ setThreatListeners,
247
+ removeThreatListeners,
248
+ } from 'freerasp-react-native';
249
+ ```
250
+
251
+ - override `constructor()` method in the entry point to your app, set listeners to threats and start freeRASP:
252
+
253
+ ```ts
254
+ constructor(props) {
255
+ super(props);
256
+
257
+ // Add these method calls
258
+ setThreatListeners(actions);
259
+ talsecStart(config);
260
+ }
261
+ ```
262
+
263
+ _In this code snippet, `actions` is object with your reactions to threats and `config` is freeRASP configuration object from previous parts of the readme._
264
+
265
+ - override `componentWillUnmount()` method where you clean up the listeners:
266
+
267
+ ```ts
268
+ componentWillUnmount() {
269
+ removeThreatListeners();
270
+ }
271
+ ```
272
+
220
273
  ## Step 5: Additional note about obfuscation
221
274
 
222
275
  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 for freeRASP to be as effective as possible, it is highly recommended to apply obfuscation to the final package/application, 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.
@@ -246,6 +299,8 @@ android {
246
299
 
247
300
  ## Step 6: User Data Policies
248
301
 
302
+ See the generic info about freeRASP data collection [here](https://github.com/talsec/Free-RASP-Community/tree/master#data-collection-processing-and-gdpr-compliance).
303
+
249
304
  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.
250
305
 
251
306
  Apple has a [similar approach](https://developer.apple.com/app-store/app-privacy-details/) and specifies the types of collected data.
@@ -265,6 +320,36 @@ If you encounter any other issues, you can see the list of solved issues [here](
265
320
  - In `package.json`, update `react-native` to a higher patch version and run `npm install` (or `yarn install`).
266
321
  - [See this issue to find out which patch version is relevant for you.](https://github.com/facebook/react-native/issues/35210)
267
322
 
323
+ ### `Invalid hook call. Hooks can only be called inside of the body of a function component.`
324
+
325
+ **Reason:**
326
+ The `useFreeRasp` Hook cannot be called inside useEffect.
327
+
328
+ **Solution:**
329
+
330
+ - If you want to initialize freeRASP inside useEffect, you have to handle the initialization on your own. Such inititialization would look like this:
331
+
332
+ ```ts
333
+ import {
334
+ setThreatListeners,
335
+ talsecStart,
336
+ removeThreatListeners,
337
+ } from 'freerasp-react-native';
338
+
339
+ ...
340
+
341
+ useEffect(() => {
342
+ setThreatListeners(actions);
343
+ talsecStart(config);
344
+
345
+ return () => {
346
+ removeThreatListeners();
347
+ };
348
+ }, []);
349
+ ```
350
+
351
+ Where `actions`, `config` are objects described in previous chapters.
352
+
268
353
  # Security Report
269
354
 
270
355
  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.
@@ -275,12 +360,10 @@ To receive Security Reports, fill out the _watcherMail_ field in [config](#confi
275
360
 
276
361
  ![dashboard](https://raw.githubusercontent.com/talsec/Free-RASP-Community/master/visuals/dashboard.png)
277
362
 
278
- # :bar_chart: Enterprise Services
363
+ # :bar_chart: Commercial versions (RASP+ and more)
279
364
 
280
365
  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).
281
366
 
282
- ## Commercial version
283
-
284
367
  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.
285
368
 
286
369
  It allows easy to implement API protection and App Integrity verification on the backend to prevent API abuse:
@@ -298,6 +381,11 @@ Learn more about commercial features at [https://talsec.app](https://talsec.app/
298
381
 
299
382
  ## Plans Comparison
300
383
 
384
+ <i>
385
+ 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
386
+ </i>
387
+ <br/>
388
+ <br/>
301
389
  <table>
302
390
  <thead>
303
391
  <tr>
@@ -421,3 +509,13 @@ Learn more about commercial features at [https://talsec.app](https://talsec.app/
421
509
  </table>
422
510
 
423
511
  For further comparison details (and planned features), follow our [discussion](https://github.com/talsec/Free-RASP-Community/discussions/5).
512
+
513
+ # About Us
514
+
515
+ 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.
516
+
517
+ 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).
518
+
519
+ # License
520
+
521
+ 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "freerasp-react-native",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "React Native plugin for improving app security and threat monitoring on Android and iOS mobile devices.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",