Skip to contentSkip to conversation

Conditional Access to Network Resources

DISCUSSION Chris Kuester 4 participants 4 messages Oct 21, 2008 SELinux security module

lore
Share & tools
lore
#0 lore raw

Hi List,

I'm facing the following problem:

I want to allow my domain to access certain ports on the local interface and certain ports on a nonlocal interface.
Example:
Domain may connect to port 25 over eth0
Domain may connect to port 4242 only on the loopback interface.

But if I allow my domain to access port 25 over eth0 it can also access port 25 on the local interface because I have to allow full access to both, local and remote nodes and sending traffic over both network interfaces.

I think I need to have some kind of condition, or do I missunderstand something here?

Constraint: Switching to SECMARKing instead of the "old" network confinement code is not an option at the moment. :(

Regards,
Chris

Signature · 16 lines
tarent Gesellschaft für Softwareentwicklung und IT-Beratung mbH

Heilsbachstr. 24, 53123 Bonn  | Poststr. 4-5, 10178 Berlin
fon: +49(228) / 52675-0       | fon: +49(30) / 27594853
fax: +49(228) / 52675-25      | fax: +49(30) / 78709617

Geschäftsführer
Boris Esser, Elmar Geese
HRB AG Bonn 5168
Ust-ID: DE122264941


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#1 lore raw
Quoted 2 lines · Chris Kuester

I want to allow my domain to access certain ports on the local interface and certain ports on a nonlocal interface.

I think that you would have to first declare your interfaces with for example "semanage interface -{a|d|m} [-tr] interface_spec" (man semanage) and then define policy about how domains may interact with the interfaces that you have declared. By default no interfaces are declared and domain may interact with any
interface.

#2 lore raw
In reply to Chris Kuester
Quoted 15 lines · Chris Kuester

Hi List,

I'm facing the following problem:

I want to allow my domain to access certain ports on the local interface and certain ports on a nonlocal interface.
Example:
Domain may connect to port 25 over eth0
Domain may connect to port 4242 only on the loopback interface.

But if I allow my domain to access port 25 over eth0 it can also access port 25 on the local interface because I have to allow full access to both, local and remote nodes and sending traffic over both network interfaces.

Quoted 5 lines

I think I need to have some kind of condition, or do I missunderstand something here?

Constraint: Switching to SECMARKing instead of the "old" network confinement code is not an option at the moment. :(

Offhand, I think that is your only option if you want to express combinations of restrictions like this - this is precisely why SECMARK was created.

Now, if your goal instead is to control the end point domains to which a domain can connect, then you might investigate using labeled networking and its controls instead to enforce restrictions over what domains can talk with what other domains.

Signature · 8 lines
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#3 lore raw
Quoted 19 lines · Stephen Smalley
Quoted 18 lines · Chris Kuester

Hi List,

I'm facing the following problem:

I want to allow my domain to access certain ports on the local interface and certain ports on a nonlocal interface. Example:
Domain may connect to port 25 over eth0
Domain may connect to port 4242 only on the loopback interface.

But if I allow my domain to access port 25 over eth0 it can also access port 25 on the local interface because I have to allow full access to both, local and remote nodes and sending traffic over both network interfaces.

I think I need to have some kind of condition, or do I missunderstand something here?

Quoted 6 lines
Quoted 2 lines

Constraint: Switching to SECMARKing instead of the "old" network confinement code is not an option at the moment. :(

Offhand, I think that is your only option if you want to express combinations of restrictions like this - this is precisely why SECMARK was created.

I agree with Stephen, with the combinations you describe I don't believe it would be possible to do what you want using the old/compat_net controls. Can you explain in more detail what your overall network security goals are for your domain/application? We might be able to help solve the problem another way ...

Also, if you don't mind, can I ask why SECMARK is not an option? I expect that the older controls will be marked as deprecated in the near future with the goal of removal some time after that. Understanding why SECMARK is not an option is important so we can make a smooth transition.

Signature · 7 lines
paul moore
linux @ hp

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.