For security issue, customer don't want the sensitive data visible in EC2 user data. So they would like to know how to secure sensitive information in EC2 user data. Below is the example of Diego_cell instance's EC2 user data in AWS console:
Product Version: 2.10
Enclosed is a list of credentials maintained in the user-data field.
Credentials in User-Data:
| Key | Credential Type |
|---|---|
blobstore.options.access_key_id | ID |
blobstore.options.secret_access_key | Key |
blobstore.options.password | Password |
env.bosh.password | Password |
env.bosh.mbus.cert.ca | Root CA |
env.bosh.mbus.cert.private_key | Private Key |
env.bosh.mbus.cert.certificate | Certificate |
env.bosh.blobstores.options.tls.cert.ca | Root CA |
env.bosh.blobstores.options.password | Password |
These credentials map to the respective system components:
| Key | System Component |
|---|---|
blobstore.options.access_key_id | Blobstore |
blobstore.options.secret_access_key | Blobstore |
blobstore.options.password | Blobstore |
env.bosh.password | BOSH vcap user |
env.bosh.mbus.cert.ca | NATS Messaging System |
env.bosh.mbus.cert.private_key | NATS Messaging System |
env.bosh.mbus.cert.certificate | NATS Messaging System |
env.bosh.blobstores.options.tls.cert.ca | Blobstore |
env.bosh.blobstores.options.password | Blobstore |
General Recommendations
How to Guide
1) For blobstore.options.access_key_id, it can be secured by Enable signed URLs in Director Config --> Blobstore Location and all bosh VMs will need to be recreated (e.g, if you've already deployed with the SignedURLs unselected, you'd need to tick this box and ALSO check the Director Config --> Recreate VMs deployed by the BOSH Director).
Note: Only major requirement is stemcells need to at least be xenial 621 line.
2) For securing env.bosh.mbus.cert.private_key and env.bosh.mbus.cert.certificate, Ops Manager 3.0.5 shipped with a short lived NATS certificates to solve this problem. This feature has been released on Operations Manager 3.0.5 and it will affect only newly created/recreated VMs. If you want to configure VMs in existing Tanzu Operations Manager deployments to use short-lived bootstrap credentials, you must recreate them.
Note: When an installation is using this feature it is a MUST to ensure that the stemcells used in the director are compatible with it; stemcells that are incompatible will result in unresponsive VMs. The oldest compatible stemcell versions are: