Skip to content

Commit 4842d24

Browse files
author
Richard Taylor
committed
Improve secrets description
1 parent f352de6 commit 4842d24

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

API-PROTECTION.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ These steps require access to the [Approov CLI](https://approov.io/docs/latest/a
77
In order for Approov tokens to be added by the interceptor for particular API domains it is necessary to inform Approov about them. Execute the following command:
88

99
```
10-
approov api -add <your-domain>
10+
approov api -add your.domain
1111
```
1212
Approov tokens will then be added automatically to any requests to that domain (using the `Approov-Token` header, by default).
1313

@@ -59,7 +59,7 @@ ApproovService.prefetch()
5959
This initiates the process of fetching an Approov token as a background task, so that a cached token is available immediately when subsequently needed, or at least the fetch time is reduced. Note that there is no point in performing a prefetch if you are using token binding.
6060

6161
### Prechecking
62-
You may wish to do an early check in your to present a warning to the user if the app is not going to be able to obtain valid Approov tokens because it fails the attestation process. To do this you first need to enable the [Secure Strings](https://approov.io/docs/latest/approov-usage-documentation/#secure-strings) feature:
62+
You may wish to do an early check in your app to present a warning to the user if it is not going to be able to obtain valid Approov tokens because it fails the attestation process. To do this you first need to enable the [Secure Strings](https://approov.io/docs/latest/approov-usage-documentation/#secure-strings) feature:
6363

6464
```
6565
approov secstrings -setEnabled

SECRETS-PROTECTION.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ This ensures connections may only use official certificates, and blocks the use
2222
In order for secrets to be protected for particular API domains it is necessary to inform Approov about them. Execute the following command:
2323

2424
```
25-
approov api -add <your-domain> -noApproovToken
25+
approov api -add your.domain -noApproovToken
2626
```
2727

2828
This informs Approov that it should be active for the domain, but does not need to send Approov tokens for it. Adding the domain ensures that the channel will be protected against Man-in-the-Middle (MitM) attacks.
@@ -38,35 +38,37 @@ approov secstrings -setEnabled
3838
3939
The quickstart integration works by allowing you to replace the secret in your app with a placeholder value instead, and then the placeholder value is mapped to the actual secret value on the fly by the interceptor (if the app passes Approov attestation). The shipped app code will only contain the placeholder values.
4040

41-
If your app currently uses `<secret-value>` then replace it in your app with the value `<secret-placeholder>`. Choose a suitable placeholder name to reflect the type of the secret. The placeholder value will be added to requests in the normal way, but you should be using the Approov enabled networking client to perfom the substituion.
41+
If your app currently uses `your-secret` then replace it in your app with the value `your-placeholder`. Choose a suitable placeholder name to reflect the type of the secret.
4242

43-
You must inform Approov that it should substitute `<secret-placeholder>` for `<secret-value>` in requests as follows:
43+
You must inform Approov that it should substitute `your-placeholder` with `your-secret` in requests as follows:
4444

4545
```
46-
approov secstrings -addKey <secret-placeholder> -predefinedValue <secret-value>
46+
approov secstrings -addKey your-placeholder -predefinedValue your-secret
4747
```
4848

4949
> Note that this command also requires an [admin role](https://approov.io/docs/latest/approov-usage-documentation/#account-access-roles).
5050
5151
You can add up to 16 different secret values to be substituted in this way.
5252

53-
If the secret value is provided on the header `<secret-header>` then it is necessary to notify the `ApproovService` that the header is subject to substitution. You do this by making the call once, after initialization:
53+
If the secret value is provided on the header `your-header` then it is necessary to notify the `ApproovService` that the header is subject to substitution. You do this by making the call once, after initialization:
5454

5555
```kotlin
56-
ApproovService.addSubstitutionHeader("<secret-header>", null)
56+
ApproovService.addSubstitutionHeader("your-header", null)
5757
```
5858

59-
With this in place the Approov interceptor should replace the `<secret-placeholder>` with the `<secret-value>` as required when the app passes attestation. Since the mapping lookup is performed on the placeholder value you have the flexibility of providing different secrets on different API calls, even if they passed with the same header name.
59+
With this in place the Approov interceptor should replace `your-placeholder` with the `your-secret` as required when the app passes attestation. Since the mapping lookup is performed on the placeholder value you have the flexibility of providing different secrets on different API calls, even if they passed with the same header name.
6060

61-
Since earlier released versions of the app may have already leaked the `<secret-value>`, you may wish to refresh the secret at some later point when any older version of the app is no longer in use. You can of course do this update over-the-air using Approov without any need to modify the app.
61+
You can see a [worked example](https://github.com/approov/quickstart-android-kotlin-retrofit/blob/master/SHAPES-EXAMPLE.md#shapes-app-with-secrets-protection) for the Shapes app.
6262

63-
If the secret value is provided as a parameter in a URL query string with the name `<secret-param>` then it is necessary to notify the `ApproovService` that the query parameter is subject to substitution. You do this by making the call once, after initialization:
63+
Since earlier released versions of the app may have already leaked `your-secret`, you may wish to refresh the secret at some later point when any older version of the app is no longer in use. You can of course do this update over-the-air using Approov without any need to modify the app.
64+
65+
If the secret value is provided as a parameter in a URL query string with the name `your-param` then it is necessary to notify the `ApproovService` that the query parameter is subject to substitution. You do this by making the call once, after initialization:
6466

6567
```kotlin
66-
ApproovService.addSubstitutionQueryParam("<secret-param>")
68+
ApproovService.addSubstitutionQueryParam("your-param")
6769
```
6870

69-
After this the Approov interceptor should transform any instance of a URL such as `https://mydomain.com/endpoint?<secret-param>=<secret-placeholder>` into `https://mydomain.com/endpoint?<secret-param>=<secret-value>`, if the app passes attestation and there is a secure string with the name `<secret-placeholder>`.
71+
After this the Approov interceptor should transform any instance of a URL such as `https://your.domain/endpoint?your-param=your-placeholder` into `https://your.domain/endpoint?your-param=your-secret`.
7072

7173
## REGISTERING APPS
7274
In order for Approov to recognize the app as being valid it needs to be registered with the service. Change the directory to the top level of your app project and then register the app with Approov:
@@ -156,7 +158,7 @@ ApproovService.prefetch()
156158
This initiates the process of fetching the required information as a background task, so that it is available immediately when subsequently needed. Note the information will automatically expire after approximately 5 minutes.
157159

158160
### Prechecking
159-
You may wish to do an early check in your to present a warning to the user if the app is not going to be able to access secrets because it fails the attestation process. Here is an example of calling the appropriate method in `ApproovService`:
161+
You may wish to do an early check in your app to present a warning to the user if it is not going to be able to access secrets because it fails the attestation process. Here is an example of calling the appropriate method in `ApproovService`:
160162

161163
```kotlin
162164
import io.approov.service.retrofit.ApproovException

0 commit comments

Comments
 (0)