The other big thing for FIPS 140 is using only validated cryptographic modules. For Go programs, the approach GitLab groups used to implement this was documented in https://docs.gitlab.com/ee/development/fips_compliance.html#go and https://gitlab.com/gitlab-org/gitlab/-/issues/349547. FIPS-compliant container images are generally (if not exclusively) built on Red Hat UBI, since that base image can operate in FIPS mode and provide FIPS-validated openssl for our programs to pick up. At this point there are a number of existing FIPS-compatible images within the company, so hopefully that could provide some examples to work off of.
Actions
Build kas with host SDK that provides a FIPS-compliant implementation in CNG (Omnibus is already built with host SDK)
This page may contain information related to upcoming products, features and functionality.
It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes.
Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.
Hi! 👋 this issue was created as a placeholder to enable KAS in FIPS mode, KAS has been excluded from the first round of FIPS work and this has been created to start gathering feedback and kickstart the work.
In particular I am not sure why we removed ~"FedRAMP::Needs PM triage" for such a an unrefined issue, was this intentional or maybe part of a bulk move? If not I just want to surface that we will need to refine and add details to this before it can be worked.
@joshlambert as you can see from the issue description, this isn't something we can work on until it's been developed into a viable problem definition and solution. Based on this, I'm removing the FedRAMP label as we can't actually deliver anything at this point.
In particular I am not sure why we removed ~"FedRAMP::Needs PM triage" for such a an unrefined issue, was this intentional or maybe part of a bulk move? If not I just want to surface that we will need to refine and add details to this before it can be worked.
~"FedRAMP::Needs PM triage": "Next step: FedRAMP Product Manager updates, reviews, moves, or closes this issue"
~"FedRAMP::Needs group input": "Next step: product group or subject matter expert reviews issue and identifies next steps"
I, as FedRAMP PM, triaged this need (having KAS work in FIPS mode) into the RAR requirement milestone (since, if we do not have FIPS 140 compliance, we are not allowed to even submit a Readiness Assessment Report (RAR)). You can see some further discussion on the parent epic at &7933 (comment 1047136820).
@joshlambert as you can see from the issue description, this isn't something we can work on until it's been developed into a viable problem definition and solution. Based on this, I'm removing the FedRAMP label as we can't actually deliver anything at this point.
I am reapplying the label because we need to track FIPS 140 compliance for this feature or explicitly document this feature being out of scope and possibly gain approval from our federal authorizing official to proceed on that basis (see related Slack thread from today (internal link)). (To avoid confusion in the future, I've also updated the milestone label descriptions to reflect that they shouldn't be removed without coordination. The labels identify what is we have determined to be required for FedRAMP, so they can't be removed because of a deficiency with a particular issue.)
Have we not yet specifically defined together what it will take to render KAS FIPS-compliant? (I was not PM for FIPS 140, so @dorrino you might know?) In general FIPS 140 compliance means using only validated cryptographic modules, only allowed cryptographic algorithms (e.g. no MD5), and encrypting data in transit and at rest. https://internal-handbook.gitlab.io/handbook/engineering/fips-compliance/ has more details. In general, each product group was to have assessed their own software artifacts and their FIPS compliance posture as part of the FIPS effort (&6452 (closed)).
I will note that mutual TLS (bidirectionally authenticated) is not required (see further discussion in the epic comment: &7933 (comment 1050526218)), though TLS is.
@connorgilbert Thanks. We are trying to prioritize the parent epic ASAP. I'll let you know what is a realistic timeline to deliver it once the planning is done.
Given PTOs and Visiting grants, the refinement/planning will likely take a few weeks.
@connorgilbert Thanks for the update and clear explanation.
Have we not yet specifically defined together what it will take to render KAS FIPS-compliant?
We have not done so explicitly, we did open a serie of issue as part of the parent epic (all of which minus this are closed) KAS was skipped during the first FIPS round and disabled in FIPS builds
I checked the epic &6452 (closed) and I do not see Configure involved anywhere.
The last time we worked on FIPS was at the beginning of the year where KAS was determined to be excluded from the first round. This is why I was confused when this issue suddenly grew in priority. As I mentioned we initially created this as a placeholder to add FIPS compliance into KAS. Had we known this (and apologies if I should have known this and I somehow missed) we would have planned this differently, especially with the PTO (paternity leaves) that we have right now.
I am discussing this because I want to avoid this kind of situation to happen again, I see that @grzesiek is on this now 🙏 and @ash2k Is answering some of the uncertainties (Thanks! 🙇) so we should be good to go.
@ash2k will you be take to take this over from here? I think that we have a good understanding now about what is needed to make KAS FIPS-compliant, right?
Let me assign to myself for the time being. I would like to learn more about KAS and perhaps figuring it out what would take to make it FIPS compliant would be a good first step. @ash2k seems to be on PTO for the next two weeks, and this is an urgent topic. /cc @dcroft@sgoldstein
I'm not sure if this is enough to actually make KAS FIPS compatible. I need to spend a bit more time on the research. According to &7933 (comment 1075527171) this may be enough, but I will reach out to domain experts like @ash2k and @nagyv-gitlab to actually learn more about it.
The fastest thing to do right now since I'm not sure if any of the KAS maintainers are around would be to make Omnibus and CNG build scripts replace go_register_toolchains(version = "1.18.5") with go_register_toolchains(version = "host").
That runs the risk of using a version of Go that isn't fully tested with kas, though.
As I mentioned in &7933 (comment 1084213386), I think we should make that change in KAS itself and modify the KAS builds install the Go compiler. This would make kas consistent with all other GitLab components.
@stanhu Do I understand correctly that we would need to:
Update the gitlab-agent project to make it consistent with all GitLab Go projects, to use local Go compiler instead of installing it through bazel.
Add a pipeline in gitlab-agent that will test it with additional Go version (we usually support two Go version, right?).
Open a merge request in Omnibus to build KAS with version = "host" Go.
Open a merge in CNG project to build KAS with version = "host" Go.
@grzesiek If we do the first two items, we shouldn't need to do 3 and 4 because Omnibus and CNG already provide a Go compiler, assuming we update KAS to use version = "host".
Items 3 and 4 could be done if for some reason we didn't want to do 1 and 2.
Update the gitlab-agent project to make it consistent with all GitLab Go projects, to use local Go compiler instead of installing it through bazel.
kas uses the same Go version in all 3 environments - local dev, CI and CNG. This is due to bazel, being a hermetic build system, installing the requested Go version. I haven't specifically investigated this, but to the best of my knowledge kas is the only component that is consistent in that sense. All other projects use potentially different versions - locally devs have a version, CI has potentially a different version and CNG has potentially yet another version. So by making kas use a local compiler we'd make things consistently inconsistent :almostawesome: Omnibus is an exception here, it uses local compiler version and we get problems like this one because of that. We couldn't make it work with bazel when we still supported CentOS 6 or something. We need to fix that.
Having said the above (just wanted to share how I see it), I understand that there is a need and an urgent one. I agree that using the local version for FIPS builds is the way to go at least short term. But we need to ensure that the version that is used in CI is the version that is used in CNG and in Omnibus. For now we can just copy-pase the version and only use the forked compiler when we need it.
Long term the right approach would be to create a custom bazel Go toolchain with the compiler we use (see go_download_sdk) for FIPS and just use that in CI, CNG, Omnibus, and maybe locally too.
What about agentk? Is it in scope for FIPS? It's a container image we publish on release/tag from CI in the agent repo. It is not built by Omnibus/CNG. This is mostly because CNG doesn't support multi-arch images and we need (due to customer demand) to support arm and arm64 archs too.
In &8660 (closed), we're discussing how to streamline the Go upgrade process. I think we're leaning towards a solution that uses images built by Distribution (e.g. registry.gitlab.com/gitlab-org/build/cng/gitlab-go) so that all components will build and test against the current and next supported version of Go instead of having bazel manage the version.
Hm, I'm actually not 100% sure using the host SDK will work the way we expect. This needs to be tested. It may work, I'm just no longer sure.
Another thing about agentk - we currently cross compile for arm and arm64 from the usual amd64 machines. We'll not be able to cross compile if we need CGO. We'll need arm runners. I wonder how Runner solves this problem?