Skip to contentSkip to conversation

typeattributeset with "and" expression does not work

secilc Dominick Grift 2 participants 7 messages Apr 22, 2014 – Apr 23, 2014 SELinux security module

lore
Share & tools
lore
#0 lore raw

(type foo)
(typeattribute bar)
(typeattribute baz)
(typeattributeset bar (and baz foo))

It compiles but neither bar, nor baz gets associated with type foo

Also, i still have that weird boolean issue where, even though sesearch shows the rules are loaded and enabled, SELinux still blocks the access

#1 lore raw
Quoted 7 lines · Dominick Grift

(type foo)
(typeattribute bar)
(typeattribute baz)
(typeattributeset bar (and baz foo))

It compiles but neither bar, nor baz gets associated with type foo

This is because 'and' is similar to the set intersection of baz and foo. But baz is empty, so the intersection of baz and foo is nothing, resulting in nothing being added to the bar attribute.

You probably want the union of baz and foo? Replacing 'and' with 'or' would make it so bar would be associated with foo and everything associated with baz.

Quoted 2 lines

Also, i still have that weird boolean issue where, even though sesearch shows the rules are loaded and enabled, SELinux still blocks the access

I think we actually fixed this about an hour ago. Give it a shot, let us know if it's actually fixed.

Thanks for the feedback!
- Steve

#2 lore raw
Quoted 9 lines · Steve Lawrence
Quoted 7 lines · Dominick Grift

(type foo)
(typeattribute bar)
(typeattribute baz)
(typeattributeset bar (and baz foo))

It compiles but neither bar, nor baz gets associated with type foo

Quoted 7 lines

This is because 'and' is similar to the set intersection of baz and foo. But baz is empty, so the intersection of baz and foo is nothing, resulting in nothing being added to the bar attribute.

You probably want the union of baz and foo? Replacing 'and' with 'or' would make it so bar would be associated with foo and everything associated with baz.

Impressive, what i am looking for is actually very simple.

I just want to know how i can associate more than a single type attribute to a specified type in a single statement, that is possible.

(type foo)
(typeattribute bar)
(typeattribute baz)

The equivalent of:

(typeattributeset bar foo)
(typeattributeset baz foo)

In a single statement instead of two

Quoted 5 lines
Quoted 2 lines

Also, i still have that weird boolean issue where, even though sesearch shows the rules are loaded and enabled, SELinux still blocks the access

I think we actually fixed this about an hour ago. Give it a shot, let us know if it's actually fixed.

Nice, i will try with up-to-date secilc tomorrow

Quoted 4 lines

Thanks for the feedback!
- Steve

#3 lore raw
Quoted 27 lines · Dominick Grift
Quoted 9 lines · Steve Lawrence
Quoted 7 lines · Dominick Grift

(type foo)
(typeattribute bar)
(typeattribute baz)
(typeattributeset bar (and baz foo))

It compiles but neither bar, nor baz gets associated with type foo

Quoted 7 lines

This is because 'and' is similar to the set intersection of baz and foo. But baz is empty, so the intersection of baz and foo is nothing, resulting in nothing being added to the bar attribute.

You probably want the union of baz and foo? Replacing 'and' with 'or' would make it so bar would be associated with foo and everything associated with baz.

Impressive, what i am looking for is actually very simple.

I just want to know how i can associate more than a single type attribute to a specified type in a single statement, that is possible.

(type foo)
(typeattribute bar)
(typeattribute baz)

Quoted 7 lines

The equivalent of:

(typeattributeset bar foo)
(typeattributeset baz foo)

In a single statement instead of two

Unfortunately, there is no way to associate a single type/attribute with multiple attributes in a single statement. CIL is a pretty verbose language.

Quoted 14 lines
Quoted 5 lines
Quoted 2 lines

Also, i still have that weird boolean issue where, even though sesearch shows the rules are loaded and enabled, SELinux still blocks the access

I think we actually fixed this about an hour ago. Give it a shot, let us know if it's actually fixed.

Nice, i will try with up-to-date secilc tomorrow

Quoted 4 lines

Thanks for the feedback!
- Steve

#4 lore raw
Quoted 7 lines · Steve Lawrence
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Also, i still have that weird boolean issue where, even though sesearch shows the rules are loaded and enabled, SELinux still blocks the access

I think we actually fixed this about an hour ago. Give it a shot, let us know if it's actually fixed.

Nice, i will try with up-to-date secilc tomorrow

Current head does not fix the boolean issue, i just verified and the issue is still there

Quoted 7 lines
Quoted 6 lines
Quoted 4 lines

Thanks for the feedback!
- Steve

#5 lore raw
Quoted 5 lines · Dominick Grift
Quoted 3 lines · Steve Lawrence
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

Also, i still have that weird boolean issue where, even though sesearch shows the rules are loaded and enabled, SELinux still blocks the access

Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

I think we actually fixed this about an hour ago. Give it a shot, let us know if it's actually fixed.

Nice, i will try with up-to-date secilc tomorrow

Current head does not fix the boolean issue, i just verified and the issue is still there

Actually it partly works (but it did before as well)

Its the conditional capability permissions that do not work

i have for example a set of consitional rules:

(allow ARG1 security_t (security load_policy))
(allow ARG1 security_t (file (write)))

The file write works but the security load_policy does not work

#6 lore raw
Quoted 16 lines · Dominick Grift
Quoted 5 lines · Dominick Grift
Quoted 3 lines · Steve Lawrence
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

Also, i still have that weird boolean issue where, even though sesearch shows the rules are loaded and enabled, SELinux still blocks the access

Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

I think we actually fixed this about an hour ago. Give it a shot, let us know if it's actually fixed.

Nice, i will try with up-to-date secilc tomorrow

Current head does not fix the boolean issue, i just verified and the issue is still there

Actually it partly works (but it did before as well)

Quoted 9 lines

Its the conditional capability permissions that do not work

i have for example a set of consitional rules:

(allow ARG1 security_t (security load_policy))
(allow ARG1 security_t (file (write)))

The file write works but the security load_policy does not work

The latest commit seems to have fixed the conditional issue at long last, thaanks!!