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
> This package is intended to help implement a few basic security features but does not in itself guarantee that an app is secure.<br/>
11
+
> Refer to [OWASP's resources](https://mas.owasp.org) for more information on mobile app security.<br/>
12
+
> You can also [contact us](#👉-about-bam) if you need help with securing your app.
13
+
14
+
# Installation and setup
15
+
16
+
This packages is designed for use in expo apps with [development builds](https://docs.expo.dev/develop/development-builds/introduction/).
17
+
18
+
```sh
19
+
yarn add @bam.tech/react-native-app-security
20
+
```
21
+
22
+
Add the config plugin to `app.config.ts` / `app.config.js` / `app.json`:
23
+
24
+
```json
25
+
{
26
+
"plugins": [
27
+
[
28
+
"@bam.tech/react-native-app-security",
29
+
{
30
+
"sslPinning": {
31
+
"yahoo.com": [
32
+
"TQEtdMbmwFgYUifM4LDF+xgEtd0z69mPGmkp014d6ZY=",
33
+
"rFjc3wG7lTZe43zeYTvPq8k4xdDEutCmIhI5dn4oCeE="
34
+
]
35
+
}
36
+
}
37
+
]
38
+
]
39
+
}
40
+
```
41
+
42
+
Anytime you change the config, don't forget to run:
43
+
44
+
```sh
45
+
yarn expo prebuild
46
+
```
47
+
48
+
# Features
49
+
50
+
## SSL Pinning
51
+
52
+
> **🥷 What's the threat?** Attackers intercepting your app's network requests and accessing private data or sending malicious responses. [More details](https://mas.owasp.org/MASTG/General/0x04f-Testing-Network-Communication/#restricting-trust-identity-pinning)
53
+
54
+
This package implements [public key pinning](https://cheatsheetseries.owasp.org/cheatsheets/Pinning_Cheat_Sheet.html#public-key) using [TrustKit](https://github.com/datatheorem/TrustKit) on iOS and the certificate pinner included in OkHttp on Android.
55
+
56
+
### Configuration
57
+
58
+
```jsonc
59
+
[
60
+
"@bam.tech/react-native-app-security",
61
+
{
62
+
"sslPinning": {
63
+
// The hostname you want to pin, without `https://`
64
+
"yahoo.com": [
65
+
// The public key hashes for the pinned certificates, without a `sha256/` prefix
66
+
"TQEtdMbmwFgYUifM4LDF+xgEtd0z69mPGmkp014d6ZY=",
67
+
"rFjc3wG7lTZe43zeYTvPq8k4xdDEutCmIhI5dn4oCeE="
68
+
]
69
+
}
70
+
}
71
+
]
72
+
```
73
+
74
+
### Generating the public key hashes
75
+
76
+
TODO
77
+
78
+
## Certificate transparency
79
+
80
+
TODO
81
+
82
+
## "Recent screenshots" prevention
83
+
84
+
TODO
85
+
86
+
# Contributing
87
+
88
+
TODO
89
+
90
+
# 👉 About BAM
91
+
92
+
We are a 100 people company developing and designing multi-platform applications with [React Native](https://www.bam.tech/expertise/react-native) using the Lean & Agile methodology. To get more information on the solutions that would suit your needs, feel free to get in touch by [email](mailto:contact@bam.tech) or through our [contact form](https://www.bam.tech/en/contact)!
0 commit comments