-
Notifications
You must be signed in to change notification settings - Fork 672
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
config MACsec CLI #1895
config MACsec CLI #1895
Conversation
This pull request introduces 1 alert when merging 5eda315 into 8ea834b - view on LGTM.com new alerts:
|
Signed-off-by: Ze Gan <[email protected]>
Signed-off-by: Ze Gan <[email protected]>
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
config/macsec.py
Outdated
@click.option('--cipher_suite', metavar='<cipher_suite>', required=False, default="GCM-AES-128", show_default=True, type=click.Choice(["GCM-AES-128", "GCM-AES-256", "GCM-AES-XPN-128", "GCM-AES-XPN-256"]), help="The cipher suite for MACsec.") | ||
@click.option('--primary_cak', metavar='<primary_cak>', required=True, type=str, help="Primary Connectivity Association Key.") | ||
@click.option('--primary_ckn', metavar='<primary_cak>', required=True, type=str, help="Primary CAK Name.") | ||
@click.option('--policy', metavar='<policy>', required=False, default="security", show_default=True, type=click.Choice(["integrity_only", "security"]), help="MACsec policy. INTEGRITY_ONLY: All traffics, except EAPOL, will be converted to MACsec packets without encryption.SECURITY: All traffics, except EAPOL, will be encrypted by SecY.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor typos: change traffics to traffic and add space between period and SECURITY.
config/macsec.py
Outdated
@click.option('--primary_ckn', metavar='<primary_cak>', required=True, type=str, help="Primary CAK Name.") | ||
@click.option('--policy', metavar='<policy>', required=False, default="security", show_default=True, type=click.Choice(["integrity_only", "security"]), help="MACsec policy. INTEGRITY_ONLY: All traffics, except EAPOL, will be converted to MACsec packets without encryption.SECURITY: All traffics, except EAPOL, will be encrypted by SecY.") | ||
@click.option('--enable_replay_protect/--disable_replay_protect', metavar='<replay_protect>', required=False, default=False, show_default=True, is_flag=True, help="Whether enable replay protect.") | ||
@click.option('--replay_window', metavar='<enable_replay_protect>', required=False, default=0, show_default=True, type=click.IntRange(0, 2**32), help="Replay window size that is the number of packets that could be out of order. This filed works only if ENABLE_REPLAY_PROTECT is true.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor typo: change filed to field.
config/macsec.py
Outdated
profile_table["send_sci"] = send_sci | ||
|
||
if rekey_period > 0: | ||
profile_table["replay_period"] = rekey_period |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replay_period should be rekey_period
tests/config_macsec_test.py
Outdated
assert "enable_replay_protect" not in profile_table | ||
assert "replay_window" not in profile_table | ||
assert profile_table["send_sci"] == "1" | ||
assert "replay_period" not in profile_table |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there is any field called replay_period? There is only replay_window and rekey_period AFAIK?
tests/config_macsec_test.py
Outdated
assert profile_table["send_sci"] == "1" | ||
if "no_send_sci" in profile_map: | ||
assert profile_table["send_sci"] == "0" | ||
if "replay_period" in profile_map: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK, replay_period should be rekey_period?
I have implemented and tested the changes I suggested above... You can find the updated files if you want to copy the changes in #1727 |
MACsec CLI implemented by PR: sonic-net/sonic-buildimage#9390 |
What I did
Added support for MACsec config
How I did it
Add macsec.py and register macsec command in config/main.py
How to verify it
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)