Skip to content

Commit 87e3666

Browse files
committed
docs: enhance freeRASP configuration chapter
1 parent 9b2a080 commit 87e3666

File tree

1 file changed

+29
-32
lines changed

1 file changed

+29
-32
lines changed

README.md

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -109,31 +109,42 @@ First, the configuration and callbacks will be explained. Then the [Initializati
109109

110110
### Configuration
111111

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.
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.
113113

114-
#### Android configuration:
115-
116-
Create an object under `androidConfig` key with following entries:
117-
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.
121-
122-
#### iOS configuration
114+
```ts
115+
// app configuration
116+
const config = {
117+
androidConfig: {
118+
packageName: 'com.awesomeproject',
119+
certificateHashes: ['your_signing_certificate_hash_base64'],
120+
// supportedAlternativeStores: ['storeOne', 'storeTwo'],
121+
},
122+
iosConfig: {
123+
appBundleId: 'com.awesomeproject',
124+
appTeamId: 'your_team_ID',
125+
},
126+
watcherMail: '[email protected]',
127+
isProd: true,
128+
};
129+
```
123130

124-
Create an object under `iosConfig` key with following entries:
131+
#### The configuration object should consist of:
125132

126-
- `appBundleId` _: string_ - Bundle ID of your app
127-
- `appTeamId` _: string_ - the Apple Team ID
133+
1. `androidConfig` _: object | undefined_ - required for Android devices, has following keys:
128134

129-
#### Common configuration
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.
130138

131-
Lastly, set up common configuration for both iOS and Android:
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 `[email protected]` 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)!
132144

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)!
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.
135146

136-
### Dev vs Release version
147+
#### Dev vs Release version
137148

138149
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:
139150

@@ -151,20 +162,6 @@ freeRASP executes periodical checks when the application is running. Handle the
151162
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:
152163

153164
```ts
154-
// app configuration
155-
const config = {
156-
androidConfig: {
157-
packageName: 'com.awesomeproject',
158-
certificateHashes: ['your_signing_certificate_hash_base64'],
159-
// supportedAlternativeStores: ['storeOne', 'storeTwo'],
160-
},
161-
iosConfig: {
162-
appBundleId: 'com.awesomeproject',
163-
appTeamId: 'your_team_ID',
164-
},
165-
watcherMail: '[email protected]',
166-
};
167-
168165
// reactions for detected threats
169166
const actions = {
170167
// Android & iOS

0 commit comments

Comments
 (0)