[SRU] Azure Datasource writes user password in plain text

Bug #1458052 reported by Ben Howard on 2015-05-22
264
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init (Ubuntu)
Medium
Unassigned
Precise
High
Unassigned
Trusty
High
Unassigned
Utopic
High
Unassigned
Vivid
High
Unassigned

Bug Description

SRU Justification

[IMPACT] When provisioning a virtual machine on Azure, a user password may be provided. Cloud-init retrieves the password via ovf-env.xml (stored on a CDROM) which is then written to /var/lib/waagent/ovf-env.xml for later consumption by the WALinuxAgent. After first boot provisioning the user password is not needed by cloud-init.

While the password is stored in plain text on disk, the password is _NOT_ accessible to a non-privelaged user. Both the directory and the file
itself are read-only:

$ stat /var/lib/waagent/
  File: ‘/var/lib/waagent/’
  Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 801h/2049d Inode: 2532 Links: 2
Access: (0700/drwx------) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2015-04-13 11:44:08.021992200 +0000
Modify: 2015-04-13 11:44:11.341805500 +0000
Change: 2015-04-13 11:44:11.341805500 +0000
 Birth: -

$ sudo stat /var/lib/waagent/ovf-env.xml
  File: ‘/var/lib/waagent/ovf-env.xml’
  Size: 1633 Blocks: 8 IO Block: 4096 regular file
Device: 801h/2049d Inode: 2556 Links: 1
Access: (0600/-rw-------) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2015-04-13 11:44:08.021992200 +0000
Modify: 2015-04-13 11:44:08.021992200 +0000
Change: 2015-04-13 11:44:08.021992200 +0000
 Birth: -

[GUIDANCE STATEMENT] Canonical's guidance on this matter is that any password provided by a fabric is inherently insecure; users should leverage SSH keys.

[Regression Potential] As this is a backport of the 15.10 Datasource, there is a medium regression potential. The 15.10 Datasource fixes a number of Azure provisioning bugs and is thus desirable.

The updated Datasource includes additional automated testing to confirm code quality.

[TEST Case 1] Upgrade from proposed
1. Install cloud-init from -proposed
2. Shutdown and capture VM
3. Launch captured VM
4. Confirm that the user password is set to "REDACTED" in /var/lib/waagent/ovf-env.xml

[TEST Case 2] New build from proposed
1. Build image from proposed
2. Launch new VM
3. Confirm that the user password is set to "REDACTED" in /var/lib/waagent/ovf-env.xml

Patch in Cloud-init REV 1109.

description: updated
Jamie Strandboge (jdstrand) wrote :
Changed in cloud-init (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Jamie Strandboge (jdstrand) wrote :

Per Ben, precise - wily is affected. 14.04 and higher should be able to use the attached patch. 12.04 likely needs a different patch.

Jamie Strandboge (jdstrand) wrote :

Per IRC:
- Ben will atach patch for precise
- security team will alert oss-security prior to USN publication and get a CVE
- security team will prepare patches for stable releases and release USNs
- server team has SRU fixes and will build those on top of our USN packages
- server team will update wily

Attached patch for 12.04. Tested and validated.

description: updated
Seth Arnold (seth-arnold) wrote :

We've decided this is a "security hardening" measure rather than a security issue, and thus won't apply for a CVE and won't attempt an embargoed coordination with other vendors: any process that has sufficient privileges to read this file and thus the password has every opportunity to perform dozens of other privileged operations that would expose or reset this password.

Ben said he'd follow through with the SRU process; this makes sense to us.

Thanks

information type: Private Security → Public Security
tags: added: patch
Changed in cloud-init (Ubuntu Vivid):
importance: Undecided → High
Changed in cloud-init (Ubuntu Utopic):
importance: Undecided → High
Changed in cloud-init (Ubuntu Trusty):
importance: Undecided → High
Changed in cloud-init (Ubuntu Precise):
importance: Undecided → High
Changed in cloud-init (Ubuntu Vivid):
status: New → Fix Released
assignee: nobody → Ben Howard (utlemming)
Changed in cloud-init (Ubuntu Utopic):
assignee: nobody → Ben Howard (utlemming)
Changed in cloud-init (Ubuntu Trusty):
assignee: nobody → Ben Howard (utlemming)
Changed in cloud-init (Ubuntu Precise):
assignee: nobody → Ben Howard (utlemming)
summary: - Azure Datasource writes user password in plain text
+ [SRU] Azure Datasource writes user password in plain text
Changed in cloud-init (Ubuntu):
status: Triaged → Fix Released
Changed in cloud-init (Ubuntu Vivid):
status: Fix Released → In Progress
Changed in cloud-init (Ubuntu):
status: Fix Released → Triaged

Hello Ben, or anyone else affected,

Accepted cloud-init into vivid-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cloud-init/0.7.7~bzr1091-0ubuntu2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in cloud-init (Ubuntu):
status: Triaged → Fix Released
Changed in cloud-init (Ubuntu Vivid):
status: In Progress → Fix Committed
tags: added: verification-needed
Brian Murray (brian-murray) wrote :

Hello Ben, or anyone else affected,

Accepted cloud-init into utopic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cloud-init/0.7.6~bzr1022-0ubuntu4 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in cloud-init (Ubuntu Utopic):
status: New → Fix Committed
Changed in cloud-init (Ubuntu Trusty):
status: New → Fix Committed
Brian Murray (brian-murray) wrote :

Hello Ben, or anyone else affected,

Accepted cloud-init into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cloud-init/0.7.5-0ubuntu1.6 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Ran through the verification steps. Marking as verification-done.

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cloud-init - 0.7.5-0ubuntu1.6

---------------
cloud-init (0.7.5-0ubuntu1.6) trusty; urgency=medium

  * d/patches/lp-1375252-1458052-Azure-hostname_password.patch:
    Backport of 15.10 Azure Datasource to fix various issues:
    - Azure Datasource writes user password in plain text (LP: #1458052).
    - Hostname not preserved across Azure reboots (LP: #1375252).

 -- Ben Howard <email address hidden> Mon, 25 May 2015 09:30:20 -0600

Changed in cloud-init (Ubuntu Trusty):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for cloud-init has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cloud-init - 0.7.6~bzr1022-0ubuntu4

---------------
cloud-init (0.7.6~bzr1022-0ubuntu4) utopic; urgency=medium

  * d/patches/lp-1375252-1458052-Azure-hostname_password.patch:
    Backport of 15.10 Azure Datasource to fix various issues:
    - Azure Datasource writes user password in plain text (LP: #1458052).
    - Hostname not preserved across Azure reboots (LP: #1375252).

 -- Ben Howard <email address hidden> Mon, 25 May 2015 08:53:25 -0600

Changed in cloud-init (Ubuntu Utopic):
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cloud-init - 0.7.7~bzr1091-0ubuntu2

---------------
cloud-init (0.7.7~bzr1091-0ubuntu2) vivid; urgency=medium

  * Backport of 15.10 Azure Datasource to fix various issues:
    - Azure Datasource writes user password in plain text (LP: #1458052).
    - Hostname not preserved across Azure reboots (LP: #1375252).
    - Allow provisioning of Ubuntu Snappy w/out WALinuxAgent (LP: #1448885).

 -- Ben Howard <email address hidden> Mon, 25 May 2015 09:38:58 -0600

Changed in cloud-init (Ubuntu Vivid):
status: Fix Committed → Fix Released
Stephen A. Zarkos (stevez) wrote :

Ben, is it possible to SRU this fix back to Precise as well? At least on Azure we still have plenty of folks that use and love this version.

Thanks,
Steve

Changed in cloud-init (Ubuntu):
status: Fix Released → Fix Committed

Hello Ben, or anyone else affected,

Accepted cloud-init into precise-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cloud-init/0.6.3-0ubuntu1.22 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in cloud-init (Ubuntu Precise):
status: New → Fix Committed
tags: removed: verification-done
tags: added: verification-needed

Performed validation steps for 12.04. Marking as verification-done.

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cloud-init - 0.6.3-0ubuntu1.22

---------------
cloud-init (0.6.3-0ubuntu1.22) precise; urgency=medium

  * debian/patches/lp-1458052-redact-azure-password.patch:
     - redact plain text password in /var/lib/waagent/ovf.xml (LP: #1458052).

  [ Vincent Bernat ]
  * debian/patches/lp-1382481-cloudstack-vr.patch:
     - support CloudStack's basic networking (LP: #1382481).

 -- Ben Howard <email address hidden> Thu, 17 Sep 2015 12:57:16 -0600

Changed in cloud-init (Ubuntu Precise):
status: Fix Committed → Fix Released
Changed in cloud-init (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public Security information  Edit
Everyone can see this security related information.

Other bug subscribers

Bug attachments