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

SHIELD-71 SHIELD-78 Modified source of id_token. #7145

Merged
merged 22 commits into from
Jun 29, 2022

Conversation

atultherajput
Copy link
Member

@atultherajput atultherajput commented Jun 7, 2022

Signed-off-by: Atul Krishna Atul.Krishna@progress.com

🔩 Description: What code changed, and why?

Removed id_token cookie and changed API flow to retrieve id_token from the HTTP response body.

Currently, the id_token cookie doesn't have Secure and HttpOnly attributes. While it is possible to add the Secure attribute but we cannot add the HttpOnly attribute in the id_token cookie as we are accessing this cookie via javascript to store it in the browser's local storage. Check here for more details.

The proposed solution is to modify the existing sign-in API flow to get id_token from /session/callback API's response body instead of the cookie.

⛓️ Related Resources

https://chefio.atlassian.net/browse/SHIELD-64
https://chefio.atlassian.net/browse/SHIELD-71

#6716

👍 Definition of Done

The /session/callback API should have id_token and state in response body.

👟 How to Build and Test the Change

Pull the changes from the source branch
Start automate
Rebuild session-service
Rebuild automate-dex
Open UI in browser with network tab
Check response of /session/callback API after login. It should have id_token and state value in the response body.

✅ 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

Screen.Recording.2022-06-16.at.4.55.59.PM.mov

@atultherajput atultherajput self-assigned this Jun 7, 2022
@netlify
Copy link

netlify bot commented Jun 7, 2022

👷 Deploy Preview for chef-automate processing.

Name Link
🔨 Latest commit a83fe5f
🔍 Latest deploy log https://app.netlify.com/sites/chef-automate/deploys/62b568374001a50009f25d4b

@atultherajput atultherajput added the Team: S.H.I.E.L.D. This Label is used on S.H.I.E.L.D. Operations (Tasks / Stories) label Jun 9, 2022
@atultherajput atultherajput force-pushed the SHIELD-64-security-fixes-of-session-cookie branch from 43a53bc to 9c0f41f Compare June 10, 2022 09:23
@atultherajput atultherajput changed the title SHIELD-64 Added Secure in id_token cookie. SHIELD-64 Modified source of id_token. Jun 16, 2022
@atultherajput atultherajput changed the title SHIELD-64 Modified source of id_token. SHIELD-71 Modified source of id_token. Jun 16, 2022
@vivekshankar1 vivekshankar1 changed the title SHIELD-71 Modified source of id_token. SHIELD-71 SHIELD-78 Modified source of id_token. Jun 21, 2022
atultherajput and others added 7 commits June 22, 2022 12:56
Signed-off-by: Atul Krishna <Atul.Krishna@progress.com>
Signed-off-by: Atul Krishna <Atul.Krishna@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Atul Krishna <Atul.Krishna@progress.com>
vivekshankar1 and others added 10 commits June 22, 2022 12:57
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Atul Krishna <Atul.Krishna@progress.com>
Signed-off-by: Atul Krishna <Atul.Krishna@progress.com>
Signed-off-by: Atul Krishna <Atul.Krishna@progress.com>
Signed-off-by: Atul Krishna <Atul.Krishna@progress.com>
Signed-off-by: Atul Krishna <Atul.Krishna@progress.com>
Signed-off-by: Atul Krishna <Atul.Krishna@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
@vivekshankar1 vivekshankar1 force-pushed the SHIELD-64-security-fixes-of-session-cookie branch from 6a23308 to 3230b81 Compare June 22, 2022 07:28
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Vivek Shankar <vshankar@progress.com>
Signed-off-by: Atul Krishna <Atul.Krishna@progress.com>
@sonarcloud
Copy link

sonarcloud bot commented Jun 24, 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 1 Code Smell

100.0% 100.0% Coverage
1.5% 1.5% Duplication

@vivek-yadav vivek-yadav merged commit 2ca05f9 into main Jun 29, 2022
@vivek-yadav vivek-yadav deleted the SHIELD-64-security-fixes-of-session-cookie branch June 29, 2022 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

None yet

6 participants