@cmacneill and I did collaborate on the original announcement here, so if anyone is seeing misalignment in what we’re saying, please do let us know so that we can clarify any mis-understanding.
We don’t really have a good way to test this except by manually triggering the import process as you described. There’s a lot of moving parts in the site import process that are hard to replicate in an automated fashion.
As per this communication, when the site is reset/reimported we will get two /install callbacks both with the new client key – one again unsigned (why is this being sent at all in this case, is unclear)
It’s sent because the plugin on the Atlassian side exists within the imported site and has no knowledge of the prior installation that existed, so it can’t tell if the plugin being installed was previously installed. Therefore, the initial unsigned install request is sent as if the app is being installed for the first time.
then another one, signed, which we are supposed to trust based on the secret key stored in some other record, with a different clientKey, that just happens to have the same url , and once verified create a new subscription record that should supersede that other one that we just used to verify the request and never use it again.
The chain of trust that’s kept intact is the shared secret, which persists across the installations, and should only be known by Atlassian and by the app. An attacker could flood your app with /install requests, but they would not have the correct shared secret, so you would be able to verify that the request did not originate from Atlassian.
For the above to really work the record we use to verify the signature has to be trusted in the first place, so the app vendors must take some verification action (perform a callback to the instance the /install is claiming to be from) before any subscription record can be considered trusted?
So you’re saying that a malicious attacker could construct a fake initial install, with a bogus shared secret, and then send a follow-up request to override that install, because they still have that original secret? As long as the install data is isolated correctly, the attacker hasn’t gained any information that they didn’t already send to you in the first place, right? Let me know if I’m misunderstanding.
In the case that another entity takes the possession of the URL is there any stand down period? Does this somehow correspond to the 30 days deadline for “orphans”?
The process by which are previously claimed base URL could become available for re-use by a different customer or user is not a defined part of our API, but yes, it is substantially longer than the 30 day period for handling orphans (correct me if I’m wrong, @cmacneill?)
The way the “orphans” are defined in the above relies on a valid /install request arriving with a new clientKey. It seems to be implied that a record is never an orphan until this happens. Is this “unless you actively verify that an active Atlassian site actually exists on the other side and find that it doesn’t”?
Yes, orphan records could also already be created in your database through other mechanisms. For example, if a customer’s Atlassian site is deactivated and the uninstall lifecycle events are not transmitted correctly.
It’s unclear what methods to use to verify the ownership of data in the case of “site reset, app re-subscribed, oops where is my data?” and how (except for the length of the time period that has passed since the last known trusted interaction with the app) to distinguish a situation where the current owner of the data is asking to get their data back after site re-import from a situation where some other entity that somehow took possession of the URL is asking to get access to the data previously associated with this URL (via old clientKey)
Is it possible for you to use billing records or license information to verify the customer’s identity? The customer’s license data should uniquely identify them?
The user experience – on one hand to make it less stressful in the case “oops where is my data after reimport” it would be good to tell the customer that they can get it back if they reach out to our support. However, if the entity that just took possession of the URL is unrelated telling them “hey we happen to have somebody else’s data here do you want it?” sounds like a security hole.
Yes, I agree that there’s a trade-off on data privacy vs. usability here. We’ve erred on the side of caution by recommending that the customer ask for the data to be re-associated with their site before you take any action. However, I’m open to feedback if you discover that this process is causing some serious user friction.
- Possible mis-interpretations of “secret is keyed to the app key”. Can someone re-confirm what this really means?
It means that the generation of the secret is associated with the unique key of the app, not the client key of the site. If the client key changes, the secret remains the same.
Since presumably every distinct site gets a different secret, and apparently the secret survives the site reimport and clientKey change – does this mean that behind the scenes the secret is keyed to the app + URL?
Currently there is a single secret for the app shared across all installations/all sites. There are some downsides to this approach, so I’d recommend avoiding relying on this mechanic where possible (ie. assuming that the secrets can be different per site would be a more future-proof assumption).
I am also aware (from experience) that the subscription to the app on the Atlassian side (i.e. billing matters) somehow survive the re-import/site reset too.
Yes, the installed state of the app and the licensed state of the app are two mutually exclusive variables. So, it’s possible to have 4 states (installed & licensed, installed & unlicensed, un-installed but licensed, un-installed and un-licensed). Licensing data is stored in our central billing system and is re-associated with the customer’s imported site when they perform the re-installation of the app.
Hope this helps! I’m definitely getting out of my depth on the technicalities, so when in doubt, trust what Conor says 