Skip to content

Commit ced0786

Browse files
committed
Updates to STIR-SHAKEN
Added warnings for specification deviations. Adjusted internal headers/links.
1 parent 0647c84 commit ced0786

File tree

1 file changed

+25
-18
lines changed

1 file changed

+25
-18
lines changed

docs/Deployment/STIR-SHAKEN/index.md

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The earlier version was only partially functional and not interoperable with oth
99

1010
There are 2 services associated with STIR-SHAKEN call processing implementations...
1111

12-
### Attest
12+
### Attestation
1313
On an outbound call, attestation is basically you swearing in court what level of responsibility you have over the accuracy of the caller id you're presenting in the outgoing INVITE message, where the level can be one of the following:
1414

1515
* **A**: Full Attestation
@@ -32,7 +32,7 @@ Attestation is accomplished by adding a SIP "Identity" header to the outgoing IN
3232
* A URL to the certificate whose private key was used to sign this header.
3333
* The signature that resulted from signing the header with the associated private key.
3434

35-
### Verify
35+
### Verification
3636
This is the hard part... When you receive an incoming INVITE containing an Identity header, you can't just automatically trust it. There are a very specific set of tests that must be executed to determine if the information in that Identity header is valid. Most of these tests are described in [ATIS-1000074v003](https://access.atis.org/higherlogic/ws/public/download/67436/ATIS-1000074.v003.pdf)
3737
* The certificate URL included in the Identity header must use the https scheme, must not have any query parameters, user/password components, or path parameters. The hostname part of the URL must also NOT resolve to any of the Special-Purpose IP Addresses described in [RFC-6890](https://datatracker.ietf.org/doc/html/rfc6890) which includes the local interface 127.0.0.x and the private networks like 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. Don't worry, for testing purposes you can relax these restrictions. :)
3838

@@ -51,6 +51,13 @@ If any of the checks fail, the specifications say you MUST... *do absolutely not
5151
* Accept the call but return some data back to the sender with some error information that may be useful to them. What they do with it is their business.
5252
* Reject the call with very specific 4XX response codes.
5353

54+
/// warning | Deviations from Specifications
55+
* At the present time, Asterisk does not validate the destination TN in the SIP "To:" and the "dest" TN in the Identity header. The rules for doing so are fairly complex with regard to emergency services numbers and call diversion (forwarding, transfer, etc).
56+
* Although [RFC-8225 section 7](https://www.rfc-editor.org/rfc/rfc8225#section-7) allows the use of the compact form of the PASSporT, [ATIS-1000074](https://access.atis.org/higherlogic/ws/public/download/67436/ATIS-1000074.v003.pdf/latest) section 5.3.3 states that only the full form shall be used. Asterisk therefore supports only the full form of the PASSporT.
57+
* Asterisk currently performs only basic validation of certificates retrieved during the verification process. Certificate authority, certificate revocation, validity date and TNAuthList extension presence are validated but neither validation of the TNAuthList content nor validation of the Common Name content are performed. At the present time, we could find no examples of certificates with either of those extensions that could be tested with. This means that there's effectively no verification that the certificate retrieved actually has the authority over the originating TN.
58+
59+
60+
///
5461
## Asterisk Implementation
5562

5663
### Configuration
@@ -95,7 +102,7 @@ will create the table. Since there can be only one "verification"
95102
or "attestation" object, and will probably be only a few "profile"
96103
objects, those objects aren't realtime enabled.
97104

98-
#### Attestation
105+
#### Attestation Object
99106

100107
The "attestation" object sets the parameters for creating an Identity
101108
header which attests to the ownership of the caller id on outgoing
@@ -171,7 +178,7 @@ attest_level = C
171178
```
172179

173180

174-
#### TN
181+
#### TN Object
175182

176183
Each "tn" object contains the parameters needed to create the Identity
177184
header used to attest to the ownership of the caller-id on outgoing
@@ -188,7 +195,7 @@ The "id" of this object MUST be a canonicalized telephone nmumber which
188195
starts with a country code. The only valid characters are the numbers
189196
0-9, '#' and '*'.
190197

191-
The default values for all of the "tn" parameters come from the "[attestation](#attestation)" and "[profile](#profile)" objects.
198+
The default values for all of the "tn" parameters come from the "[attestation](#attestation-object)" and "[profile](#profile-object)" objects.
192199

193200
Parameters:
194201

@@ -199,15 +206,15 @@ Default: none
199206

200207
##### private_key_file
201208

202-
See the description under [attestation](#attestation)
209+
See the description under [attestation](#attestation-object)
203210

204211
##### public_cert_url
205212

206-
See the description and WARNING under [attestation](#attestation)
213+
See the description and WARNING under [attestation](#attestation-object)
207214

208215
##### attest_level
209216

210-
See the description under [attestation](#attestation)
217+
See the description under [attestation](#attestation-object)
211218

212219
##### Example "tn" object:
213220

@@ -225,7 +232,7 @@ Using all the attestation and profile defaults:
225232
type = tn
226233
```
227234

228-
#### Verification
235+
#### Verification Object
229236

230237
The "verification" object sets the parameters for verification
231238
of the Identity header on incoming INVITE requests.
@@ -434,7 +441,7 @@ relax_x5u_port_scheme_restrictions = yes
434441
relax_x5u_path_restrictions = yes
435442
```
436443

437-
#### Profile
444+
#### Profile Object
438445

439446
A "profile" object can be associated to channel driver endpoint
440447
(currently only chan_pjsip) and can set verification and attestation
@@ -510,19 +517,19 @@ We perform verification on incoming calls.
510517
1. If the endpoint receiving the call doesn't have `stir_shaken_profile` set, skip verification and continue the call.
511518
1. If the profile name set in `stir_shaken_profile` doesn't exist, return an error and terminate the call.
512519
1. If the [verification](#verification) `global_disable` flag is true, skip verification and continue the call.
513-
1. If the [profile](#profile) `endpoint_behavior` parameter isn't `verify` or `on`, skip verification and continue the call.
520+
1. If the [profile](#profile-object) `endpoint_behavior` parameter isn't `verify` or `on`, skip verification and continue the call.
514521

515-
From now on, the action taken on failure is controlled by the `failure_action` parameter in the [profile](#profile) or [verification](#verification) objects.
522+
From now on, the action taken on failure is controlled by the `failure_action` parameter in the [profile](#profile-object) or [verification](#verification-object) objects.
516523

517524
1. If there's no Identity header in the SIP request, fail per `failure_action`
518525
1. Parse the Identity header.
519-
1. Check the URL in the "x5u" header parameter against the rules described in [Verify](#verify).
520-
1. Check the "iat" header is within `max_iat_age` from the [profile](#profile) or [verification](#verification).
521-
1. Check the SIP "Date" header is within the `max_date_header_age` from the [profile](#profile) or [verification](#verif
526+
1. Check the URL in the "x5u" header parameter against the rules described in [Verification](#verification).
527+
1. Check the "iat" header is within `max_iat_age` from the [profile](#profile-object) or [verification](#verification).
528+
1. Check the SIP "Date" header is within the `max_date_header_age` from the [profile](#profile-object) or [verification](#verif
522529
1. Check the local cache to see if we have the certificate already and it's cache expiration isn't in the past. If we have a good one, skip to the next step. Otherwise...
523530
* Retrieve the certificate from the URL.
524531
* Parse the certificate and public key.
525-
* Validate the certificate using the CA certificates and certificate revocation lists provided by the `ca_file`, `ca_path`, `crl_file` and `crl_path` parameters provided in the [profile](#profile) or [verification](#verification) objects and against the other rules mentioned in [Verify](#verify).
532+
* Validate the certificate using the CA certificates and certificate revocation lists provided by the `ca_file`, `ca_path`, `crl_file` and `crl_path` parameters provided in the [profile](#profile-object) or [verification](#verification-object) objects and against the other rules mentioned in [Verification](#verification).
526533
1. Decode the Identity header using the public key from the certificate.
527534
ication).
528535
1. Retrieve the rest of the parameters from the decoded Identity header.
@@ -544,9 +551,9 @@ Compared to verification, attestation is simple.
544551
1. If the endpoint sending the call doesn't have `stir_shaken_profile` set, skip attestation and continue the call.
545552
1. If the profile name set in `stir_shaken_profile` doesn't exist, skip attestation and continue the call.
546553
1. If the [attestation](#attestation) `global_disable` flag is true, skip attestation and continue the call.
547-
1. If the [profile](#profile) `endpoint_behavior` parameter isn't `attest` or `on`, skip attestation and continue the call.
554+
1. If the [profile](#profile-object) `endpoint_behavior` parameter isn't `attest` or `on`, skip attestation and continue the call.
548555
1. If there's no "tn" object matching the caller-id, skip attestation and continue the call.
549-
1. Finally create and sign the Identity header using the `private_key_file`, `public_cert_url`, `attest_level` and `send_mky` parameters from [tn](#tn), [profile](#profile) or [attestation](#attestation). If this fails, the call will be terminated.
556+
1. Finally create and sign the Identity header using the `private_key_file`, `public_cert_url`, `attest_level` and `send_mky` parameters from [tn](#tn-object), [profile](#profile-object) or [attestation](#attestation-object). If this fails, the call will be terminated.
550557

551558
## References
552559

0 commit comments

Comments
 (0)