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

Fix for Masking User Cred in PG DB URI #5845

Merged
merged 5 commits into from
Oct 4, 2021

Conversation

vivek-yadav
Copy link
Collaborator

@vivek-yadav vivek-yadav commented Oct 4, 2021

🔩 Description: What code changed, and why?

In Data feed service Connection string was having user credentials, and we were logging them in plain text.
Now, the Connection String is Masked so while logging the user credentials are not logged.

⛓️ Related Resources

Bug : #5846

👍 Definition of Done

On the start of the data-feed-service, the data-feed-service logs contain only Masked Database connection string.

👟 How to Build and Test the Change

rebuild components/data-feed-service
Logs of data-feed-service should not have user credentials as part of PG Connection string.

go test components/data-feed-service/config/mask_test.go

✅ Checklist

All PRs must tick these:

With occasional exceptions, all PRs from Progress employees must tick these:

  • Is the code clear? (complicated code or lots of comments--subdivide and use well-named methods, meaningful variable names, etc.)
  • Consistency checked? (user notifications, user prompts, visual patterns, code patterns, variable names)
  • Repeated code blocks eliminated? (adapt and reuse existing components, blocks, functions, etc.)
  • Spelling, grammar, typos checked? (at a minimum use make spell in any component directory)
  • Code well-formatted? (indents, line breaks, etc. improve rather than hinder readability)

All PRs from Progress employees should tick these if appropriate:

  • Tests added/updated? (all new code needs new tests)
  • Docs added/updated? (all customer-facing changes)

Please add a note next to any checkbox above if you are NOT ticking it.

📷 Screenshots, if applicable

@vivek-yadav vivek-yadav added the Team: S.H.I.E.L.D. This Label is used on S.H.I.E.L.D. Operations (Tasks / Stories) label Oct 4, 2021
@netlify
Copy link

netlify bot commented Oct 4, 2021

👷 Deploy Preview for chef-automate processing.

🔨 Explore the source changes: 8daabcf

🔍 Inspect the deploy log: https://app.netlify.com/sites/chef-automate/deploys/615b2c97b843c00007414226

Copy link
Collaborator

@vivekshankar1 vivekshankar1 left a comment

Choose a reason for hiding this comment

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

working fine, thanks

Signed-off-by: Vivek Yadav <vivek.yadav@progress.com>
Signed-off-by: Vivek Yadav <vivek.yadav@progress.com>
Signed-off-by: Vivek Yadav <vivek.yadav@progress.com>
Signed-off-by: Vivek Yadav <vivek.yadav@progress.com>
Signed-off-by: Vivek Yadav <vivek.yadav@progress.com>
@vivek-yadav vivek-yadav force-pushed the vivek-yadav/fix_db_cred_in_logs branch from 82d8c8a to 8daabcf Compare October 4, 2021 16:32
@sonarcloud
Copy link

sonarcloud bot commented Oct 4, 2021

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 1 Code Smell

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Copy link
Collaborator

@kalroy kalroy left a comment

Choose a reason for hiding this comment

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

Awesome!! LGTM 🥳

@vivek-yadav vivek-yadav merged commit 319c43d into main Oct 4, 2021
@vivek-yadav vivek-yadav deleted the vivek-yadav/fix_db_cred_in_logs branch October 4, 2021 17:55
vivek-yadav added a commit that referenced this pull request Oct 6, 2021
…id and generate report (#5792)

* removed subsctoption id

Signed-off-by: MadhviA <matroliy@progress.com>

* removed subsctoption id

Signed-off-by: MadhviA <matroliy@progress.com>

* removed custom typeError line

Signed-off-by: MadhviA <matroliy@progress.com>

* Revert "removed custom typeError line"

This reverts commit 34827f7.

* removed custom typeError line

Signed-off-by: MadhviA <matroliy@progress.com>

* Removed console.log

Signed-off-by: MadhviA <matroliy@progress.com>

* merging conflicts from main

Signed-off-by: MadhviA <matroliy@progress.com>

* Fix for Masking User Cred in PG DB URI (#5845)

* masked DB String in logs

Signed-off-by: Vivek Yadav <vivek.yadav@progress.com>

* mask PG cred in URI

Signed-off-by: Vivek Yadav <vivek.yadav@progress.com>

* info string change

Signed-off-by: Vivek Yadav <vivek.yadav@progress.com>

* move files to data-feed-service

Signed-off-by: Vivek Yadav <vivek.yadav@progress.com>

* added postgresql: in regex

Signed-off-by: Vivek Yadav <vivek.yadav@progress.com>

* fix: a2ha habitat cert issue (#5834)

Signed-off-by: meet58 <mgadhiya@msystechnologies.com>

* Adding info and ssh commands to automate-cli (#5716)

* Adding info and ssh commands

Signed-off-by: FaizanSRE <ffulara@msystechnologies.com>

* Did gofmt of new go files

Signed-off-by: FaizanSRE <ffulara@msystechnologies.com>

* Addind help for info command

Signed-off-by: FaizanSRE <ffulara@msystechnologies.com>

* removed comments

* Apply suggestions from code review

Co-authored-by: Kallol Roy <karoy@progress.com>
Signed-off-by: FaizanSRE <ffulara@msystechnologies.com>

Co-authored-by: Kallol Roy <karoy@progress.com>

* Executed '.expeditor/generate-automate-cli-docs.sh'

Obvious fix; these changes are the result of automation not creative thinking.

* Tail logs, Needed to show log in run-time for deploy and provision (#5833)

* Signed-off-by: jay vikram sharma <jsharma@progress.com>
tail logs from file in main thread, and pgleaderchk in product.meta

* Signed-off-by: jay vikram sharma <jsharma@progress.com>
changing log messages

* Signed-off-by: jay vikram sharma <jsharma@progress.com>
printing error instead of return for tailFile

* Signed-off-by: jay vikram sharma <jsharma@progress.com>
removing un-used dependencies

* Signed-off-by: jay vikram sharma <jsharma@progress.com>
removing un-used dependencies

* Signed-off-by: jay vikram sharma <jsharma@progress.com>
we had missed one changes regarding fetching package name from current manifest, we added in this PR

Co-authored-by: jay vikram sharma <jsharma@progress.com>

* Remove the cacert for DST RootCA X3 (#5844)

* Remove the cacert for DST RootCA X3

Signed-off-by: Kallol Roy <karoy@progress.com>

* Exclude the cacert file from check

Signed-off-by: Kallol Roy <karoy@progress.com>

* indentation changes

Signed-off-by: MadhviA <matroliy@progress.com>

* removed subsctoption id

Signed-off-by: MadhviA <matroliy@progress.com>

* removed subsctoption id

Signed-off-by: MadhviA <matroliy@progress.com>

* removed custom typeError line

Signed-off-by: MadhviA <matroliy@progress.com>

* Revert "removed custom typeError line"

This reverts commit 34827f7.

* removed custom typeError line

Signed-off-by: MadhviA <matroliy@progress.com>

* Removed console.log

Signed-off-by: MadhviA <matroliy@progress.com>

* merging conflicts from main

Signed-off-by: MadhviA <matroliy@progress.com>

* indentation changes

Signed-off-by: MadhviA <matroliy@progress.com>

* changed cypress indentation

Signed-off-by: MadhviA <matroliy@progress.com>

Co-authored-by: MadhviA <matroliy@progress.com>
Co-authored-by: Vivek Yadav <vivek.yadav@progress.com>
Co-authored-by: meet.gadhiya <60958104+meet58@users.noreply.github.com>
Co-authored-by: Faizan <60912283+FaizanSRE@users.noreply.github.com>
Co-authored-by: Kallol Roy <karoy@progress.com>
Co-authored-by: Chef Expeditor <chef-ci@chef.io>
Co-authored-by: Jay Vikram Sharma <36661596+jayvikramsharma1@users.noreply.github.com>
Co-authored-by: jay vikram sharma <jsharma@progress.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acceptance: verified Team: S.H.I.E.L.D. This Label is used on S.H.I.E.L.D. Operations (Tasks / Stories)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Data feed logs having Postgres Connection string with User Credentials in Plain Text
4 participants