Skip to content

Add scanner.appendName to chart values#469

Merged
J12934 merged 4 commits intosecureCodeBox:v3from
EndPositive:bugfix/nmap-release-name
Jun 10, 2021
Merged

Add scanner.appendName to chart values#469
J12934 merged 4 commits intosecureCodeBox:v3from
EndPositive:bugfix/nmap-release-name

Conversation

@EndPositive
Copy link
Contributor

Description

Using {{ .Release.name }} causes issues when using this chart as a dependency of another chart. All other scanners already use a fixed name.

Checklist

  • Test your changes as thoroughly as possible before you commit them. Preferably, automate your test by unit/integration tests.
  • Make sure npm test runs for the whole project.
  • Make codeclimate checks happy

@EndPositive
Copy link
Contributor Author

I believe no tests/examples are making use of the release name "feature". Everywhere I can see, this ScanType is referenced as nmap.

@J12934
Copy link
Member

J12934 commented Jun 3, 2021

Good catch, I agree that this should be changed at least so that it does not use the helm release name as the name of the scanType as this really isn't intuitive. I think we should hold this change until 3.0.0 as this is a potentially breaking change.

This was originally added so that you can configure yourself a nmap-privilidged scanType, which is capable of running operating system scans which requires some higher privileges: https://docs.securecodebox.io/docs/scanners/nmap#operating-system-scans

In v3 we should then probably add a helm value to control the name of the scanTypes and not use the release name

@EndPositive
Copy link
Contributor Author

EndPositive commented Jun 3, 2021

Interesting, I hadn't thought of that. I agree that a helm value for overriding the scantype name would be a great option for that use case. I was assuming we could do with a single override value for each chart (i.e. scannerJob.name), but that wouldn't work out for charts with multiple scantypes defined (e.g. zap).

  1. A simple solution would be to make a value for appending to the existing names, such that if scannerJob.nameAppend: -privileged would create zap-baseline-scan-privileged, zap-api-scan-privileged, zap-full-scan-privileged.

  2. Another solution would be to allow users to manually override the names of each scantype with scannerJob.zap-baseline-scan:zap-baseline-scan-privileged, scannerJob.zap-api-scan:zap-api-scan-privileged, etc.

I'm not sure if we have a use case for option 2 since each scantype also already uses the same resources, security, etc. (and thus each scantype would be running priviledged and thus needs -priviledged in the name)

Other ideas?

@rfelber rfelber added this to the v3.0.0 milestone Jun 4, 2021
@J12934
Copy link
Member

J12934 commented Jun 9, 2021

Hi, sorry this pr got out of my sight. 😕
I really like the first solution you proposed, that sounds like a great way to add this while allowing all charts to keep a consistent value schema 👍

@J12934 J12934 added breaking Changes requiring a major release maintenance labels Jun 9, 2021
@J12934 J12934 changed the base branch from main to v3 June 9, 2021 19:35
Signed-off-by: Jop Zitman <jop-zitman@hotmail.com>
Signed-off-by: Jop Zitman <jop-zitman@hotmail.com>
Signed-off-by: Jop Zitman <jop-zitman@hotmail.com>
@EndPositive
Copy link
Contributor Author

I think that should do it 😄

@EndPositive EndPositive changed the title 👁️ Nmap: replace release name with fixed "nmap" Add scanner.appendName to chart values Jun 10, 2021
@J12934 J12934 self-requested a review June 10, 2021 12:20
@J12934
Copy link
Member

J12934 commented Jun 10, 2021

Commit 4ec547e is missing the DCO sign-off 🥴

@EndPositive
Copy link
Contributor Author

I can't figure out how to update the commit without messing up the commit history. All the commits from this merge 75c9727 are also rebased... and then the commits show up duplicated in the logs.

If you want I can create a new PR? Or just merge it, since the DCO was only introduced after 4ec547e

@J12934 J12934 merged commit 46312f0 into secureCodeBox:v3 Jun 10, 2021
@EndPositive EndPositive deleted the bugfix/nmap-release-name branch June 10, 2021 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Changes requiring a major release maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants