You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -96,86 +95,56 @@ freeRASP React Native plugin uses Pods. Navigate to the `ios` folder and run:
96
95
97
96
$ pod install
98
97
99
-
## Step 3: Dev vs Release version
98
+
## Step 3: Import freeRASP into the app
100
99
101
-
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:
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:
Which version of freeRASP is used is tied to the application's development stage - more precisely, how the application is compiled.
106
+
## Step 4: Setup the configuration, callbacks and initialize freeRASP
109
107
110
-
### Android
108
+
First, the configuration and callbacks will be explained. Then the [Initialization](#initialization) chapter shows the implementation.
111
109
112
-
Android implementation of the React Native plugin detects selected development stage and automatically applies the suitable version of the library.
110
+
### Configuration
113
111
114
-
-`npx react-native run-android` (debug) -> uses dev version of freeRASP
115
-
-`npx react-native run-android --variant release` (release) -> uses release version of freeRASP
112
+
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. If you are developing for just one platform, you can skip configuration of the other.
116
113
117
-
###iOS
114
+
#### Android configuration:
118
115
119
-
For the iOS implemtation, it's neccesary to add script into the Xcode environment, that automatically switches between the library dev/release versions according to selected development stage. Then, it is necessary to embedd a symlink to correct TalsecRuntime.xcframework.
120
-
121
-
1. Add pre-built script for changing the Debug and Release versions of the framework:
122
-
- Open up the **.xcworkspace** file
123
-
- Go to **Product** -> **Scheme** -> **Edit Scheme...** -> **Build (dropdown arrow)** -> **Pre-actions**
124
-
- Hit **+** and then **New Run Script Action**
125
-
- Set **Provide build setting from** to your application
- `npx react-native run-ios` (debug) -> uses dev version of freeRASP
148
-
- `npx react-native run-ios --configuration Release` (release) -> uses release version of freeRASP
149
-
150
-
## Step 4: Import freeRASP into the app
116
+
Create an object under `androidConfig` key with following entries:
151
117
152
-
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:
118
+
-`packageName`_: string_ - package name of your app you chose when you created it
119
+
-`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.
120
+
-`supportedAlternativeStores`_: string[] | undefined_ - If you publish on the Google Play Store and/or Huawei AppGallery, you **don't have to assign anything** there as those are supported out of the box.
153
121
154
-
```ts
155
-
import { useFreeRasp } from 'freerasp-react-native';
156
-
```
122
+
#### iOS configuration
157
123
158
-
## Step 5: Setup the configuration, callbacks and initialize freeRASP
124
+
Create an object under `iosConfig` key with following entries:
159
125
160
-
First, the configuration and callbacks will be explained. Then the **Initialization** chapter shows the implementation.
126
+
-`appBundleId`_: string_ - Bundle ID of your app
127
+
-`appTeamId`_: string_ - the Apple Team ID
161
128
162
-
### Configuration
129
+
#### Common configuration
163
130
164
-
You need to provide configuration forfreeRASP to work properly and initialize it. The freeRASP configuration contains configs forboth Android and iOS. You must fill all the required values for the plugin to work.
131
+
Lastly, set up common configuration for both iOS and Android:
165
132
166
-
For Android:
133
+
-`watcherMail`_: string_ - your mail address where you wish to receive reports. Mail has a strict form `[email protected]` which is passed as String.
134
+
-`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)!
167
135
168
-
- `packageName` - package name of your app you chose when you created it
169
-
- `certificateHashes` - 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.
170
-
- `supportedAlternativeStores` _(optional)_ - If you publish on the Google Play Store and/or Huawei AppGallery, you **don't have to assign anything** there as those are supported out of the box.
136
+
### Dev vs Release version
171
137
172
-
For iOS similarly to Android, `appBundleId` and `appTeamId` are required.
138
+
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:
173
139
174
-
Lastly, pass a mail address to `watcherMail` to be able to get reports. Mail has a strict form `[email protected]` which is passed as String.
140
+
- Emulator-usage (simulator)
141
+
- Debugging (debug)
142
+
- Signing (appIntegrity)
143
+
- Unofficial store (unofficialStore)
175
144
176
145
### Callbacks
177
146
178
-
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.
147
+
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.
179
148
180
149
### Initialization
181
150
@@ -249,9 +218,9 @@ useFreeRasp(config, actions);
249
218
250
219
When freeRASP initializes correctly, you should see `freeRASP initialized` message in logs. Otherwise, you'll see warning with description of what went wrong.
251
220
252
-
_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)_
221
+
_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)_
253
222
254
-
## Step 6: Additional note about obfuscation
223
+
## Step 5: Additional note about obfuscation
255
224
256
225
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.
257
226
@@ -278,7 +247,7 @@ android {
278
247
}
279
248
```
280
249
281
-
## Step 7: User Data Policies
250
+
## Step 6: User Data Policies
282
251
283
252
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.
Copy file name to clipboardExpand all lines: example/ios/FreeraspReactNativeExample.xcodeproj/xcshareddata/xcschemes/FreeraspReactNativeExample.xcscheme
0 commit comments