Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Service Principal with client cert auth #3498

Merged
merged 2 commits into from
Aug 7, 2024

Conversation

thomas11
Copy link
Contributor

@thomas11 thomas11 commented Aug 7, 2024

Run the existing Key Vault test one more time, authenticating with client cert auth that had no test coverage until now.

Resolves #3494

Successful run (since the PR tests skip this one); the OIDC test failures are unrelated.

The certificate is newly created for this purpose only, via

openssl req -subj '/CN=myclientcertificate/O=Pulumi, Inc./ST=CA/C=US' \
    -new -newkey rsa:4096 -sha256 -days 730 -nodes -x509 -keyout ciCert.key -out ciCert.crt

openssl pkcs12 -export -macalg sha1 -certpbe PBE-SHA1-3DES -keypbe PBE-SHA1-3DES -password pass:REDACTED -out ciCert.pfx -inkey ciCert.key -in ciCert.crt

The cert and the password are added as GH secrets to this repo, as ARM_CLIENT_CERTIFICATE and ARM_CLIENT_CERTIFICATE_PASSWORD. The cert secret is the base64-encoded content of the .pfx file since GH secrets cannot be files.

The cert and the password are also added to 1Password in the "Azure credentials" entry.

@thomas11 thomas11 requested review from danielrbradley and a team August 7, 2024 09:10
Copy link

codecov bot commented Aug 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 58.23%. Comparing base (182a0ad) to head (d5d0637).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3498      +/-   ##
==========================================
- Coverage   58.25%   58.23%   -0.02%     
==========================================
  Files          67       67              
  Lines        8420     8416       -4     
==========================================
- Hits         4905     4901       -4     
  Misses       3068     3068              
  Partials      447      447              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Aug 7, 2024

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

Copy link
Member

@danielrbradley danielrbradley left a comment

Choose a reason for hiding this comment

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

Test looks good 👍

One question on a possible accidental comment.

@thomas11 thomas11 force-pushed the tkappler/client-cert-auth branch from 1a05434 to d5d0637 Compare August 7, 2024 12:29
@thomas11 thomas11 requested a review from a team August 7, 2024 12:32
@thomas11 thomas11 merged commit 26f5fd4 into master Aug 7, 2024
25 checks passed
@thomas11 thomas11 deleted the tkappler/client-cert-auth branch August 7, 2024 13:17
@mjeffryes mjeffryes added this to the 0.108 milestone Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test authentication via service principal with certificate
3 participants