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

support fips-compliant build for arm #27622

Merged
merged 3 commits into from
May 29, 2023

Conversation

zhaohuabing
Copy link
Member

Commit Message: support fips-compliant build for arm
Additional Description: related issue: #27620
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

@zhaohuabing zhaohuabing marked this pull request as draft May 25, 2023 05:01
@zhaohuabing zhaohuabing marked this pull request as ready for review May 25, 2023 06:51
@zhaohuabing zhaohuabing force-pushed the boringssl-fips-arm branch 2 times, most recently from 549ba41 to 1ab29e2 Compare May 25, 2023 07:31
Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
Copy link
Member

@phlax phlax left a comment

Choose a reason for hiding this comment

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

hi @zhaohuabing thanks for working on this

looking at ci and doing a quick review here im wondering how this should work, atm its failing due to trying to use non-hermetic binaries

not entirely clear how fips is expected to build wrt versions, but i think we dont want to be installing cmake/ninja etc in the host, and not sure it will work (current non-hermetic issue in ci is python afaict)

Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
Copy link
Member

@phlax phlax left a comment

Choose a reason for hiding this comment

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

@zhaohuabing i confirmed offline that the current build is not affected by the switch to the toolchain/vendored tooling
(apologies for any confusion)

this lgtm, my one concern is that we dont have any testing for it, maybe thats ok

would be good to get a signoff from someone with better knowledge of fips

kyessenov
kyessenov previously approved these changes May 26, 2023
Copy link
Contributor

@kyessenov kyessenov left a comment

Choose a reason for hiding this comment

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

This looks fine to me. Did you try to run the ARM build and validate that fips_mode is reported in the admin? I am not sure if the CI tries this build.

Re: @phlax: FIPS mode performs a self-test so if envoy self-reports FIPS mode, it should be correct.

@phlax
Copy link
Member

phlax commented May 26, 2023

FIPS mode performs a self-test so if envoy self-reports FIPS mode

i more meant in ci

@kyessenov
Copy link
Contributor

@phlax Yeah, I'm a bit concerned about the lack of testing for compile time options for ARM. Should we create a CI pipelne similar to x86 one?

@phlax
Copy link
Member

phlax commented May 26, 2023

Should we create a CI pipelne similar to x86 one?

the only problem is that it doesnt use a free azp host, so there is a ~cost implication - i was wondering about adding a fips build in the main release stage, but not sure

@kyessenov
Copy link
Contributor

I think it's OK to verify manually right now since there is no logic change. Can we get a confirmation that the ARM build reports fips_mode correctly?

@zhaohuabing
Copy link
Member Author

zhaohuabing commented May 28, 2023

I think it's OK to verify manually right now since there is no logic change. Can we get a confirmation that the ARM build reports fips_mode correctly?

@kyessenov Verified on my arm machine.

➜  envoy git:(boringssl-fips-arm) ✗ lscpu|grep arc                                                          
Architecture:                    aarch64
➜  envoy git:(boringssl-fips-arm) ✗  echo "build --define boringssl=fips" >> .bazelrc
➜  envoy git:(boringssl-fips-arm) ✗ ./ci/run_envoy_docker.sh ' ./ci/do_ci.sh bazel.release.server_only' 
➜  envoy git:(boringssl-fips-arm) ✗ /tmp/envoy-docker-build/envoy/arm64/source/exe/envoy/envoy --version|grep FIPS
/tmp/envoy-docker-build/envoy/arm64/source/exe/envoy/envoy  version: 2a4c291b281ecc9fad3a28868da4618eb2a6e0f2/1.27.0-dev/Modified/RELEASE/BoringSSL-FIPS

@wbpcode
Copy link
Member

wbpcode commented May 29, 2023

cc @kyessenov If this ready to merge or need a second review from other maintainers?

&& echo "$SHA256" v"$VERSION".tar.gz | sha256sum --check
tar -xvf v"$VERSION".tar.gz
cd ninja-"$VERSION"
python3 ./configure.py --bootstrap
Copy link
Member

Choose a reason for hiding this comment

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

i guess we will have to just go with this for now but there is no guarantee of any python in an environment

we could use the hermetic python provided by rules_python, but then im thinking rather just use rules_foreign_cc and avoid these problems altogether

either way, we can address the non-hermetic fips build subsequently - i appreciate this is mostly just doing for arm what is currently done for x86

Copy link
Member

@phlax phlax left a comment

Choose a reason for hiding this comment

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

one small nit, and i think this should be good to land @zhaohuabing

@phlax phlax self-assigned this May 29, 2023
Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
Copy link
Member

@phlax phlax left a comment

Choose a reason for hiding this comment

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

lgtm, thanks @zhaohuabing

@phlax phlax enabled auto-merge (squash) May 29, 2023 09:53
@phlax phlax merged commit 32724b8 into envoyproxy:main May 29, 2023
@kyessenov
Copy link
Contributor

@zhaohuabing A better test is to run envoy and query server stats for fips_mode. Can you try that?

@zhaohuabing
Copy link
Member Author

zhaohuabing commented May 30, 2023

@zhaohuabing A better test is to run envoy and query server stats for fips_mode. Can you try that?

@kyessenov Sure I can try that. Below is the output:

~ /tmp/envoy-docker-build/envoy/arm64/source/exe/envoy/envoy --config-path test.yml>/dev/null 2>&1 &
[1] 1513328
➜  ~ curl 127.0.0.1:9901/stats|grep fips                                                               
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 31898    0 31898    0     0  15.2M      0 --:--:-- --:--:-- --:--:-- 15.2M
server.compilation_settings.fips_mode: 1

reskin89 pushed a commit to reskin89/envoy that referenced this pull request Jul 11, 2023
Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
Signed-off-by: Ryan Eskin <ryan.eskin89@protonmail.com>
phlax pushed a commit to phlax/envoy that referenced this pull request Jul 24, 2023
Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
Signed-off-by: Ryan Northey <ryan@synca.io>
phlax pushed a commit to phlax/envoy that referenced this pull request Jul 24, 2023
Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
Signed-off-by: Ryan Northey <ryan@synca.io>
phlax pushed a commit to phlax/envoy that referenced this pull request Jul 24, 2023
Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
Signed-off-by: Ryan Northey <ryan@synca.io>
phlax pushed a commit that referenced this pull request Jul 24, 2023
Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
Signed-off-by: Ryan Northey <ryan@synca.io>
phlax pushed a commit that referenced this pull request Jul 24, 2023
Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
Signed-off-by: Ryan Northey <ryan@synca.io>
phlax pushed a commit that referenced this pull request Jul 24, 2023
Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
Signed-off-by: Ryan Northey <ryan@synca.io>
phlax added a commit that referenced this pull request Jul 24, 2023
Follow up from:

- #27087
- #27622

Signed-off-by: Ryan Northey <ryan@synca.io>
phlax added a commit to phlax/envoy that referenced this pull request Jul 25, 2023
Follow up from:

- envoyproxy#27087
- envoyproxy#27622

Signed-off-by: Ryan Northey <ryan@synca.io>

Signed-off-by: phlax <phlax@users.noreply.github.com>
phlax added a commit that referenced this pull request Jul 25, 2023
Follow up from:

- #27087
- #27622

Signed-off-by: Ryan Northey <ryan@synca.io>

Signed-off-by: phlax <phlax@users.noreply.github.com>
phlax added a commit to phlax/envoy that referenced this pull request Jul 25, 2023
Follow up from:

- envoyproxy#27087
- envoyproxy#27622

Signed-off-by: Ryan Northey <ryan@synca.io>

Signed-off-by: phlax <phlax@users.noreply.github.com>
phlax added a commit that referenced this pull request Jul 26, 2023
Follow up from:

- #27087
- #27622

Signed-off-by: Ryan Northey <ryan@synca.io>

Signed-off-by: phlax <phlax@users.noreply.github.com>
phlax added a commit to phlax/envoy that referenced this pull request Jul 26, 2023
Follow up from:

- envoyproxy#27087
- envoyproxy#27622

Signed-off-by: Ryan Northey <ryan@synca.io>

Signed-off-by: phlax <phlax@users.noreply.github.com>
phlax added a commit that referenced this pull request Jul 26, 2023
Follow up from:

- #27087
- #27622

Signed-off-by: Ryan Northey <ryan@synca.io>

Signed-off-by: phlax <phlax@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants