Skip to content
This repository has been archived by the owner on Mar 2, 2024. It is now read-only.

22Q2-2 🐛 Fix setup MFA breaking due to grafana client ssm parameter #1005

Merged
merged 1 commit into from
Sep 1, 2022

Conversation

deifyed
Copy link
Member

@deifyed deifyed commented Aug 30, 2022

Description

  • Ensures that the user pool client used to setup the MFA device is the ArgoCD
    client

Motivation and Context

The ArgoCD user pool client secret uses a
/okctl/cluster name/component/client_secret format, but the Grafana user
pool client secret uses a /okctl/cluster name/client-secret format. This
inconsistency breaks retrieving a random client secret from the parameter store.

How to prove the effect of this PR?

First, verify that the setup-mfa command runs successfully with only the
ArgoCD user pool client by:

  1. Disable Grafana by setting integrations.kubePromStack to false and running
    okctl apply cluster
  2. Verify that okctl setup-mfa works as expected.

Then verify that it breaks when ArgoCD user pool client is not available by:

  1. Set integrations.argocd to false, and run okctl apply cluster.
  2. Verify that okctl setup-mfa breaks

Additional info

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated the release notes (for the next release).

@deifyed deifyed requested a review from a team August 30, 2022 14:47
@sonarcloud
Copy link

sonarcloud bot commented Aug 30, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@codecov
Copy link

codecov bot commented Aug 30, 2022

Codecov Report

Merging #1005 (612802a) into master (98ddfc8) will decrease coverage by 0.97%.
The diff coverage is 27.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1005      +/-   ##
==========================================
- Coverage   46.23%   45.25%   -0.98%     
==========================================
  Files         241      242       +1     
  Lines        7481     7634     +153     
==========================================
- Hits         3459     3455       -4     
- Misses       4022     4179     +157     
Impacted Files Coverage Δ
pkg/api/component_api.go 0.00% <ø> (ø)
pkg/api/core/service_kvstore_api.go 0.00% <0.00%> (ø)
pkg/api/core/service_objectstorage.go 0.00% <0.00%> (ø)
pkg/api/kvstore_api.go 0.00% <ø> (ø)
pkg/api/objectstorage_api.go 0.00% <ø> (ø)
pkg/apis/okctl.io/v1alpha1/types.go 0.00% <ø> (ø)
pkg/binaries/run/eksctl/eksctl.go 73.17% <ø> (ø)
pkg/cfn/components/composer.go 2.64% <0.00%> (-0.18%) ⬇️
pkg/cfn/namer.go 0.00% <0.00%> (ø)
pkg/client/core/service_autoscaler.go 0.00% <ø> (ø)
... and 25 more

Copy link
Contributor

@yngvark yngvark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks splendid!

Comment on lines +151 to +153
// This should be any of the clients provisioned by okctl, but due to inconsistent naming of the Grafana client
// secret SSM parameter and the situation regarding golden path we'll settle on picking the ArgoCD client for
// now. This breaks MFA for environments without ArgoCD.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great notification 👍

@deifyed deifyed merged commit 9125863 into master Sep 1, 2022
@deifyed deifyed deleted the 22Q2-2-fix-parameter-store-assumption branch September 1, 2022 08:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants