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 tags so that they are rendered to string directly from struct #5483

Merged
merged 1 commit into from
Aug 18, 2021

Conversation

rickmarry
Copy link
Contributor

@rickmarry rickmarry commented Aug 12, 2021

Signed-off-by: Rick Marry rick.marry@gmail.com

πŸ”© Description: What code changed, and why?

this fixes bug #5399
This PR fixes a bug where control tags are not making in with the profile as it's stored in elasticsearch
In order for this bug fix to work, the profiles that are currently in elasticsearch need to be removed and compliance-service needs to be restarted. The removal and restart will cause the profiles to be re-ingested into elastic and the control tags will now be present. From that point forward, any inspec reports that are sent up to automate will carry with them, the control tags for each respective profile.

*N.B. already ingested reports will not ever have the tags for the controls as they are decorated with them upon ingestion which has already happened prior to this fix

⛓️ Related Resources

πŸ‘ Definition of Done

πŸ‘Ÿ How to Build and Test the Change

From within hab studio:
rebuild components/compliance-service
Get a profile that has some tags like CIS Docker Benchmark Profile
Create a scan job and select this CIS Docker Benchmark Profile profile
Run your newly created scan job in automate
Once it completes its run, whenever you export the node or call reporting/reports/id/:id for the job that you have just run and navigate to profiles->controls section of the json output, in each control you should now see its respective control tags.

You can also add these newly present control tags to your filter when using compliance.. in the filter text entry box, filter on Control Tag, you should see some of the available tags appear, which you may now select. Prior to this bug fix, nothing would be suggested for Control-Tag and we were not able to use them to filter as they did not exist in reports prior to this.

βœ… 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

Signed-off-by: Rick Marry <rick.marry@gmail.com>
@netlify
Copy link

netlify bot commented Aug 12, 2021

πŸ‘· Deploy Preview for chef-automate processing.

πŸ”¨ Explore the source changes: 98dd4e0

πŸ” Inspect the deploy log: https://app.netlify.com/sites/chef-automate/deploys/6115a97953c9c60008ee8b4e

@sonarcloud
Copy link

sonarcloud bot commented Aug 12, 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 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@rickmarry rickmarry requested a review from kalroy August 12, 2021 23:14
@kalroy kalroy merged commit 83947c3 into master Aug 18, 2021
@kalroy kalroy deleted the rm/fix-tags-simple branch August 18, 2021 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants