The most secure approach is B. Use the instance's service account Application Default Credentials to authenticate to the required resources.
Here's why:
Application Default Credentials (ADC): ADC is a Google Cloud feature that allows applications running on Google Cloud to automatically authenticate using the service account associated with the instance. This eliminates the need to store credentials directly on the instance, reducing security risks.
No Manual Credential Management: ADC handles authentication automatically, eliminating the need to manually manage credentials, which can be error-prone and introduce security vulnerabilities.
Key Rotation: Google Cloud automatically rotates service account keys, further enhancing security.