Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

PAM Integration With ASP.Net Core using SDK Integration in web.config and appsettings.json #13

Open
amshekar opened this issue May 13, 2019 · 1 comment

Comments

@amshekar
Copy link

amshekar commented May 13, 2019

Dear Thycoti team,
We are using your PAM product for our enterprise ,I have gone through the wiki and we want to use the option 2#
SDK Integration in web.config (NetStandard 2.0)
Can Some one from Thycotic or any PAM developer can help us to provide some example or step by step process to Integrate ASP.Net Core 2.1 with app settings.json instead of web.config

As a consumer of PAM want to explore multiple options to find the best feasible and less impact solution to finalize to use in our application.

@afalahi @tonygambone @ivanpfeff @JeremyThycotic @CordThycotic @noahhai

@amshekar amshekar changed the title PAM Integration With ASP.Net Core using SDK Integration in web.config PAM Integration With ASP.Net Core using SDK Integration in web.config and appsettings.json Jun 11, 2019
@josephmoss
Copy link

There is no official solution from Thycotic to achieve this so I wrote a custom configuration provider .Net Core to mimic the features of web.config secret replacement. Read the article linked below and it should give you an idea of how to achieve your goals.

You'll want to extend the functionality of the provider in the example below to do the following:

  1. Create an instance of the SecretServerClient with the config passed in from a Thycotic key in the appsettings.json file.
  2. Loop through the AppSettings and ConnectionStrings nodes from the configuration.
  3. Parse any lines containing a secret id and then use the Thycotic SDK to retrieve the secret and replace the values in memory.

When your app starts, the secret placeholders in your appsettings.json file will have been replaced with the actual values from Thycotic. This allows the parts of your program to consume the secrets without any additional changes.

After you're satisfied when your provider, package your assembly as a Nuget package and publish it via internal repository for use in your other apps. Your other apps will just need to add a reference to your Nuget package and hook into your custom provider.

Unfortunately, I can't share the code but it's very similar to the examples in the below article.

https://codeburst.io/create-a-custom-configuration-provider-in-asp-net-core-cdd6a32b8ecb

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants