Skip to content
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

networkd: Introduce MACsec #12184

Closed
wants to merge 1 commit into from
Closed

networkd: Introduce MACsec #12184

wants to merge 1 commit into from

Conversation

ssahani
Copy link
Contributor

@ssahani ssahani commented Apr 2, 2019

This work introduces MACsec to networkd.

Media Access Control Security (MACsec) is an 802.1AE IEEE
industry-standard security technology that provides secure
communication for all traffic on Ethernet links.
MACsec provides point-to-point security on Ethernet links between
directly connected nodes and is capable of identifying and preventing
most security threats, including denial of service, intrusion,
man-in-the-middle, masquerading, passive wiretapping, and playback attacks.

11-macsec.netdev

File Edit Options Buffers Tools Help                                                                                                                                                          
[NetDev]
Name=macsec-test
Kind=macsec

[MACsec]
Port=11


[MACsecReceiveChannel]
Port=1234
MACAddress=c6:19:52:8f:e6:a0

[MACsecReceiveChannel]
Port=21
MACAddress=8c:16:45:6c:83:a9

[MACsecTransmitAssociation]
PacketNumber=1024
KeyId=01
Key=81818181818181818181818181818181

[MACsecReceiveAssociation]
Port=1234
MACAddress=c6:19:52:8f:e6:a0
PacketNumber=1
KeyId=00
Key=82828282828282828282828282828282

closes #5754

Please see https://developers.redhat.com/blog/2016/10/14/macsec-a-different-solution-to-encrypt-network-traffic/

https://www.linux.org/docs/man8/ip-macsec.html

@ssahani ssahani force-pushed the macsec branch 3 times, most recently from 3da50ac to 91b27c3 Compare April 2, 2019 11:51
@ssahani ssahani changed the title networkd: Introduce MACsec (WIP) networkd: Introduce MACsec Apr 2, 2019
@ssahani ssahani force-pushed the macsec branch 2 times, most recently from 077a991 to 19196a5 Compare April 2, 2019 13:31
Copy link
Member

@yuwata yuwata left a comment

Choose a reason for hiding this comment

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

Superficially good. But not tested. I've commented several minor points.

I will test this later.

src/network/netdev/macsec.c Outdated Show resolved Hide resolved
src/network/netdev/macsec.c Outdated Show resolved Hide resolved
src/network/netdev/macsec.c Outdated Show resolved Hide resolved
src/network/netdev/macsec.c Show resolved Hide resolved
src/network/netdev/macsec.c Show resolved Hide resolved
src/network/netdev/macsec.c Show resolved Hide resolved
src/network/netdev/macsec.c Outdated Show resolved Hide resolved
src/network/netdev/macsec.c Show resolved Hide resolved
src/network/netdev/macsec.c Show resolved Hide resolved
src/network/netdev/netdev-gperf.gperf Outdated Show resolved Hide resolved
@yuwata yuwata added the reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks label Apr 2, 2019
@ssahani
Copy link
Contributor Author

ssahani commented Apr 3, 2019

Updated thanks for the review @yuwata

@topimiettinen
Copy link
Contributor

Keys could be seen as secrets that should not be accessible to unprivileged users, so later it would be nice to add a way to use a key file (preferably in such a format that it can be shared with all hosts in the network). The administrator could chmod the netdev file to 0700, but the contents would still be visible to unprivileged users with systemctl show.

@topimiettinen
Copy link
Contributor

Please also wrap the long lines to make it easier to review in GitHub.

@ssahani
Copy link
Contributor Author

ssahani commented Apr 3, 2019

@poettering Please take a look.

@ssahani
Copy link
Contributor Author

ssahani commented Apr 3, 2019

Keys could be seen as secrets that should not be accessible to unprivileged users, so later it would be nice to add a way to use a key file (preferably in such a format that it can be shared with all hosts in the network). The administrator could chmod the netdev file to 0700, but the contents would still be visible to unprivileged users with systemctl show.

yes taken.

man/systemd.netdev.xml Outdated Show resolved Hide resolved
man/systemd.netdev.xml Outdated Show resolved Hide resolved
man/systemd.netdev.xml Outdated Show resolved Hide resolved
man/systemd.netdev.xml Outdated Show resolved Hide resolved
man/systemd.netdev.xml Outdated Show resolved Hide resolved
src/network/netdev/macsec.c Outdated Show resolved Hide resolved
src/network/netdev/macsec.c Outdated Show resolved Hide resolved
src/network/netdev/macsec.c Outdated Show resolved Hide resolved
src/network/netdev/macsec.c Outdated Show resolved Hide resolved
src/network/netdev/macsec.h Outdated Show resolved Hide resolved
@ssahani ssahani force-pushed the macsec branch 5 times, most recently from 8f5911b to 1e65bea Compare April 3, 2019 12:56
src/network/netdev/macsec.c Outdated Show resolved Hide resolved
@yuwata
Copy link
Member

yuwata commented Apr 3, 2019

@ssahani So, as usual, can I continue your work? Or are you still working on this? I'd like to implement KeyFile= to hide key from .netdev files, as similar to WireGuard.PrivateKeyFile=. And I'd like to add testcases for this.

Anyway, I will start to test this PR tomorrow, about 10h later :-)

@ssahani
Copy link
Contributor Author

ssahani commented Apr 3, 2019

If you interested please do it. I like this mixed contribution. Feels like a team.

This work introduces MACsec to networkd.

Media Access Control Security (MACsec) is an 802.1AE IEEE
industry-standard security technology that provides secure
communication for all traffic on Ethernet links.
MACsec provides point-to-point security on Ethernet links between
directly connected nodes and is capable of identifying and preventing
most security threats, including denial of service, intrusion,
man-in-the-middle, masquerading, passive wiretapping, and playback attacks.

11-macsec.netdev
```
[NetDev]
Name=macsec-test
Kind=macsec

[MACsec]
Port=11

[MACsecReceiveAssociation]
Port=1234
MACAddress=c6:19:52:8f:e6:a0
PacketNumber=1
KeyId=00
Key=82828282828282828282828282828282

[MACsecReceiveChannel]
Port=1234
MACAddress=c6:19:52:8f:e6:a0

[MACsecTransmitAssociation]
PacketNumber=1024
KeyId=01
Key=81818181818181818181818181818181

```

closes systemd#5754

aaa
@ssahani
Copy link
Contributor Author

ssahani commented Apr 4, 2019

@yuwata I have addressed what were remaining. Please take it from here. thanks. I am going to work on tc now.

@yuwata
Copy link
Member

yuwata commented Apr 4, 2019

OK, I will start to test this PR from this state.

@yuwata
Copy link
Member

yuwata commented Apr 5, 2019

I've opened #12222, which contains a revised version of this PR. Let's close this.

@yuwata yuwata closed this Apr 5, 2019
@ssahani ssahani deleted the macsec branch May 3, 2019 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
network new-feature reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks
Development

Successfully merging this pull request may close these issues.

RFE: Add support for creating a macsec netdev and configure equivalent interface in systemd-networkd
4 participants