Skip to content

ADR-0011: Version Numbers#936

Merged
rfelber merged 5 commits into
mainfrom
adr/versioning
Mar 16, 2022
Merged

ADR-0011: Version Numbers#936
rfelber merged 5 commits into
mainfrom
adr/versioning

Conversation

@malexmave

Copy link
Copy Markdown
Member

This PR contains a new ADR on how we want to version the secureCodeBox. To quote the included ADR:

Software version numbers should serve as an indicator of compatibility between different versions, both during operation and while updating to a newer release.
At the moment, the secureCodeBox is following the Semantic Versioning (semver) approach.
According to semver, version numbers are of the format MAJOR.MINOR.PATCH, and the different places are incremented as follows:

  1. MAJOR version when you make incompatible API changes,
  2. MINOR version when you add functionality in a backwards compatible manner, and
  3. PATCH version when you make backwards compatible bug fixes.

However, the architecture of secureCodeBox, with its operator and many individual scanners that can be installed and used separately, makes this seemingly simple versioning system more difficult.
For example, we need to answer the following questions:

  1. Are breaking changes in the parameterization of a scanner (e.g. nmap, Gitleaks) a breaking change for the entire secureCodeBox project?
  2. Are changes to the output format of a single scanner a breaking change for the entire project?
  3. In an environment where operator and scanners aren't necessarily using the same version number because the operator is controlled by a different team than the scanners (a setup that we want to support), how do we indicate compatibility between different versions of operator and scanner?

Depending on how these questions are answered, different versioning schemes are possible.

This PR is intended as a place to iterate on the ADR and discuss the options until a decision is reached. If you disagree with anything in the ADR, feel free to use the code review functionality to start a discussion.

I have made one fairly fundamental assumption that underlies the ADR: We know that some users of the SCB have a shared Kubernetes cluster with a single SCB operator and different namespaces where different teams can install their own scanners, set up rules, etc. - in these cases, the operator and scanners may not be upgraded in lockstep. The ADR assumes that this is a correct and supported way of using the secureCodeBox. If there is disagreement here, we should discuss that before discussing versioning schemes, because it makes a large difference as to which options are viable.

Closes #926.

Signed-off-by: Max Maass <max.maass@iteratec.com>
@malexmave malexmave added documentation Improvements or additions to documentation architecture Architecture changes labels Jan 19, 2022
@EndPositive

Copy link
Copy Markdown
Contributor

@malexmave, I think the idea of separating Operator and Scanner versioning is quite interesting. If there is a bugfix in the operator that does not influence the scanners, why should I update the scanner charts?

I think it would be nice to have a versioning like this:

Component Major Minor Patch
Operator Deleting/renaming CRD Adding nullable CRD Performance / Backwards-compatible bugfixes
Scanners / Hooks Identical to Major version of Operator that it supports helm chart changes + backwards-compatible SDK changes scanner version

Example:
Operator v2.1.1
Nmap: v2.0-7.92-r2

v2 in nmap version indicates that it is compatible with any v2.x.x of the operator.

I think this scheme is fairly similar to option 3. My proposal is not that polished, but a solution like that sounds pretty good to me.

@J12934

J12934 commented Jan 21, 2022

Copy link
Copy Markdown
Member

I've updated the ADR to include a Option 5 based on the suggestion of @EndPositive
Any feedback on it welcome :)

Notes to Jop:

  • I this your proposal to be more based on option 2 then on option 3(as far as I understood you) :) As your examples didn't include a ARCH version
  • I changed the - seperator in the version to a +. - is reseved in semver to indicate pre releases which i think would be more confusing: https://semver.org/#spec-item-9

@EndPositive

Copy link
Copy Markdown
Contributor

Hi @J12934 , thanks for adding my option to the ADR. However, I think there is a small misunderstanding. My proposal had the scanners/hooks version number only include the major version of the operator, instead of the complete version.

Again example:
Operator v2.1.1
Nmap: v2.0-7.92-r2

The example from the ADR:
operator: 3.42.0
nmap: 3.42.0+7.92-r2

See how in the ADR option 5, the full operator version is specified. I purposely include only the major version in the nmap version so that small changes in the operator don't require scanner versions to be updated. I think that is also why it is more similar to option 3 than to 2.

@malexmave

malexmave commented Jan 25, 2022

Copy link
Copy Markdown
Member Author

I like your proposal in general. I am not quite sure how it would handle a case where we make an improvement to a scanner without updating the version of the scanner itself though. Like saying "oh, actually, there is another piece of interesting data in the output of the scanner, let's quickly change the parser to also expose this in the findings". Since the embedded scanner remains on the same version, and the operator also remains the same, how would a version update like this be numbered, especially in an automated fashion? Similarly, what if we update the parser base image and need to re-generate all parser images - how would this reflected in the versioning scheme you propose, @EndPositive? The solution by @J12934 has the advantage that we have the entire version number to play with, which makes changes like this easy.

Or, put another way: Why is it bad that the scanner version needs to be updated for small changes to the operator (because this seems to be the basic premise of your proposal)? At the moment, we are releasing numbered versions for all parts of the system on every release, regardless of if they changed or not. This way, you can always just pull all version numbers up on upgrade, and if you see that parts of your stack are running on 3.3.1 and parts on 3.4, you don't need to wonder if this is because 3.4 did not make any changes to them or because you forgot to pull this component up to v3.4.

@Weltraumschaf Weltraumschaf self-assigned this Jan 26, 2022
@EndPositive

Copy link
Copy Markdown
Contributor

Since the embedded scanner remains on the same version, and the operator also remains the same, how would a version update like this be numbered, especially in an automated fashion?

That's what I reserved the minor version for. E.g.:

nmap: v2.0-7.92-r2 -> v2.1-7.92-r2

Updating the SDK would result in all scanners/hooks releasing with a minorversion update. That might be a bit confusing when multiple scanners are on the same SDK, but not on the same minor (e.g. because one has updated params).

Why is it bad that the scanner version needs to be updated for small changes to the operator (because this seems to be the basic premise of your proposal)?

Like you mentioned earlier, it is very likely that third-party developers maintain their own scanners. I can't imagine they release a new scanner version for each release that is made here. Simply because there may not be a requirement to do so. How many times do we make a release for scanners that have 0 changes?

By modularization like this I hope you can also find that there is less maintenance in releasing new scb versions.

It is a common concept to modularize like this. ZAP addons also update independently from ZAP. Nuclei templates are also modular from nuclei engine. Differnece between these and my proposal was that the core version is not mentioned in module version, only in changelog.

Comment thread docs/adr/adr_0011.md Outdated
Comment thread docs/adr/adr_0011.md
Comment thread docs/adr/adr_0011.md Outdated
Comment thread docs/adr/adr_0011.md Outdated
@Weltraumschaf

Weltraumschaf commented Jan 28, 2022

Copy link
Copy Markdown
Member

By modularization like this I hope you can also find that there is less maintenance in releasing new scb versions.

We had modularization in SCBv1 and it was a hell. That's why we decided to maintain everything like a monolithic software w/ single version. Turns out it is not sufficient :-(

Complete other idea: Is it feasible to somehow implement a dry-run upgrade, so that I can check if something will break? If this is possible we may not need any versioning.

Signed-off-by: Max Maass <max.maass@iteratec.com>
Weltraumschaf
Weltraumschaf previously approved these changes Feb 16, 2022

@Weltraumschaf Weltraumschaf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM but not sure which option we should choose.

@Weltraumschaf Weltraumschaf added the planned Issues we will do in the next sprint. label Mar 2, 2022
@SebieF

SebieF commented Mar 8, 2022

Copy link
Copy Markdown
Contributor

When releasing breaking changes, it would probably be nice for users to be noticed upon installation/upgrading. This could happen not only by putting the breaking release note prominently at the top of the release notes, but also to have them in the Helm notes of the respective scanners (The process of doing that should be automated, of course..)

Signed-off-by: Max Maass <max.maass@iteratec.com>
@malexmave

Copy link
Copy Markdown
Member Author

I have updated the ADR with our decision in the meeting we had today.

This decision is made with the knowledge that it may have consequences we are unaware of. We thus invite people who disagree with it to let us know by creating a discussion or opening an issue.

It results in the following new TODOs:

@malexmave malexmave marked this pull request as ready for review March 8, 2022 13:39
Signed-off-by: Max Maass <max.maass@iteratec.com>
@rfelber rfelber merged commit 19f9b90 into main Mar 16, 2022
@rfelber rfelber deleted the adr/versioning branch March 16, 2022 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

architecture Architecture changes documentation Improvements or additions to documentation planned Issues we will do in the next sprint.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Establish and document what changes constitute a major/minor/patch version

6 participants