This is more of a request of auditing my approach, thus asking here might not the best way, and I apologize for that, but I really don't know how to otherwise talk to cryptography experts. I have some basic knowledge about crypto and grasp (I hope!) the fundamental pieces, but I also feel that it's easy to overlook some aspect when putting all together. I'll strive to make this question the more general as possible, so to help others in similar situations.
Scenario
Imagine an application that is responsible handling AES-encrypted files. Upon startup it asks the user for a passphrase, and it derives a suitable key from it, which is kept in memory for the lifespan of the process and never stored persistently. The application uses this key to encrypt/decrypt files on some persistent storage.
The following assumptions hold:
the application runs on a trusted device, thus it is assumed that the derived key is not leaked nor read from memory;
the source code of the application is publicly available;
the persistent storage is untrusted (meaning that it can be leaked).
Encryption
AES-128 is used for encryption. A cryptographically secure random IV is generated for, and written to each file, followed by the actual ciphertext.
Key derivation
PBKDF2 is used to derive the AES key, with the following parameters:
an hardcoded salt, whose only purpose is to avoid the use of precomputed table to try to obtain the passphrase, the application is already compromised if the derived key is somehow leaked;
a hardcoded number of iterations set to a quite high value, say 1,000,000;
a key length of 16 (for AES-128);
SHA 512 as the hash function.
Is it better in this case something derived from the password as a salt? I know it's bad practice when storing hashes as it would nullify the purpose of the salt in the first place. But here it would prevent the hypothetical scenario in which a motivated attacker starts building a precomputed table with the hardcoded salt.
Is SHA 512 a good choice here?
Possible attacks (that I can think of)
Assuming an attacker to get a hold of some encrypted file, they can attempt to:
bruteforce the 128 bit key until some meaningful content comes out (unfeasible);
bruteforce the passphrase until some meaningful content comes out (unfeasible, due to the deliberate slowness of PBKDF2, unless a trivial passphrase is used).
Should I be aware of any other possible attacks?
Additional questions
Is this approach sound?
Can it be improved in some trivial way?