-
Notifications
You must be signed in to change notification settings - Fork 1.2k
HLD of SONiC FIPS POST support #2034
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
eb93589
Initial version of SONiC FIPS POST support.
ysmanman df8ed35
Update HLD.
ysmanman cd10853
Update HLD.
ysmanman eb3dd1b
Update HLD.
ysmanman 5e8635e
Update HLD.
ysmanman 0dbbf48
Update HLD.
ysmanman eace6b7
Update HLD.
ysmanman ea8a18b
Update and rename HLD
ysmanman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| # SONiC FIPS POST support | ||
|
|
||
| ## Revision | ||
| | Rev | Date | Author | Change Description | | ||
| |:---:|:-----------:|:------------------:|--------------------| | ||
| | 1 | Jul-7 2025 | Song Yuan (Arista Networks) | Initial Version | | ||
|
|
||
| ## Table of Contents | ||
| * [Overview](#Overview) | ||
| * [Design requirements](#Design-requirements) | ||
| * [Deisgn details](#Design-details) | ||
| * [State DB](#State-DB) | ||
| * [Enabling POST in SAI switch init](#Enabling-POST-in-SAI-switch-init) | ||
| * [Enabling POST in SAI MACSec init](#Enabling-POST-in-SAI-MACSec-init) | ||
| * [Checking SAI POST status](#Checking-SAI-POST-status) | ||
| * [Handling SAI POST failure](#Handling-SAI-POST-failure) | ||
| * [Enforcing FIPS compliance](#Enforcing-FIPS-compliance) | ||
|
|
||
| ## Overview | ||
|
|
||
| This document describes SONiC design for Federal Information Processing Standards (FIPS) 140-3 standard compliance. Especially, the focus of the document is to trigger Pre-Operational Self-Test (POST) in SONiC and also ensure SONiC’s behavior is compliant to FIPS standard after POST. | ||
|
|
||
| ## Design requirements | ||
|
|
||
| The design must meet the following requirements: | ||
| - In order to accommodate different forwarding ASIC architecture or SAI implementation, the design should support enabling POST at either switch level (during switch init) or at MACSec engine level (during MACSec engine init). | ||
| - SONiC MACSec configuration must be processed only after POST passes. | ||
| - POST failure must not affect the operation of non-MACSec ports. | ||
| - Explicit visibility must be provided if POST fails, for example, in syslog. The syslog message must include the details of the failure. For example, SAI object Id of ports that fail POST and the corresponding MACSec engine. | ||
|
|
||
| ## Deisgn details | ||
|
|
||
| The following figure depicts the data flow and SONiC components in the design. Orchagent is responsible for triggering POST via SAI calls and publishing POST status in State DB. MACSec container, precisely MACSecMgr, is enhanced to be POST aware and only process MACSec configuration after POST has passed. | ||
ysmanman marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|  | ||
|
|
||
| ### State DB | ||
|
|
||
| The following table is added to State DB to track POST status. | ||
| ``` | ||
| POST_STATUS_TABLE | ||
ysmanman marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ;Store POST status | ||
|
|
||
| key = POST_STATUS_TABLE|macsec | ||
ysmanman marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| status = "in-progress" ; POST is in-progress. | ||
| "not-started" ; POST was not enabled in switch init. | ||
| "pass" ; POST passed. | ||
| "fail" ; POST failed. | ||
| "unsupported" ; POST is not supported by SAI. | ||
|
|
||
| ``` | ||
|
|
||
| ### Enabling POST in SAI switch init | ||
|
|
||
| Orchagent enables POST when creating SAI switch regardless of whether the MACSec feature is supported or enabled. This can avoid triggering POST after SAI switch creation, e.g., MACSec feature is enabled later. The below flow chart depicts the process. | ||
ysmanman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
|  | ||
|
|
||
| Orchagent enables POST when creating SAI switch. After SAI switch is created, Orchagent queries SAI POST capability. If POST is supported in switch init, Orchagent sets POST status to in-progress and waits for POST completion callback. Otherwise, if POST is supported only in MACSec init, Orchagent sets POST status to not-started, which informs MACSecOrch of performing POST in its initialization. | ||
ysmanman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| If POST is not supported in either switch or MACSec init, then SAI does not support POST. The possible scenarios are: | ||
ysmanman marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - The platform does not support MACSec. Or | ||
| - The platform does support MACSec. But the deployment does not require FIPS compliance. Or | ||
| - The platform does support MACSec, and the vendor incrementally supports FIPS when they can. | ||
ysmanman marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| In the above scenarios, Orchagent sets POST status to unsupported, which means POST is not required and is no-op. | ||
|
|
||
| ### Enabling POST in SAI MACSec init | ||
|
|
||
| POST is performed by MACSecOrch when POST is supported only in MACSec init. The following flow chart demonstrates the process. | ||
|
|
||
|  | ||
|
|
||
| POST is triggered in MACSecOrch initialization. Since POST is enabled via SAI MACSec create API, SAI MACSec object may be created proactively and before any MACSec port is configured. | ||
|
|
||
| ### Checking SAI POST status | ||
|
|
||
| Since SAI supports POST completion callback, a callback or notification function is provided when enabling POST in SAI switch or MACSec creation. Once being invoked, the callback function sets POST status in State DB accordingly based on the POST status returned by SAI. | ||
|
|
||
| ### Handling SAI POST failure | ||
|
|
||
| If SAI POST fails, MACSecOrch reads POST status of all MACSec ports and finds out which port has failed in POST. MACSecOrch then adds the details of the failure in syslog. | ||
|
|
||
| ### Enforcing FIPS compliance | ||
|
|
||
| In order to be compliant to FIPS, SONiC should process MACSec configuration only after POST passes. This is achieved by enhancing MACSecMgr, running in MACSec container, to check POST status published in State DB before processing any MACSec configuration, as shown in the flow chart below: | ||
ysmanman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
|  | ||
ysmanman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.