Skip to content

ISS-3102 FIPS POST validation for MACsec control plane crypto.#3907

Closed
vikram-nexthop wants to merge 16 commits intosonic-net:masterfrom
nexthop-ai:vikram.iss-3102.macsec-cp-post
Closed

ISS-3102 FIPS POST validation for MACsec control plane crypto.#3907
vikram-nexthop wants to merge 16 commits intosonic-net:masterfrom
nexthop-ai:vikram.iss-3102.macsec-cp-post

Conversation

@vikram-nexthop
Copy link

@vikram-nexthop vikram-nexthop commented Sep 25, 2025

What I did

  • Query control plane (wpa_supplicant) crypto POST status check in macsecmgrd main, when FIPS mode is enabled
  • Record status in FIPS_MACSEC_POST_TABLE.
  • Implemented fail-secure behavior where macsecmgrd is forced to get into an infinite loop, if the POST validation fails.

Why I did it
MACsec control plane FIPS POST validation is required to ensure the cryptographic backend has passed self-tests before enabling MACsec operations. This is to ensure MACsec control plane fails securely if crypto backend POST validation fails in FIPS environments.

How I verified it
Enabled MACsec service with and without SymCrypt FIPS provider.

Details if related
related PR: sonic-net/sonic-wpa-supplicant#99

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vikram-nexthop vikram-nexthop marked this pull request as ready for review September 25, 2025 16:33
…failure.

- update FIPS_MACSEC_POST_TABLE even if "wpa_supplicant -F" command fails due to timeout.
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link

@wumiaont wumiaont left a comment

Choose a reason for hiding this comment

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

LGTM

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vikram-nexthop
Copy link
Author

@prsunny Could you please review this PR for approval when convenient? All the review comments have been addressed.

gentle reminder to complete the review.

@judyjoseph
Copy link
Contributor

judyjoseph commented Oct 29, 2025

@vikram-nexthop we already stop the configs in macsecmgrd in PR : #3836 , macsecmgrd. Please share more details on this PR

@vikram-nexthop
Copy link
Author

@judyjoseph PR #3836 handles the data plane POST (SAI/hardware crypto engines), while this PR addresses control plane POST (wpa_supplicant crypto module for MKA protocol). Both are separate cryptographic modules and therefore require independent FIPS validation.

Complete MACsec FIPS compliance requires both POST validations to pass. So, both POST validations must pass before enabling MACsec configuration processing.

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prsunny prsunny requested a review from judyjoseph November 14, 2025 22:50
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

SWSS_LOG_NOTICE("starting main loop");
while (!received_sigterm)
{
if (!isCpPostStateReady)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not seeing anyone updating this variable isCpPostStateReady before checking ? This API getCpCryptoFipsPostStatus() is just called once I see ?

Copy link
Author

@vikram-nexthop vikram-nexthop Nov 19, 2025

Choose a reason for hiding this comment

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

The getCpCryptoFipsPostStatus() fetches the control plane POST status synchronously, and therefore invoked only once.

std::string state = getMacsecPostState(&stateDb);
if (state == "pass" || state == "disabled")
{
SWSS_LOG_NOTICE("FIPS MACSec POST ready: state %s", state.c_str());
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we do this check isCpPostStateReady() here. i.e check CpPost if dataplanePost is pass ? that way we need not check for fipsEnabled explicitly

We have removed the file open and check for fips here in orcahgent/main.cpp and replaced with an option "https://github.com/nexthop-ai/sonic-swss/blob/a3df4d5452fa30e52ac8205ae8b95d5bf3cf7b84/orchagent/main.cpp#L107"

Copy link
Author

Choose a reason for hiding this comment

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

ok, will look into this.

Choose a reason for hiding this comment

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

Can we do this check isCpPostStateReady() here. i.e check CpPost if dataplanePost is pass ? that way we need not check for fipsEnabled explicitly

We have removed the file open and check for fips here in orcahgent/main.cpp and replaced with an option "https://github.com/nexthop-ai/sonic-swss/blob/a3df4d5452fa30e52ac8205ae8b95d5bf3cf7b84/orchagent/main.cpp#L107"

I have the same feeling that we may be able to do those FIPS ready check in macsecmgrd. In this case there's no need to make code change into wpa_supplicant which is a third party open source.

Copy link
Author

Choose a reason for hiding this comment

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

I think @judyjoseph's comment is to invoke isCpPostStateReady() after SAI/switch post ststus becomes available (within the if statement, line no 227).

Regarding you suggestion to move FIPS ready check to macsecmgrd, I have some concerns. The crypto libraries (OpenSSL,etc) are linked to the wpa_supplicant. Macsecmgrd doesn't use any crypto libraries as such.
The migration would require the following changes, as per my understanding,

  1. change macsecmgrd to link/include all the crypto libraries.
  2. since the wpa_supplicant supports multiple backend crypto libraries, keep track of the list of supported libraries and ensure that macsecmgrd validates the same library that is used by the wpa_supplicant.

The decision to make changes in the wpa_supplicant (which is directly connected to the crypto module) was based on these factors.

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vikram-nexthop
Copy link
Author

closing this PR, since control plane POST check is not required. Refer to sonic-net/SONiC#2083 for more details.

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