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

Address Vulnerabilities in Admin Portal v1/v2 #2530

Merged

Conversation

carlowisse
Copy link
Collaborator

Which issue this PR addresses:

ADO Card

  • Fixes vulnerabilities in admin portal v1 and v2
  • Updates ALL NPM packages to their latest
  • Updates Admin Portal v1 to use Bootstrap v5+ (required a slight change to index.html to support)

What this PR does / why we need it:

Dependabot picked up on several vulnerabilities in NPM packages used by admin portal v1 and v2. Namely the following 2:

  1. minimatch
  2. loader-utils

Loader Utils is a bit of a tricky one because we don't call it directly, a few of our dependencies, dependcies require it at version 2 verbatim. While the latest version is 3.2.0, if we force version 3, it breaks build for admin portal v2 as the new version removed a core function that is required by our dependencies dependencies.

However, the developer has updated 2.0.0 to 2.0.3 to address vulnerabilities which I am now forcing all dependencies to use. It does not directly relate to the regex vulnerability, however with good regex practices the vulnerability is mitigated. I also noted that the alert for this vulnerability mentions the use of react-scripts 4.0.3, which we are no longer using anywhere (upgraded to 5.0.3).

More can be read here:

  1. GitHub Issue 1
  2. GitHub Issue 1
  3. GitHub Issue 1

Test plan for issue:

  • E2E
  • Manual tests:

V1

npm audit    
found 0 vulnerabilities

npm outdated
-

V2

npm audit    
found 0 vulnerabilities

npm outdated
-

Is there any documentation that needs to be updated for this PR?

No.

… frontend to use and support Bootstrap v5. Removed unused libraries in package.json. Cleaned up package.json files.
@ellis-johnson
Copy link
Contributor

LGTM!

@github-actions github-actions bot added the needs-rebase branch needs a rebase label Nov 10, 2022
@github-actions
Copy link

Please rebase pull request.

@github-actions github-actions bot removed the needs-rebase branch needs a rebase label Nov 10, 2022
Copy link
Contributor

@s-amann s-amann left a comment

Choose a reason for hiding this comment

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

lgtm

@darthhexx
Copy link
Contributor

Good to merge on green E2E.

@karanmagdani
Copy link
Contributor

karanmagdani commented Nov 10, 2022

Test plan for issue:
E2E
Manual tests:

Did we check the portal UI with these changes to make sure nothing is broken? I don't want to hold this PR and subsequent Release because of this, but at the same time having a broken portal can cause issues for oncall

I guess we can test this once it gets to canary

@cblecker cblecker merged commit 00f1604 into Azure:master Nov 10, 2022
@carlowisse
Copy link
Collaborator Author

Hey Karan, yes I tested and re-tested this (locally) after each rebase and after each upgrade to a package to see (if) anything broke and then iteratively fixed as I went.

This upgrade did break the v1 portal which is why there are block changes to the frontend code for v1. Nothing much changed for v2 besides it becoming a little faster.

@karanmagdani
Copy link
Contributor

Thanks @carlowisse

@carlowisse carlowisse deleted the address-admin-portal-vulnerabilities branch November 17, 2022 02:01
cfsmikedrum pushed a commit to CloudFitSoftware/ARO-RP that referenced this pull request Dec 8, 2022
… frontend to use and support Bootstrap v5. Removed unused libraries in package.json. Cleaned up package.json files. (Azure#2530)
cfsmikedrum pushed a commit to CloudFitSoftware/ARO-RP that referenced this pull request Dec 8, 2022
… frontend to use and support Bootstrap v5. Removed unused libraries in package.json. Cleaned up package.json files. (Azure#2530)
cfsmikedrum pushed a commit to CloudFitSoftware/ARO-RP that referenced this pull request Dec 8, 2022
… frontend to use and support Bootstrap v5. Removed unused libraries in package.json. Cleaned up package.json files. (Azure#2530)
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.

None yet

6 participants