Zum Hauptinhalt springen
Intelligence View
⚡ tsecurity.de Intelligence

Fallback Label Configuration Example

One of the new features added to the 2.6.25 release of the Linux Kernel was the ability to specify fallback peer labels using NetLabel. This made it possible…

Beitrag
0
Seite
0
↗ Quelle (paul-moore.com)
Cloud & Tech-Stack · 6 Min. Lesezeit
Quelle: paul-moore.com
Rubrik: Unix & Linux Server

One of the new features added to the 2.6.25 release of the Linux Kernel was the
ability to specify fallback peer labels using NetLabel. This made it possible
for system administrators to specify a peer label to be used in the absence of a
peer labeling protocol such as CIPSO or Labeled IPsec. In this post I’ll try to
provide a quick introduction on how to configure NetLabel to provide fallback
peer labels.



The first step is to make sure you have all the right kernel and userspace bits
in place. Any standard Linux distribution kernel 2.6.25 or greater that has
NetLabel support should work. In addition to the kernel you will need to make
sure the userspace utility, netlabelctl, supports the new configuration options;
this requires netlabel_tools version 0.18 or greater. Once you have verified
that you have the right versions installed and running, you can verify
everything by running the following commands.



# netlabelctl -p mgmt version
NetLabel protocol version : 2
# netlabelctl -h
NetLabel Control Utility, version 0.18 (libnetlabel 0.18)
Usage: netlabelctl [<flags>] <module> [<commands>]

Flags:
-h : help/usage message
-p : make the output pretty
-t <secs> : timeout
-v : verbose mode

Modules and Commands:
mgmt : NetLabel management
version
protocols
map : Domain/Protocol mapping
add default|domain:<domain> protocol:<protocol>[,<extra>]
del default|domain:<domain>
list
unlbl : Unlabeled packet handling
accept on|off
add default|interface:<DEV> address:<ADDR>[/<MASK>]
label:<LABEL>
del default|interface:<DEV> address:<ADDR>[/<MASK>]
list
cipsov4 : CIPSO/IPv4 packet handling
add trans doi:<DOI> tags:<T1>,<Tn>
levels:<LL1>=<RL1>,<LLn>=<RLn>
categories:<LC1>=<RC1>,<LCn>=<RCn>
add pass doi:<DOI> tags:<T1>,<Tn>
del doi:<DOI>
list [doi:<DOI>]

The first command checks to see that the kernel speaks version 2 of the NetLabel
control protocol which means that it understands the new fallback peer label
configuration options. The second command verifies that you have netlabelctl
version 0.18 installed and that it supports the fallback configuration commands
that we will be using. If everything looks okay it is time to move on to the
next step, building a test tool that we can use to verify the configuration.
Obviously this isn’t a strict requirement for configuring the fallback label
mechanism but it is a nice way to verify that your configuration is correct. The
test tool I will be using here is a simple little test program I wrote some time
ago to test basic peer label functionality for IPv4 TCP sockets, I call it
getpeercon_server. Once you have downloaded the C source file you will need to
compile it with the following command, if you are on a Fedora system make sure
you have the libselinux-devel package installed.



# gcc -o getpeercon_server getpeercon_server.c -lselinux
# ./getpeercon_server
usage: ./getpeercon_server <port>

As you can see the tool is very simple and takes a single argument, the TCP port
to bind to a listen for connections. If you start the server on port 5000 and
connect to it with telnet, netcat, or some other simple TCP application you
should see something similar to what is shown below.



# ./getpeercon_server 5000
-> creating socket ... ok
-> listening on TCP port 5000 ... ok
-> waiting ... connect(127.0.0.1,NO_CONTEXT)
Hello NetLabel Fans!
-> connection closed
-> waiting ...

In the example above we can see that a client connected from localhost,
127.0.0.1, and there was no peer label information provided with the connection,
NO_CONTEXT. Now lets configure a fallback peer label for localhost and try it
again. Adding a fallback label is relatively simple and can be done with a
single command. However, the example below executes two commands. The first
command adds a fallback label, “system_u:object_r:netlabel_peer_t:s0”, to all
traffic coming over the loopback interface, “lo”, from localhost, 127.0.0.1. The
second command displays all of configured fallback labels; not a necessary step
but helpful to ensure that you configured everything correctly.



# netlabelctl unlbl add interface:lo address:127.0.0.1 label:system_u:object_r:netlabel_peer_t:s0
# netlabelctl -p unlbl list
Accept unlabeled packets : on
Configured NetLabel address mappings (1)
interface: lo
address: 127.0.0.1/32
label: "system_u:object_r:netlabel_peer_t:s0"

Now, lets try our simple connection test again with our newly established
fallback label configuration.



# ./getpeercon_server 5000
-> creating socket ... ok
-> listening on TCP port 5000 ... ok
-> waiting ... connect(127.0.0.1,system_u:object_r:netlabel_peer_t:s0)
Fallback Labels Are Really Cool!
-> connection closed
-> waiting ...

If you look at the output you will notice almost everything is the same except
for one important thing, instead of NO_CONTEXT the test tool is displaying the
fallback label we just configured. The kernel treats the NetLabel fallback label
just the same as a normal peer label taken from a CIPSO tag or Labeled IPsec
Security Association. This means that not only is the fallback label passed to
applications that request it, it is also used when enforcing the LSM’s network
security policy; in this case SELinux. However, it is important to remember that
the fallback labels are overridden by peer labeling protocols. As a result, if
both fallback peer label information and Labeled IPsec peer label information is
available then the kernel will use the Labeled IPsec peer label information and
ignore the fallback peer labels. Fallback peer labels can be configured based on
the network interface, network address, and netmask or just network address and
netmask when the default network interface is chosen.



Before you start making use of the NetLabel fallback labels, there are a few
things you should take into consideration. First, while the fallback
functionality was included in Linux Kernel 2.6.25 there was a small bug which
prevented some IPv6 fallback labels from being displayed correctly using the
“netlabelctl -p unlbl list” command; this has been fixed in kernel 2.6.26.
Second, Fedora has not yet adopted version 0.18 of netlabel_tools which means
that you will need to download and build netlabelctl separately to take
advantage of the new fallback functionality. A Red Hat bugzilla entry has been
filed to get the latest netlabel_tools package included in Fedora.



Social ReaktionenReagiere als Erste:r — dein Feedback zählt!
Informations-Bewertung:
✏️ Information ergänzen
🛡️ Versioniert via CMS-Revisions-Engine (Freigabe-Queue für Gäste)

💬 Community-Diskussion & Kommentare

🌐 Zum Hauptchat

Starte die Diskussion im Social-Chat Broadcast Stream oder reiche oben über „Information ergänzen“ einen Fachbeitrag ein.

Security Briefing Kostenlos · 1-Klick-Abmeldung

Intelligence Digest — kostenlos

Täglich die wichtigsten Security-News · jederzeit abbestellbar

Community Rating &amp; Social Proof
⭐ Leser-Wertung
–
Ø / 5.0
Noch keine Leser-Bewertungen
War dieser Artikel hilfreich?
0
Jetzt Bewertung abgeben
Detail-Bewertung (optional)
Inhalt & Qualität
Quelle & Glaubwürdigkeit
Aktualität

Verwandte Story-Cluster & Quellen (Vektor-KI)

6 Cluster
26 Quellen
Black Friday Oura Ring deals: The best of the deals so far, picked by a wearable-tech expert
Latest from TechRadar vor 12 Min.
25 weitere Quellen
CNETvor 6 JahrenOur Favorite Blenders of 2026 Are on Sale Ahead of Black Friday CNETvor 17 Min.Brighten Up Your Day by Saving 20% Off Flashlights With Olight’s Black Friday Sale CNETvor 9 Min.Live: Black Friday Deals Are Here. Shop Expert Picks Across Tech, Everyday Essentials and More at Up to 60% Off Golem.devor 22 Min.Anzeige: Logitech-Tastatur MX Keys S am Black Friday zum Sensationspreis auf Amazon PC-WELTvor 34 Min.Luminar zum Black Friday: KI-Bildbearbeitung für nur 79,20 Euro Latest from TechRadarvor 49 Min.This is the pair of open earbuds to hunt down over Black Friday Latest from TechRadarvor 1 Std.Best AirPods Black Friday deals: all live savings on AirPods Pro 3 and more Computer Bildvor 1 Std.Philips Sonicare DiamondClean 9000 zum Black Friday günstiger netzwelt.devor 2 Std.ESR startet mit Black-Friday-Rabatten: Diese AirPods-Hüllen lohnen sich jetzt netzwelt.devor 2 Std.PlayStation 5 geschenkt: Diese Black-Friday-Aktion legt die Konsole gratis obendrauf netzwelt.devor 1 Std.6 Dyson-Staubsauger im Vergleich: Dieser Sauger wird am Black Friday überraschend zum Preis/Leistungssieger netzwelt.devor 1 Std.Monitore im Angebot zum Black Friday: Gutes Bild für Office, Gaming und mehr Golem.devor 52 Min.Anzeige: Akkuschrauber mit 20 Bits zum Black Friday erstmals unter 50 Euro bei Amazon PC-WELTvor 1 Std.Die günstigsten Handytarife an Black Friday von 10 GB bis Unlimited: Hier lohnt sich ein Wechsel PC-WELTvor 1 Std.Black Friday 2026 bei LiberNovo: Ergonomische Bürostühle mit bis zu 44 Prozent Rabatt Latest from TechRadarvor 1 Std.The best Black Friday robot vacuum deals: Dreame, Shark, Dyson, and Roborock Golem.devor 1 Std.Anzeige: Topdon-Starthilfe-Powerbank für Kfz zum Black-Friday-Bestpreis nur rund 85 Euro heise online Newsvor 1 Std.Black Friday: Die besten Kopfhörer zum Tiefstpreis – Sonos Ace, Nothing & Shokz Latest from Windows Centralvor 1 Std.Dell's Black Friday deals drop major savings on Alienware OLED monitors CNETvor 2 JahrenMake Every Night Game Night and Save $90 on the Nex Playground With This Black Friday Deal DEV Communityvor 1 Std.The app is part of the gadget: 14,000 App Store reviews of 28 device apps before Black Friday Latest from TechRadarvor 2 Std.Black Friday tech deals under $100 / £100: Fire TV Sticks, earbuds, coffee machines and more Caschys Blogvor 3 Std.Google One: Black-Friday-Angebot mit bis zu 50 Prozent Rabatt netzwelt.devor 2 Std.Dem Testsieger ebenbürtig: Zum Black Friday stürzt Xiaomis stärkster E-Scooter im Preis ab Macerkopf.devor 2 Std.Fotos verbessern mit Aiarty: 52 % Rabatt + Gratisgeschenke zum Black Friday
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Fallback Label Configuration Example

Thematisch verwandte Begriffe: Fallback, Label, Configuration, Example · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
Widgets & Themen
Widgets werden geladen…
Nächster Beitrag