Skip to content

server: fix fips_mode stat#16140

Merged
jmarantz merged 16 commits intoenvoyproxy:mainfrom
raakella:fix-fips-mode
Apr 29, 2021
Merged

server: fix fips_mode stat#16140
jmarantz merged 16 commits intoenvoyproxy:mainfrom
raakella:fix-fips-mode

Conversation

@raakella
Copy link
Contributor

@raakella raakella commented Apr 23, 2021

Signed-off-by: Ravindra Akella rakella@salesforce.com

For an explanation of how to fill out the fields, please see the relevant section
in PULL_REQUESTS.md

Commit Message: Fix fips_mode stat by using a static variable to check if the ssl version is fips compliant or not.
Additional Description: Originally added as part of #14719
Risk Level: Low
Testing: Updated unit tests
Docs Changes: None. Already documented
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Deprecated:]
[Optional API Considerations:]

Signed-off-by: Ravindra Akella <rakella@salesforce.com>
Signed-off-by: Ravindra Akella <rakella@salesforce.com>
Signed-off-by: Ravindra Akella <rakella@salesforce.com>
Signed-off-by: Ravindra Akella <rakella@salesforce.com>
Signed-off-by: Ravindra Akella <rakella@salesforce.com>
Signed-off-by: Ravindra Akella <rakella@salesforce.com>
Signed-off-by: Ravindra Akella <rakella@salesforce.com>
@raakella raakella changed the title server: fix fips_mode stat [WIP] server: fix fips_mode stat Apr 26, 2021
@jmarantz
Copy link
Contributor

@raakella Are you able to iterate locally to get basic tests passing with bazel test //test/...? That might be a bit faster than trying to iterate over CI, at least for the default build.

@jmarantz
Copy link
Contributor

/wait

Signed-off-by: Ravindra Akella <rakella@salesforce.com>
@raakella
Copy link
Contributor Author

raakella commented Apr 26, 2021

@jmarantz Locally it has been working. Seems like something is broken when these test are run in CI. Seems like https://github.com/envoyproxy/envoy/blob/main/source/common/version/version.cc#L41 is evaluating to true from tests but from the actual code, it is evaluating to false.
I tried locally with "--define boringssl=fips" but that did not work it.

Signed-off-by: Ravindra Akella <rakella@salesforce.com>
Signed-off-by: Ravindra Akella <rakella@salesforce.com>
Signed-off-by: Ravindra Akella <rakella@salesforce.com>
@raakella raakella changed the title [WIP] server: fix fips_mode stat server: fix fips_mode stat Apr 27, 2021
Signed-off-by: Ravindra Akella <rakella@salesforce.com>
@raakella raakella requested a review from PiotrSikora April 28, 2021 05:25
Signed-off-by: Ravindra Akella <rakella@salesforce.com>
PiotrSikora
PiotrSikora previously approved these changes Apr 28, 2021
srcs = ["version_test.cc"],
copts = envoy_select_boringssl(
["-DENVOY_SSL_FIPS"],
),
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: This could have been written as copts = envoy_select_boringssl(["-DENVOY_SSL_FIPS"]),

@PiotrSikora PiotrSikora requested review from ggreenway and lizan April 28, 2021 07:17
Signed-off-by: Ravindra Akella <rakella@salesforce.com>
PiotrSikora
PiotrSikora previously approved these changes Apr 28, 2021
Copy link
Contributor

@PiotrSikora PiotrSikora left a comment

Choose a reason for hiding this comment

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

Thanks1

Signed-off-by: Ravindra Akella <rakella@salesforce.com>
Copy link
Contributor

@jmarantz jmarantz left a comment

Choose a reason for hiding this comment

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

Looks fine generally with one nit

#ifdef BORINGSSL_FIPS
fipsCompliant = true;
#ifdef ENVOY_SSL_FIPS
static bool fipsCompliant = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need the static? Why not just

#ifdef ENVOY_SSL_FIPS
return true;
#else 
return false;
#endif 

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jmarantz Initially I thought this initialization must happen during compile time as "BORINGSSL_FIPS" is being pass during compilation. But it seems like it is not required. Should I change that?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, you don't need a static at all for this use-case. Just return the value based on the ifdef.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I will change it.

@jmarantz
Copy link
Contributor

/wait

Signed-off-by: Ravindra Akella <rakella@salesforce.com>
Copy link
Contributor

@jmarantz jmarantz left a comment

Choose a reason for hiding this comment

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

Thanks!

@ggreenway
Copy link
Member

windows failure was a flake in pulling build image.

/retest

@repokitteh-read-only
Copy link

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #16140 (comment) was created by @ggreenway.

see: more, trace.

@raakella
Copy link
Contributor Author

@ggreenway @lizan Please merge this.

@jmarantz jmarantz merged commit 265275e into envoyproxy:main Apr 29, 2021
gokulnair pushed a commit to gokulnair/envoy that referenced this pull request May 6, 2021
Commit Message: Fix fips_mode stat by using a static variable to check if the ssl version is fips compliant or not.
Additional Description: Originally added as part of envoyproxy#14719
Risk Level: Low
Testing: Updated unit tests
Docs Changes: None. Already documented
Release Notes:
Platform Specific Features:

Signed-off-by: Ravindra Akella <rakella@salesforce.com>
Signed-off-by: Gokul Nair <gnair@twitter.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.

5 participants