freerasp-react-native 1.1.0 → 2.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.
- package/README.md +85 -104
- package/android/build.gradle +8 -5
- package/android/src/main/java/com/freeraspreactnative/FreeraspReactNativeModule.kt +15 -3
- package/example/android/build.gradle +0 -3
- package/example/ios/FreeraspReactNativeExample.xcodeproj/project.pbxproj +4 -2
- package/example/ios/FreeraspReactNativeExample.xcodeproj/xcshareddata/xcschemes/FreeraspReactNativeExample.xcscheme +1 -19
- package/example/ios/Podfile.lock +1 -1
- package/example/src/App.tsx +12 -11
- package/freerasp-react-native.podspec +1 -1
- package/ios/FreeraspReactNative.swift +16 -11
- package/ios/{Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator → TalsecRuntime.xcframework/ios-arm64}/TalsecRuntime.framework/Headers/CurlWrapper.h +1 -1
- package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +1 -1
- package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Info.plist +0 -0
- package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftinterface +2 -1
- package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/TalsecRuntime +0 -0
- package/ios/{Release/TalsecRuntime.xcframework/ios-arm64 → TalsecRuntime.xcframework/ios-arm64_x86_64-simulator}/TalsecRuntime.framework/Headers/CurlWrapper.h +1 -1
- package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +2 -2
- package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Info.plist +0 -0
- package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftinterface +2 -1
- package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +2 -1
- package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/TalsecRuntime +0 -0
- package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/_CodeSignature/CodeResources +13 -13
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/index.d.ts +16 -15
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.tsx +16 -15
- package/ios/Debug/TalsecRuntime.xcframework/Info.plist +0 -40
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CurlWrapper.h +0 -25
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +0 -222
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Info.plist +0 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/TalsecRuntime +0 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +0 -450
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Info.plist +0 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftinterface +0 -51
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/TalsecRuntime +0 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +0 -14
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +0 -23
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curl.h +0 -3029
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curlver.h +0 -77
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/easy.h +0 -123
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/mprintf.h +0 -50
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/multi.h +0 -456
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/options.h +0 -68
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/stdcheaders.h +0 -33
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/system.h +0 -504
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/urlapi.h +0 -125
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftinterface +0 -51
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/module.modulemap +0 -17
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/cacert.pem +0 -3154
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/module.modulemap +0 -12
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +0 -14
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CurlWrapper.h +0 -25
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +0 -23
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curl.h +0 -3029
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curlver.h +0 -77
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/easy.h +0 -123
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/mprintf.h +0 -50
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/multi.h +0 -456
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/options.h +0 -68
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/stdcheaders.h +0 -33
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/system.h +0 -504
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/urlapi.h +0 -125
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +0 -51
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/module.modulemap +0 -17
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/_CodeSignature/CodeResources +0 -344
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/cacert.pem +0 -3154
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/module.modulemap +0 -12
- /package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/Info.plist +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/curl.h +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/curlver.h +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/easy.h +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/mprintf.h +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/multi.h +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/options.h +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/stdcheaders.h +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/system.h +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/urlapi.h +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Modules/module.modulemap +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/cacert.pem +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/module.modulemap +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curl.h +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curlver.h +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/easy.h +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/mprintf.h +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/multi.h +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/options.h +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/stdcheaders.h +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/system.h +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/urlapi.h +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/module.modulemap +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/cacert.pem +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/module.modulemap +0 -0
package/README.md
CHANGED
|
@@ -14,9 +14,9 @@ freeRASP for React Native is a mobile in-app protection and security monitoring
|
|
|
14
14
|
- [(Optional) Create a new React Native demo application](#optional-create-a-new-react-native-demo-application)
|
|
15
15
|
- [Step 1: Install the plugin](#step-1-install-the-plugin)
|
|
16
16
|
- [Step 2: Set up the dependencies](#step-2-set-up-the-dependencies)
|
|
17
|
-
- [Step 3:
|
|
18
|
-
- [Step 4:
|
|
19
|
-
- [Step 5:
|
|
17
|
+
- [Step 3: Import freeRASP into the app](#step-3-import-freerasp-into-the-app)
|
|
18
|
+
- [Step 4: Setup the configuration, callbacks and initialize freeRASP](#step-4-setup-the-configuration-callbacks-and-initialize-freerasp)
|
|
19
|
+
- [Step 5: Additional note about obfuscation](#step-5-additional-note-about-obfuscation)
|
|
20
20
|
- [Step 6: User Data Policies](#step-6-user-data-policies)
|
|
21
21
|
- [Security Report](#security-report)
|
|
22
22
|
- [Enterprise Services](#bar_chart-enterprise-services)
|
|
@@ -87,20 +87,7 @@ or
|
|
|
87
87
|
|
|
88
88
|
### Android
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
```gradle
|
|
93
|
-
allprojects {
|
|
94
|
-
repositories {
|
|
95
|
-
google()
|
|
96
|
-
mavenCentral()
|
|
97
|
-
... your repositories
|
|
98
|
-
maven{url = uri("https://nexus3-public.monetplus.cz/repository/ahead-talsec-free-rasp")}
|
|
99
|
-
maven{url = uri("https://developer.huawei.com/repo/")}
|
|
100
|
-
maven{url = uri("https://jitpack.io")}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
```
|
|
90
|
+
_All dependencies of freeRASP for Android are resolved automatically._
|
|
104
91
|
|
|
105
92
|
### iOS
|
|
106
93
|
|
|
@@ -108,58 +95,7 @@ freeRASP React Native plugin uses Pods. Navigate to the `ios` folder and run:
|
|
|
108
95
|
|
|
109
96
|
$ pod install
|
|
110
97
|
|
|
111
|
-
## Step 3:
|
|
112
|
-
|
|
113
|
-
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:
|
|
114
|
-
|
|
115
|
-
- Emulator-usage (simulator)
|
|
116
|
-
- Debugging (debug)
|
|
117
|
-
- Signing (appIntegrity)
|
|
118
|
-
- Unofficial store (unofficialStore)
|
|
119
|
-
|
|
120
|
-
Which version of freeRASP is used is tied to the application's development stage - more precisely, how the application is compiled.
|
|
121
|
-
|
|
122
|
-
### Android
|
|
123
|
-
|
|
124
|
-
Android implementation of the React Native plugin detects selected development stage and automatically applies the suitable version of the library.
|
|
125
|
-
|
|
126
|
-
- `npx react-native run-android` (debug) -> uses dev version of freeRASP
|
|
127
|
-
- `npx react-native run-android --variant release` (release) -> uses release version of freeRASP
|
|
128
|
-
|
|
129
|
-
### iOS
|
|
130
|
-
|
|
131
|
-
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.
|
|
132
|
-
|
|
133
|
-
1. Add pre-built script for changing the Debug and Release versions of the framework:
|
|
134
|
-
- Open up the **.xcworkspace** file
|
|
135
|
-
- Go to **Product** -> **Scheme** -> **Edit Scheme...** -> **Build (dropdown arrow)** -> **Pre-actions**
|
|
136
|
-
- Hit **+** and then **New Run Script Action**
|
|
137
|
-
- Set **Provide build setting from** to your application
|
|
138
|
-
- Copy-paste following script:
|
|
139
|
-
```shell
|
|
140
|
-
cd "${SRCROOT}/../node_modules/freerasp-react-native/ios"
|
|
141
|
-
if [ "${CONFIGURATION}" = "Release" ]; then
|
|
142
|
-
rm -rf ./TalsecRuntime.xcframework
|
|
143
|
-
ln -s ./Release/TalsecRuntime.xcframework/ TalsecRuntime.xcframework
|
|
144
|
-
else
|
|
145
|
-
rm -rf ./TalsecRuntime.xcframework
|
|
146
|
-
ln -s ./Debug/TalsecRuntime.xcframework/ TalsecRuntime.xcframework
|
|
147
|
-
fi
|
|
148
|
-
```
|
|
149
|
-
- **Close**
|
|
150
|
-
2. Add dependency on the symlink
|
|
151
|
-
- Go to your **Target** -> **Build Phases** -> **Link Binary With Libraries**
|
|
152
|
-
- Add dependency (drag & drop right after **libPods**) on the symlink on the following location:
|
|
153
|
-
_AwesomeProject/node_modules/freerasp-react-native/ios/TalsecRuntime.xcframework_
|
|
154
|
-
- If there is no symlink, try to create it manually in that folder by the following command:
|
|
155
|
-
- $ ln -s ./Debug/TalsecRuntime.xcframework/ TalsecRuntime.xcframework
|
|
156
|
-
|
|
157
|
-
Followingly:
|
|
158
|
-
|
|
159
|
-
- `npx react-native run-ios` (debug) -> uses dev version of freeRASP
|
|
160
|
-
- `npx react-native run-ios --configuration Release` (release) -> uses release version of freeRASP
|
|
161
|
-
|
|
162
|
-
## Step 4: Import freeRASP into the app
|
|
98
|
+
## Step 3: Import freeRASP into the app
|
|
163
99
|
|
|
164
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:
|
|
165
101
|
|
|
@@ -167,31 +103,13 @@ We provide a custom hook that handles all required logic as registration of free
|
|
|
167
103
|
import { useFreeRasp } from 'freerasp-react-native';
|
|
168
104
|
```
|
|
169
105
|
|
|
170
|
-
## Step
|
|
106
|
+
## Step 4: Setup the configuration, callbacks and initialize freeRASP
|
|
171
107
|
|
|
172
|
-
First, the configuration and callbacks will be explained. Then the
|
|
108
|
+
First, the configuration and callbacks will be explained. Then the [Initialization](#initialization) chapter shows the implementation.
|
|
173
109
|
|
|
174
110
|
### Configuration
|
|
175
111
|
|
|
176
|
-
You need to provide configuration for freeRASP to work properly and initialize it. The freeRASP configuration contains configs for both Android and iOS. You must fill all the required values for the plugin to work.
|
|
177
|
-
|
|
178
|
-
For Android:
|
|
179
|
-
|
|
180
|
-
- `packageName` - package name of your app you chose when you created it
|
|
181
|
-
- `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.
|
|
182
|
-
- `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.
|
|
183
|
-
|
|
184
|
-
For iOS similarly to Android, `appBundleId` and `appTeamId` are required.
|
|
185
|
-
|
|
186
|
-
Lastly, pass a mail address to `watcherMail` to be able to get reports. Mail has a strict form `name@domain.com` which is passed as String.
|
|
187
|
-
|
|
188
|
-
### Callbacks
|
|
189
|
-
|
|
190
|
-
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.
|
|
191
|
-
|
|
192
|
-
### Initialization
|
|
193
|
-
|
|
194
|
-
You should initialize the freeRASP in the entry point to your app, which is usually in `App.jsx` or `App.tsx`. Just copy & paste this code inside your root component / function, then setup the configuration and reactions to listeners:
|
|
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. Use the following template to provide configuration to the Talsec plugin. You can find detailed description of the configuration below.
|
|
195
113
|
|
|
196
114
|
```ts
|
|
197
115
|
// app configuration
|
|
@@ -206,52 +124,88 @@ const config = {
|
|
|
206
124
|
appTeamId: 'your_team_ID',
|
|
207
125
|
},
|
|
208
126
|
watcherMail: 'your_email_address@example.com',
|
|
127
|
+
isProd: true,
|
|
209
128
|
};
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
#### The configuration object should consist of:
|
|
210
132
|
|
|
133
|
+
1. `androidConfig` _: object | undefined_ - required for Android devices, has following keys:
|
|
134
|
+
|
|
135
|
+
- `packageName` _: string_ - package name of your app you chose when you created it
|
|
136
|
+
- `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.
|
|
137
|
+
- `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.
|
|
138
|
+
|
|
139
|
+
1. `iosConfig` _: object | undefined_ - required for iOS devices, has following keys:
|
|
140
|
+
- `appBundleId` _: string_ - Bundle ID of your app
|
|
141
|
+
- `appTeamId` _: string_ - the Apple Team ID
|
|
142
|
+
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.
|
|
143
|
+
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)!
|
|
144
|
+
|
|
145
|
+
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.
|
|
146
|
+
|
|
147
|
+
#### Dev vs Release version
|
|
148
|
+
|
|
149
|
+
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:
|
|
150
|
+
|
|
151
|
+
- Emulator-usage (simulator)
|
|
152
|
+
- Debugging (debug)
|
|
153
|
+
- Signing (appIntegrity)
|
|
154
|
+
- Unofficial store (unofficialStore)
|
|
155
|
+
|
|
156
|
+
### Callbacks
|
|
157
|
+
|
|
158
|
+
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.
|
|
159
|
+
|
|
160
|
+
### Initialization
|
|
161
|
+
|
|
162
|
+
You should initialize the freeRASP in the entry point to your app, which is usually in `App.jsx` or `App.tsx`. Just copy & paste this code inside your root component / function, then setup the configuration and reactions to listeners:
|
|
163
|
+
|
|
164
|
+
```ts
|
|
211
165
|
// reactions for detected threats
|
|
212
166
|
const actions = {
|
|
213
167
|
// Android & iOS
|
|
214
|
-
|
|
168
|
+
privilegedAccess: () => {
|
|
215
169
|
console.log('privilegedAccess');
|
|
216
170
|
},
|
|
217
171
|
// Android & iOS
|
|
218
|
-
|
|
172
|
+
debug: () => {
|
|
219
173
|
console.log('debug');
|
|
220
174
|
},
|
|
221
175
|
// Android & iOS
|
|
222
|
-
|
|
176
|
+
simulator: () => {
|
|
223
177
|
console.log('simulator');
|
|
224
178
|
},
|
|
225
179
|
// Android & iOS
|
|
226
|
-
|
|
180
|
+
appIntegrity: () => {
|
|
227
181
|
console.log('appIntegrity');
|
|
228
182
|
},
|
|
229
183
|
// Android & iOS
|
|
230
|
-
|
|
184
|
+
unofficialStore: () => {
|
|
231
185
|
console.log('unofficialStore');
|
|
232
186
|
},
|
|
233
187
|
// Android & iOS
|
|
234
|
-
|
|
188
|
+
hooks: () => {
|
|
235
189
|
console.log('hooks');
|
|
236
190
|
},
|
|
237
191
|
// Android & iOS
|
|
238
|
-
|
|
239
|
-
console.log('
|
|
192
|
+
deviceBinding: () => {
|
|
193
|
+
console.log('deviceBinding');
|
|
240
194
|
},
|
|
241
195
|
// Android & iOS
|
|
242
|
-
|
|
196
|
+
secureHardwareNotAvailable: () => {
|
|
243
197
|
console.log('secureHardwareNotAvailable');
|
|
244
198
|
},
|
|
245
199
|
// Android & iOS
|
|
246
|
-
|
|
200
|
+
passcode: () => {
|
|
247
201
|
console.log('passcode');
|
|
248
202
|
},
|
|
249
203
|
// iOS only
|
|
250
|
-
|
|
204
|
+
deviceID: () => {
|
|
251
205
|
console.log('deviceID');
|
|
252
206
|
},
|
|
253
207
|
// iOS only
|
|
254
|
-
|
|
208
|
+
passcodeChange: () => {
|
|
255
209
|
console.log('passcodeChange');
|
|
256
210
|
},
|
|
257
211
|
};
|
|
@@ -261,7 +215,34 @@ useFreeRasp(config, actions);
|
|
|
261
215
|
|
|
262
216
|
When freeRASP initializes correctly, you should see `freeRASP initialized` message in logs. Otherwise, you'll see warning with description of what went wrong.
|
|
263
217
|
|
|
264
|
-
_You can override this default behavior by extending the `actions` object with `
|
|
218
|
+
_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
|
+
|
|
220
|
+
## Step 5: Additional note about obfuscation
|
|
221
|
+
|
|
222
|
+
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.
|
|
223
|
+
|
|
224
|
+
### Android
|
|
225
|
+
|
|
226
|
+
The majority of Android projects support code shrinking and obfuscation without any additional need for setup. The owner of the project can define the set of rules that are usually automatically used when the application is built in the release mode. For more information, please visit the official documentation
|
|
227
|
+
|
|
228
|
+
- https://developer.android.com/studio/build/shrink-code
|
|
229
|
+
- https://www.guardsquare.com/manual/configuration/usage
|
|
230
|
+
|
|
231
|
+
You can make sure, that the obfuscation is enabled by checking the value of **minifyEnabled** property in your **module's build.gradle** file.
|
|
232
|
+
|
|
233
|
+
```gradle
|
|
234
|
+
android {
|
|
235
|
+
...
|
|
236
|
+
|
|
237
|
+
buildTypes {
|
|
238
|
+
release {
|
|
239
|
+
minifyEnabled true
|
|
240
|
+
shrinkResources true
|
|
241
|
+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
```
|
|
265
246
|
|
|
266
247
|
## Step 6: User Data Policies
|
|
267
248
|
|
|
@@ -427,7 +408,7 @@ Learn more about commercial features at [https://talsec.app](https://talsec.app/
|
|
|
427
408
|
<td colspan=5><strong>Fair usage policy</strong></td>
|
|
428
409
|
</tr>
|
|
429
410
|
<tr>
|
|
430
|
-
<td>Mentioning of the
|
|
411
|
+
<td>Mentioning of the App name and logo in the marketing communications of Talsec (e.g. "Trusted by" section of the Talsec web or in the social media).</td>
|
|
431
412
|
<td>over 100k downloads</td>
|
|
432
413
|
<td>no</td>
|
|
433
414
|
</tr>
|
package/android/build.gradle
CHANGED
|
@@ -61,9 +61,13 @@ android {
|
|
|
61
61
|
repositories {
|
|
62
62
|
mavenCentral()
|
|
63
63
|
google()
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
rootProject.allprojects {
|
|
67
|
+
repositories {
|
|
68
|
+
maven{url "https://nexus3-public.monetplus.cz/repository/ahead-talsec-free-rasp"}
|
|
69
|
+
maven{url "https://jitpack.io"}
|
|
70
|
+
}
|
|
67
71
|
}
|
|
68
72
|
|
|
69
73
|
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
@@ -74,8 +78,7 @@ dependencies {
|
|
|
74
78
|
//noinspection GradleDynamicVersion
|
|
75
79
|
implementation "com.facebook.react:react-native"
|
|
76
80
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
77
|
-
|
|
78
|
-
releaseImplementation "com.aheaditec.talsec.security:TalsecSecurity-Community-ReactNative:6.0.0-release"
|
|
81
|
+
implementation "com.aheaditec.talsec.security:TalsecSecurity-Community-ReactNative:7.0.0"
|
|
79
82
|
}
|
|
80
83
|
|
|
81
84
|
if (isNewArchitectureEnabled()) {
|
|
@@ -12,7 +12,8 @@ import com.facebook.react.bridge.ReadableMap
|
|
|
12
12
|
import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
13
13
|
|
|
14
14
|
class FreeraspReactNativeModule(val reactContext: ReactApplicationContext) :
|
|
15
|
-
ReactContextBaseJavaModule(reactContext), ThreatListener.ThreatDetected,
|
|
15
|
+
ReactContextBaseJavaModule(reactContext), ThreatListener.ThreatDetected,
|
|
16
|
+
FreeraspDeviceStateListener.DeviceStateListener {
|
|
16
17
|
|
|
17
18
|
private val listener = ThreatListener(this, FreeraspDeviceStateListener)
|
|
18
19
|
|
|
@@ -75,7 +76,7 @@ class FreeraspReactNativeModule(val reactContext: ReactApplicationContext) :
|
|
|
75
76
|
}
|
|
76
77
|
|
|
77
78
|
override fun onDeviceBindingDetected() {
|
|
78
|
-
sendOngoingPluginResult("
|
|
79
|
+
sendOngoingPluginResult("deviceBinding", null)
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
override fun deviceStateChangeDetected(threatType: String) {
|
|
@@ -104,7 +105,18 @@ class FreeraspReactNativeModule(val reactContext: ReactApplicationContext) :
|
|
|
104
105
|
alternativeStores.add(stores.getString(i))
|
|
105
106
|
}
|
|
106
107
|
}
|
|
107
|
-
|
|
108
|
+
var isProd = true
|
|
109
|
+
if (config.hasKey("isProd")) {
|
|
110
|
+
isProd = config.getBoolean("isProd")
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return TalsecConfig(
|
|
114
|
+
packageName,
|
|
115
|
+
certificateHashes.toTypedArray(),
|
|
116
|
+
watcherMail,
|
|
117
|
+
alternativeStores.toTypedArray(),
|
|
118
|
+
isProd
|
|
119
|
+
)
|
|
108
120
|
}
|
|
109
121
|
|
|
110
122
|
companion object {
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
|
|
15
15
|
7699B88040F8A987B510C191 /* libPods-FreeraspReactNativeExample-FreeraspReactNativeExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-FreeraspReactNativeExample-FreeraspReactNativeExampleTests.a */; };
|
|
16
16
|
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
|
|
17
|
-
A41E05192962BAB100B363A8 /* TalsecRuntime.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = A44E6986295D7CAB000A719C /* TalsecRuntime.xcframework */; };
|
|
18
17
|
/* End PBXBuildFile section */
|
|
19
18
|
|
|
20
19
|
/* Begin PBXContainerItemProxy section */
|
|
@@ -44,6 +43,8 @@
|
|
|
44
43
|
5DCACB8F33CDC322A6C60F78 /* libPods-FreeraspReactNativeExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-FreeraspReactNativeExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
45
44
|
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = FreeraspReactNativeExample/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
|
46
45
|
89C6BE57DB24E9ADA2F236DE /* Pods-FreeraspReactNativeExample-FreeraspReactNativeExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FreeraspReactNativeExample-FreeraspReactNativeExampleTests.release.xcconfig"; path = "Target Support Files/Pods-FreeraspReactNativeExample-FreeraspReactNativeExampleTests/Pods-FreeraspReactNativeExample-FreeraspReactNativeExampleTests.release.xcconfig"; sourceTree = "<group>"; };
|
|
46
|
+
8C2BD8B529DF06E4000304E9 /* Talsec */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Talsec; path = ../../ios/Talsec; sourceTree = "<group>"; };
|
|
47
|
+
8C2BD8BB29DF0976000304E9 /* TalsecRuntime.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = TalsecRuntime.xcframework; path = ../../ios/Talsec/TalsecRuntime.xcframework; sourceTree = "<group>"; };
|
|
47
48
|
A41E05172962B9FD00B363A8 /* TalsecRuntime.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = TalsecRuntime.xcframework; path = "../../../../React/test2/someTestProject/node_modules/freerasp-react-native/ios/TalsecRuntime.xcframework"; sourceTree = "<group>"; };
|
|
48
49
|
A44E6986295D7CAB000A719C /* TalsecRuntime.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = TalsecRuntime.xcframework; path = ../../ios/TalsecRuntime.xcframework; sourceTree = "<group>"; };
|
|
49
50
|
A44E698B295D7E12000A719C /* TalsecRuntime.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = TalsecRuntime.xcframework; path = ../../ios/Debug/TalsecRuntime.xcframework; sourceTree = "<group>"; };
|
|
@@ -65,7 +66,6 @@
|
|
|
65
66
|
buildActionMask = 2147483647;
|
|
66
67
|
files = (
|
|
67
68
|
0C80B921A6F3F58F76C31292 /* libPods-FreeraspReactNativeExample.a in Frameworks */,
|
|
68
|
-
A41E05192962BAB100B363A8 /* TalsecRuntime.xcframework in Frameworks */,
|
|
69
69
|
);
|
|
70
70
|
runOnlyForDeploymentPostprocessing = 0;
|
|
71
71
|
};
|
|
@@ -105,6 +105,8 @@
|
|
|
105
105
|
2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
|
|
106
106
|
isa = PBXGroup;
|
|
107
107
|
children = (
|
|
108
|
+
8C2BD8BB29DF0976000304E9 /* TalsecRuntime.xcframework */,
|
|
109
|
+
8C2BD8B529DF06E4000304E9 /* Talsec */,
|
|
108
110
|
A44E6986295D7CAB000A719C /* TalsecRuntime.xcframework */,
|
|
109
111
|
A44E698B295D7E12000A719C /* TalsecRuntime.xcframework */,
|
|
110
112
|
A44E69A2295DA98F000A719C /* TalsecRuntime.xcframework */,
|
|
@@ -1,28 +1,10 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<Scheme
|
|
3
3
|
LastUpgradeVersion = "1210"
|
|
4
|
-
version = "1.
|
|
4
|
+
version = "1.3">
|
|
5
5
|
<BuildAction
|
|
6
6
|
parallelizeBuildables = "YES"
|
|
7
7
|
buildImplicitDependencies = "YES">
|
|
8
|
-
<PreActions>
|
|
9
|
-
<ExecutionAction
|
|
10
|
-
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
|
|
11
|
-
<ActionContent
|
|
12
|
-
title = "Run Script"
|
|
13
|
-
scriptText = "cd "${SRCROOT}/../../ios" if [ "${CONFIGURATION}" = "Release" ]; then rm -rf ./TalsecRuntime.xcframework ln -s ./Release/TalsecRuntime.xcframework/ TalsecRuntime.xcframework else rm -rf ./TalsecRuntime.xcframework ln -s ./Debug/TalsecRuntime.xcframework/ TalsecRuntime.xcframework fi ">
|
|
14
|
-
<EnvironmentBuildable>
|
|
15
|
-
<BuildableReference
|
|
16
|
-
BuildableIdentifier = "primary"
|
|
17
|
-
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
|
18
|
-
BuildableName = "FreeraspReactNativeExample.app"
|
|
19
|
-
BlueprintName = "FreeraspReactNativeExample"
|
|
20
|
-
ReferencedContainer = "container:FreeraspReactNativeExample.xcodeproj">
|
|
21
|
-
</BuildableReference>
|
|
22
|
-
</EnvironmentBuildable>
|
|
23
|
-
</ActionContent>
|
|
24
|
-
</ExecutionAction>
|
|
25
|
-
</PreActions>
|
|
26
8
|
<BuildActionEntries>
|
|
27
9
|
<BuildActionEntry
|
|
28
10
|
buildForTesting = "YES"
|
package/example/ios/Podfile.lock
CHANGED
|
@@ -548,7 +548,7 @@ SPEC CHECKSUMS:
|
|
|
548
548
|
Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541
|
|
549
549
|
FlipperKit: cbdee19bdd4e7f05472a66ce290f1b729ba3cb86
|
|
550
550
|
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
|
|
551
|
-
freerasp-react-native:
|
|
551
|
+
freerasp-react-native: 68f18a583428d1bbb484228abdb3b9cd258795b4
|
|
552
552
|
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
|
|
553
553
|
hermes-engine: 2af7b7a59128f250adfd86f15aa1d5a2ecd39995
|
|
554
554
|
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
|
package/example/src/App.tsx
CHANGED
|
@@ -22,11 +22,12 @@ const App = () => {
|
|
|
22
22
|
appTeamId: 'your_team_ID',
|
|
23
23
|
},
|
|
24
24
|
watcherMail: 'your_email_address@example.com',
|
|
25
|
+
isProd: true,
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
const actions = {
|
|
28
29
|
// Android & iOS
|
|
29
|
-
|
|
30
|
+
privilegedAccess: () => {
|
|
30
31
|
setAppChecks((currentState) =>
|
|
31
32
|
currentState.map((threat) =>
|
|
32
33
|
threat.name === 'Privileged Access'
|
|
@@ -36,7 +37,7 @@ const App = () => {
|
|
|
36
37
|
);
|
|
37
38
|
},
|
|
38
39
|
// Android & iOS
|
|
39
|
-
|
|
40
|
+
debug: () => {
|
|
40
41
|
setAppChecks((currentState) =>
|
|
41
42
|
currentState.map((threat) =>
|
|
42
43
|
threat.name === 'Debug' ? { ...threat, status: 'nok' } : threat
|
|
@@ -44,7 +45,7 @@ const App = () => {
|
|
|
44
45
|
);
|
|
45
46
|
},
|
|
46
47
|
// Android & iOS
|
|
47
|
-
|
|
48
|
+
simulator: () => {
|
|
48
49
|
setAppChecks((currentState) =>
|
|
49
50
|
currentState.map((threat) =>
|
|
50
51
|
threat.name === 'Simulator' ? { ...threat, status: 'nok' } : threat
|
|
@@ -52,7 +53,7 @@ const App = () => {
|
|
|
52
53
|
);
|
|
53
54
|
},
|
|
54
55
|
// Android & iOS
|
|
55
|
-
|
|
56
|
+
appIntegrity: () => {
|
|
56
57
|
setAppChecks((currentState) =>
|
|
57
58
|
currentState.map((threat) =>
|
|
58
59
|
threat.name === 'App Integrity'
|
|
@@ -62,7 +63,7 @@ const App = () => {
|
|
|
62
63
|
);
|
|
63
64
|
},
|
|
64
65
|
// Android & iOS
|
|
65
|
-
|
|
66
|
+
unofficialStore: () => {
|
|
66
67
|
setAppChecks((currentState) =>
|
|
67
68
|
currentState.map((threat) =>
|
|
68
69
|
threat.name === 'Unofficial Store'
|
|
@@ -72,7 +73,7 @@ const App = () => {
|
|
|
72
73
|
);
|
|
73
74
|
},
|
|
74
75
|
// Android & iOS
|
|
75
|
-
|
|
76
|
+
hooks: () => {
|
|
76
77
|
setAppChecks((currentState) =>
|
|
77
78
|
currentState.map((threat) =>
|
|
78
79
|
threat.name === 'Hooks' ? { ...threat, status: 'nok' } : threat
|
|
@@ -80,7 +81,7 @@ const App = () => {
|
|
|
80
81
|
);
|
|
81
82
|
},
|
|
82
83
|
// Android & iOS
|
|
83
|
-
|
|
84
|
+
deviceBinding: () => {
|
|
84
85
|
setAppChecks((currentState) =>
|
|
85
86
|
currentState.map((threat) =>
|
|
86
87
|
threat.name === 'Device Binding'
|
|
@@ -90,7 +91,7 @@ const App = () => {
|
|
|
90
91
|
);
|
|
91
92
|
},
|
|
92
93
|
// Android & iOS
|
|
93
|
-
|
|
94
|
+
secureHardwareNotAvailable: () => {
|
|
94
95
|
setAppChecks((currentState) =>
|
|
95
96
|
currentState.map((threat) =>
|
|
96
97
|
threat.name === 'Secure Hardware Not Available'
|
|
@@ -100,7 +101,7 @@ const App = () => {
|
|
|
100
101
|
);
|
|
101
102
|
},
|
|
102
103
|
// Android & iOS
|
|
103
|
-
|
|
104
|
+
passcode: () => {
|
|
104
105
|
setAppChecks((currentState) =>
|
|
105
106
|
currentState.map((threat) =>
|
|
106
107
|
threat.name === 'Passcode' ? { ...threat, status: 'nok' } : threat
|
|
@@ -108,7 +109,7 @@ const App = () => {
|
|
|
108
109
|
);
|
|
109
110
|
},
|
|
110
111
|
// iOS only
|
|
111
|
-
|
|
112
|
+
deviceID: () => {
|
|
112
113
|
setAppChecks((currentState) =>
|
|
113
114
|
currentState.map((threat) =>
|
|
114
115
|
threat.name === 'Device ID' ? { ...threat, status: 'nok' } : threat
|
|
@@ -116,7 +117,7 @@ const App = () => {
|
|
|
116
117
|
);
|
|
117
118
|
},
|
|
118
119
|
// iOS only
|
|
119
|
-
|
|
120
|
+
passcodeChange: () => {
|
|
120
121
|
setAppChecks((currentState) =>
|
|
121
122
|
currentState.map((threat) =>
|
|
122
123
|
threat.name === 'Passcode Change'
|
|
@@ -15,7 +15,7 @@ Pod::Spec.new do |s|
|
|
|
15
15
|
s.source = { :git => "https://github.com/talsec/freerasp-react-native.git", :tag => "#{s.version}" }
|
|
16
16
|
|
|
17
17
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
18
|
-
s.ios.vendored_frameworks = "ios/
|
|
18
|
+
s.ios.vendored_frameworks = "ios/TalsecRuntime.xcframework"
|
|
19
19
|
|
|
20
20
|
s.dependency "React-Core"
|
|
21
21
|
|
|
@@ -3,14 +3,14 @@ import TalsecRuntime
|
|
|
3
3
|
|
|
4
4
|
@objc(FreeraspReactNative)
|
|
5
5
|
class FreeraspReactNative: RCTEventEmitter {
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
public static var shared:FreeraspReactNative?
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
override init() {
|
|
10
10
|
super.init()
|
|
11
11
|
FreeraspReactNative.shared = self
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
@objc(talsecStart:)
|
|
15
15
|
func talsecStart(options: NSDictionary) -> Void {
|
|
16
16
|
do {
|
|
@@ -22,7 +22,7 @@ class FreeraspReactNative: RCTEventEmitter {
|
|
|
22
22
|
}
|
|
23
23
|
self.sendEvent(withName: "started", body: "started")
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
|
|
26
26
|
func initializeTalsec(talsecConfig: NSDictionary) throws {
|
|
27
27
|
guard let iosConfig = talsecConfig["iosConfig"] as? NSDictionary else {
|
|
28
28
|
throw NSError(domain: "Missing iosConfig parameter in Talsec Native Plugin", code: 1)
|
|
@@ -36,22 +36,27 @@ class FreeraspReactNative: RCTEventEmitter {
|
|
|
36
36
|
guard let watcherMailAddress = talsecConfig["watcherMail"] as? String else {
|
|
37
37
|
throw NSError(domain: "Missing watcherMail parameter in Talsec Native Plugin", code: 4)
|
|
38
38
|
}
|
|
39
|
-
let
|
|
39
|
+
let isProd = talsecConfig["isProd"] as? Bool ?? true
|
|
40
|
+
|
|
41
|
+
let config = TalsecConfig(appBundleIds: [appBundleIds], appTeamId: appTeamId, watcherMailAddress: watcherMailAddress, isProd: isProd)
|
|
40
42
|
Talsec.start(config: config)
|
|
41
43
|
}
|
|
42
|
-
|
|
44
|
+
|
|
43
45
|
override func supportedEvents() -> [String]! {
|
|
44
|
-
return ["initializationError", "started", "privilegedAccess", "debug", "simulator", "appIntegrity", "unofficialStore", "hooks", "
|
|
46
|
+
return ["initializationError", "started", "privilegedAccess", "debug", "simulator", "appIntegrity", "unofficialStore", "hooks", "deviceBinding", "deviceID", "secureHardwareNotAvailable", "passcodeChange", "passcode"]
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
extension SecurityThreatCenter: SecurityThreatHandler {
|
|
49
51
|
public func threatDetected(_ securityThreat: TalsecRuntime.SecurityThreat) {
|
|
50
52
|
// It is better to implement security reactions (e.g. killing the app) here.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
switch securityThreat.rawValue {
|
|
54
|
+
case "missingSecureEnclave":
|
|
55
|
+
FreeraspReactNative.shared!.sendEvent(withName: "secureHardwareNotAvailable", body: "secureHardwareNotAvailable")
|
|
56
|
+
case "device binding":
|
|
57
|
+
FreeraspReactNative.shared!.sendEvent(withName: "deviceBinding", body: "deviceBinding")
|
|
58
|
+
default:
|
|
59
|
+
FreeraspReactNative.shared!.sendEvent(withName: securityThreat.rawValue, body: securityThreat.rawValue)
|
|
55
60
|
}
|
|
56
61
|
}
|
|
57
62
|
}
|
|
@@ -213,7 +213,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
|
|
213
213
|
#endif
|
|
214
214
|
|
|
215
215
|
|
|
216
|
-
SWIFT_EXTERN void
|
|
216
|
+
SWIFT_EXTERN void __UAEjWMMMrsiAVWBJDVKWmuV(void);
|
|
217
217
|
|
|
218
218
|
#if __has_attribute(external_source_symbol)
|
|
219
219
|
# pragma clang attribute pop
|
|
Binary file
|
|
@@ -19,7 +19,8 @@ public struct TalsecConfig {
|
|
|
19
19
|
public let appBundleIds: [Swift.String]
|
|
20
20
|
public let appTeamId: Swift.String
|
|
21
21
|
public let watcherMailAddress: Swift.String?
|
|
22
|
-
public
|
|
22
|
+
public let isProd: Swift.Bool?
|
|
23
|
+
public init(appBundleIds: [Swift.String], appTeamId: Swift.String, watcherMailAddress: Swift.String?, isProd: Swift.Bool? = true)
|
|
23
24
|
}
|
|
24
25
|
@_hasMissingDesignatedInitializers public class Talsec {
|
|
25
26
|
public static func start(config: TalsecRuntime.TalsecConfig)
|
|
Binary file
|