Skip to content

Unable to view credentials via API or slcli for an HSM Device #1013

@akkowals

Description

@akkowals

Please triple-check to make sure that you have properly masked out user credentials like usernames, passwords and API keys before submitting your issue

Hi,

I have ordered a Hardware Security Module (HSM) from SoftLayer and trying to build automation around interacting with it. In the UI, I can view the "passwords" section to view the initially set "hsm_admin" credentials. I cannot, however, view that same information via the API or slcli. If I attempt to view the credentials for the HSM device via slcli I encounter the following stacktrace suggesting I open an issue here.

drews-mbp-2:ms-job akkowals$ slcli hardware credentials 1537051
An unexpected error has occured:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/SoftLayer/CLI/core.py", line 163, in main
    cli.main(**kwargs)
  File "/Library/Python/2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Library/Python/2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Library/Python/2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Library/Python/2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Library/Python/2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args[1:], **kwargs)
  File "/Library/Python/2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/SoftLayer/CLI/hardware/credentials.py", line 25, in cli
    for item in instance['operatingSystem']['passwords']:
KeyError: 'passwords'

Feel free to report this error as it is likely a bug:
    https://github.com/softlayer/softlayer-python/issues

Further clarification: I found this git issue #981 but the fix there appears to be just not failing with a stacktrace (instead raise an exception) if passwords don't get returned by the API...Are HSM credentials not allowed to be obtainable via API or slcli?

Expected Behavior

I expected to be able to view the operating system passwords like other devices (VSIs, baremetals etc) so I can automate tasks related to the HSM.

Actual Behavior

The API does not return a "passwords" section for the "SoftLayer_Software_Component_OperatingSystem" datatype even when the mask used specifies it. slcli likely hits the same issue.

Environment Information

Operating System: macOS High Sierra 10.13.6
softlayer-python version (slcli --version): slcli (SoftLayer Command-line), version 5.3.2

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions