chef / chef/knife-ec-backup

CHEF_FIPS=1 causes bad_sig and 401 Unauthorized from erchef

Open
#116 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
32
Forks
28
PR merge metrics
No merged PRs in 30d

Description

This is here as a bread crumb trail..

When the environment variable CHEF_FIPS is set to 1 a restore operation will send WARNING messages in obtuse ways that are not immediately obvious, like (xxxxx == redacted):

Restoring users
Updating user record for xxxxx
WARNING: Wrong number of users to update for xxxxx. Skipping
Updating user record for xxxxx
WARNING: Wrong number of users to update for xxxxx. Skipping
Updating user record for xxxxx
WARNING: Wrong number of users to update for xxxxx. Skipping
Updating user record for xxxxx
WARNING: Wrong number of users to update for xxxxxx. Skipping
Updating user record for xxxxx
WARNING: Wrong number of users to update for xxxxx. Skipping
...

The errors log from the exception handler has more clues:

  "message": "401 \"Unauthorized\"",
...
  "exception": "Net::HTTPServerException",
  "req_path": "/users",
  "req_method": "POST"

Erchef has the actual reason (bad_sig):

2017-10-31T19:17:03Z erchef@127.0.0.1 method=POST; path=/organizations; status=401; req_id=g3IAA2QAEGVyY2hlZkAxMjcuMC4wLjEDAAOs2gCgAAEAAAAA; msg=bad_sig; couchdb_groups=false; couchdb_organizations=false; couchdb_containers=false; couchdb_acls=false; 503_mode=false; couchdb_associations=false; couchdb_association_requests=false; req_time=2; rdbms_time=0; rdbms_count=1; user=pivotal; req_api_version=0;

The workaround for now is unsetting that environment variable then running the ec restore as normal :

export CHEF_FIPS=

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by reproducing an ec restore with CHEF_FIPS=1 and trace the POST requests, especially /users and /organizations, alongside erchef's bad_sig log. Done means the restore completes without 401 Unauthorized or bad_sig failures while FIPS mode remains enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
authentication, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.