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

Go upgrade, Azure SDK upgrade with azure api scan filtering enabled #5870

Merged
merged 24 commits into from
Oct 26, 2021

Conversation

vivekshankar1
Copy link
Collaborator

@vivekshankar1 vivekshankar1 commented Oct 7, 2021

🔩 Description: What code changed, and why?

In azure API scan we were not able to filter subscriptions. Lets say if any user has 1000 subscriptions and they want to run scans for some particular subscriptions it wasn't possible earlier. This change used the latest version of Azure SDK which helps us to gets the tags. We have added some filtering logic that can be used to choose particular subscriptions out of many. Scans will also use the chosen filters
To make this possible, we had to update Azure sdk, that relies on go 1.15 or more, so we had to update go version too. Pr also contains fix for common name support in certificate which requires env GODEBUG=x509ignoreCN=0 to be set to support legacy certificates.
Azure filtering and scanning supports wildcard matches too.

⛓️ Related Resources

👍 Definition of Done

  • All services should build properly
  • Go version should be upgraded to 1.15
  • We should be able to filter subscriptions by name, tags
  • Compliance scans should run using those selected filters

👟 How to Build and Test the Change

STEP 1
inside the hab studio

[default:/src:0]# build components/automate-ui-devproxy/
[default:/src:0]# start_automate_ui_background
[default:/src:0]# start_all_services
[default:/src:0]# rebuild components/automate-scaffolding-go/
[default:/src:0]# local_scaffolding_origin=<your-username> rebuild components/nodemanager-service

STEP 2
open new window
go to automate UI path

$ cd components/automate-ui
and run the command 

npm run serve:hab

✅ 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.)
  • [x ] 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.2021-10-13.at.12.45.00.AM.mov

@netlify
Copy link

netlify bot commented Oct 7, 2021

👷 Deploy Preview for chef-automate processing.

🔨 Explore the source changes: 95c6e1a

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

@vivekshankar1 vivekshankar1 force-pushed the vivek-shankar/go-upgrade-1.15 branch 2 times, most recently from d551af9 to c1db68d Compare October 11, 2021 19:35
@vivekshankar1 vivekshankar1 changed the title Vivek shankar/go upgrade 1.15 Go upgrade, Azure SDK upgrade with azure api scan filtering enabled Oct 12, 2021
@vivekshankar1 vivekshankar1 added Team: S.H.I.E.L.D. This Label is used on S.H.I.E.L.D. Operations (Tasks / Stories) and removed WIP labels Oct 12, 2021
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: 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: 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: 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: 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: 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>
@sonarcloud
Copy link

sonarcloud bot commented Oct 25, 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 5 Code Smells

9.8% 9.8% Coverage
0.0% 0.0% Duplication

@vivek-yadav vivek-yadav merged commit d8f3b1a into main Oct 26, 2021
@vivek-yadav vivek-yadav deleted the vivek-shankar/go-upgrade-1.15 branch October 26, 2021 11:24
dkumaras pushed a commit that referenced this pull request Oct 26, 2021
…5870)

* scaffolding version and golang version

Signed-off-by: Vivek Shankar <vshankar@progress.com>

* changes for azure sdk upgrade

Signed-off-by: Vivek Shankar <vshankar@progress.com>

* license scout crypto

Signed-off-by: Vivek Shankar <vshankar@progress.com>

* added filtering in backend api for api scan azure

Signed-off-by: Vivek Shankar <vshankar@progress.com>

* fixed duplicates

Signed-off-by: Vivek Shankar <vshankar@progress.com>

* revert changes on go.sum

Signed-off-by: Vivek Shankar <vshankar@progress.com>

* revert changes on go.sum

Signed-off-by: Vivek Shankar <vshankar@progress.com>

* fixed integration test cases for azure api

Signed-off-by: Vivek Shankar <vshankar@progress.com>

* add go sum

Signed-off-by: Vivek Shankar <vshankar@progress.com>

* certificate incompatibility issue fix for go 1.15

Signed-off-by: Vivek Shankar <vshankar@progress.com>

* filter logic modified

Signed-off-by: Vivek Shankar <vshankar@progress.com>

* added fget fields

Signed-off-by: Vivek Shankar <vshankar@progress.com>

* removed logs and extra lines

Signed-off-by: Vivek Shankar <vshankar@progress.com>

* added unit and integration tests

Signed-off-by: Vivek Shankar <vshankar@progress.com>

* added unit and integration tests

Signed-off-by: Vivek Shankar <vshankar@progress.com>

* print subs

Signed-off-by: Vivek Shankar <vshankar@progress.com>

* check integration test

Signed-off-by: Vivek Shankar <vshankar@progress.com>

* added go debug env

Signed-off-by: Vivek Shankar <vshankar@progress.com>

* init method added for GODEBUG

Signed-off-by: Vivek Shankar <vshankar@progress.com>

* added tests of env

Signed-off-by: Vivek Shankar <vshankar@progress.com>

* set GODEBUG to PIPELINE

Signed-off-by: Vivek Shankar <vshankar@progress.com>

* more tests added

Signed-off-by: Vivek Shankar <vshankar@progress.com>

* refactored and timeout increase

Signed-off-by: Vivek Shankar <vshankar@progress.com>

* revereted vm changes

Signed-off-by: Vivek Shankar <vshankar@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.

None yet

3 participants