Skip to content

MACSec and IPSec FIPS Compliance#2167

Merged
kcudnik merged 2 commits intoopencomputeproject:masterfrom
JaiOCP:FIPS
May 8, 2025
Merged

MACSec and IPSec FIPS Compliance#2167
kcudnik merged 2 commits intoopencomputeproject:masterfrom
JaiOCP:FIPS

Conversation

@JaiOCP
Copy link
Copy Markdown
Contributor

@JaiOCP JaiOCP commented May 2, 2025

This PR brings support for enabling POST on an IPSec and MACSec engine or at the switch level for FIPS compliance.

Old PR is closed:
#2162

Signed-off-by: JaiOCP <jai.kumar@broadcom.com>
@JaiOCP
Copy link
Copy Markdown
Contributor Author

JaiOCP commented May 2, 2025

@karthik-krishnamurthy @dipankar-nexthop @ judyjoseph
Please review. I have to close the old PR as it had fallen behind from the origin

@kartik-arista
Copy link
Copy Markdown

Added some minor editorial suggestions that I noticed @JaiOCP - rest of the changes look good to me as per discussions in the earlier PR.

Comment thread doc/fips/SAI-Proposal-FIPS-Compliance.md Outdated
Comment thread doc/fips/SAI-Proposal-FIPS-Compliance.md Outdated
Copy link
Copy Markdown

@skeesara-nokia skeesara-nokia left a comment

Choose a reason for hiding this comment

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

Aprroved

Copy link
Copy Markdown

@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

@tjchadaga
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: JaiOCP <jai.kumar@broadcom.com>
@JaiOCP
Copy link
Copy Markdown
Contributor Author

JaiOCP commented May 7, 2025 via email

Comment thread inc/saiswitch.h
SAI_SWITCH_ATTR_MACSEC_POST_STATUS_NOTIFY,

/**
* @brief Callback for completion status of all the IPSEC ports serviced by this IPSEC engine
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This should be "all MACsec capable ports of the switch", not related to a specific MACsec engine.

Comment thread inc/saiswitch.h

/**
* @brief MACSEC POST status
* Attribute to query the status of POST for all the MACSEC engines
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This should be "all IPsec capable ports of the switch", not related to a specific IPsec engine.

FIPS 140-3 compliance requires that POST is executed on each MACSec/IPSec port and only if POST completes with ‘success’, the MACSec/IPSec port must be enabled for admitting traffic.
Note that this specification will provide POST at the MACSec/IPSec single logical instance level or at the switch level.

As shown in Fig-1, there are two physical security engines and are represented by single logical instance in SAI. Enabling of POST happens at the logical intance level and in turn will trigger POST for all the physical instances present in a given hardware.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I find this confusing. There are 2 SAI_MACSEC objects (for ingress & egress) for all security engines. And there can be up to 2 SAI_IPSEC objects (for ingress & egress) for each security engine. Perhaps deleting this paragraph is best.

SAI_OBJECT_TYPE_MACSEC and SAI_OBJECT_TYPE_ IPSEC already exists
SAI_MACSEC_ATTR_SUPPORTED_PORT_LIST and SAI_IPSEC_ATTR_SUPPORTED_PORT_LIST provides the list of MACSec/IPSec ports being service by an instance of MACSEC and IPSEC objects respectively. Each MACSec/IPSec port has a correspoding binding to the physical port SAI_MACSEC_PORT_ATTR_PORT_ID.
```
SAI_OBJECT_TYPE_SWITCH -> SAI_SWITCH_ATTR_MACSEC_OBJECT_LIST[x] -> SAI_MACSEC_ATTR_SUPPORTED_PORT_LIST[] -> SAI_MACSEC_PORT_ATTR_PORT_ID
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Since the object relationship has not been changed, perhaps there is no need to mention this as enhancement.
While this description is correct, the reader misses one complexity - each of the 2 elements (for ingress & egress) of the MACSEC_OBJECT_LIST have SUPPORTED_PORT_LIST with identical membership.

```
SAI_OBJECT_TYPE_SWITCH -> SAI_SWITCH_ATTR_MACSEC_OBJECT_LIST[x] -> SAI_MACSEC_ATTR_SUPPORTED_PORT_LIST[] -> SAI_MACSEC_PORT_ATTR_PORT_ID

SAI_OBJECT_TYPE_SWITCH -> SAI_SWITCH_ATTR_IPSEC_OBJECT_LIST[x] -> SAI_IPSEC_ATTR_SUPPORTED_PORT_LIST[] -> SAI_IPSEC_PORT_ATTR_PORT_ID
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Similar comment as for MACSEC. However, IPsec can be a little more complex since it allows N security engines to serve N distinct subsets of ports. In that case, there would be be 2*N elements (for ingress and egress) of IPSEC_OBJECT_LIST.


#### 2.2.2 IPSec Port
New READ only attribute SAI_IPSEC_PORT_ATTR_POST_STATUS is introduced to read the status of POST for a given IPSec port.
This attribute can be read after the POST is completed for the IPSec object hosting this port.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We should point out that this attribute provides POST status separately for ingress and egress and both have to pass POST for a port to be usable for IPsec.

Subsequent steps are captured as an example for engine level POST.

**Step 2: **
MACSec Object creation is complete
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This should be merged with the next step. The POST is triggered at the time of object creation.

```

**Step 4: **
Once the POST is completed on all the ports hosted by the MACSec engine, registered post macsec callback will be called by the SAI adapter.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggest "all ingress and egress of all MACsec capable ports of the switch" instead of "ports hosted by the MACsec engine".


**Step 4: **
Once the POST is completed on all the ports hosted by the MACSec engine, registered post macsec callback will be called by the SAI adapter.
If the status is SAI_MACSEC_POST_STATUS_FAIL, NOS MUST read the post status of all the ports hosted by the engine to find out which port POST has failed.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why is NOS required to read the POST status of all ports? Can't it simply disable MACsec for the whole switch?
Also, the example code below is incorrect/mispeading. SAI_MACSEC_ATTR_SUPPORTED_PORT_LIST is a list of SAI_PORT objects, not SAI_MACSEC_PORT objects.

read(macsec_port_obj->SAI_MACSEC_PORT_ATTR_POST_STATUS)
```
**Step 5: **
Set the POST enable flag in the macsec object to false. This is mainly for the hw where POST can be triggered runtime after the initialization.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This cannot be done for a CREATE_ONLY attribute.

@dipankar-nexthop
Copy link
Copy Markdown

Transferred my comments from PR #2162

@kcudnik
Copy link
Copy Markdown
Collaborator

kcudnik commented May 8, 2025

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@kcudnik
Copy link
Copy Markdown
Collaborator

kcudnik commented May 8, 2025

this PR is adding 4 new notifications is that really necessary ? do we need so many of them ?

@kcudnik
Copy link
Copy Markdown
Collaborator

kcudnik commented May 8, 2025

hey @JaiOCP, it seems like @dipankar-nexthop requested some changes, was that already resolved ?

@dipankar-nexthop
Copy link
Copy Markdown

this PR is adding 4 new notifications is that really necessary ? do we need so many of them ?

The SAI_MACSEC and SAI_IPSEC level POST is for diagnostics only. So maybe we can live without notification for those?
The switch level MACsec and IPsec POST require notification. But since both are run only after SAI_SWITCH creation, perhaps those could share a single POST notification (if reducing the number of notification functions help).

@kcudnik
Copy link
Copy Markdown
Collaborator

kcudnik commented May 8, 2025

just wanted to know what's the reason for so many notifications

@kcudnik kcudnik merged commit 82954fd into opencomputeproject:master May 8, 2025
3 checks passed
@JaiOCP JaiOCP deleted the FIPS branch July 18, 2025 16:01
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.

7 participants