does not seem to filter redundant attributes and rules
I am in the process of a DSSP rewrite, taking a different approach this time.
However I encountered something that seems suboptimal:
SECILC seems to not filter redundant attributes and rules
Example i have a type attribute and it has rules associated with it. However, the type attribute is not associated with any types.
I was hoping that SECILC would be smart enough to determine that it might as well filter both the type attribute as well as the rules associated with it.
To reproduce:
git clone https://github.com/DefenSec/dssp1-base.git
cd dssp1-base
secilc ls *.cil
sesearch -ASCT -s lib.ld_so.read_files_subj_type_attribute policy.30 seinfo -xalib.ld_so.read_files_subj_type_attribute policy.30
Am i expecting the impossible by expecting SECILC to be smart enough to determine that something is redundant, and that it can be filtered out until it becomes applicable?
Signature · 3 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02 https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02 Dominick Grift
Quoted 23 lines · Dominick Grift
I am in the process of a DSSP rewrite, taking a different approach this time.
However I encountered something that seems suboptimal:
SECILC seems to not filter redundant attributes and rules
Example i have a type attribute and it has rules associated with it. However, the type attribute is not associated with any types.
I was hoping that SECILC would be smart enough to determine that it might as well filter both the type attribute as well as the rules associated with it.
To reproduce:
git clone https://github.com/DefenSec/dssp1-base.git
cd dssp1-base
secilcls *.cil
sesearch -ASCT -s lib.ld_so.read_files_subj_type_attribute policy.30 seinfo -xalib.ld_so.read_files_subj_type_attribute policy.30
Quoted 5 lines
Am i expecting the impossible by expecting SECILC to be smart enough to determine that something is redundant, and that it can be filtered out until it becomes applicable?
I don't think that it would be too hard to remove attributes that have no types associated with them along with rules containing those attributes. I have this nagging feeling, though, that there is a reason that we didn't do that. I'll have to think about it a bit.
Jim
Quoted 7 lines
_______________________________________________
Selinux mailing list
[email protected]
To unsubscribe, send email to [email protected].
To get help, send an email containing "help" to [email protected].
Signature · 2 lines
James Carter <[email protected]> National Security Agency
Quoted 30 lines · James Carter
Quoted 23 lines · Dominick Grift
I am in the process of a DSSP rewrite, taking a different approach this time.
However I encountered something that seems suboptimal:
SECILC seems to not filter redundant attributes and rules
Example i have a type attribute and it has rules associated with it. However, the type attribute is not associated with any types.
I was hoping that SECILC would be smart enough to determine that it might as well filter both the type attribute as well as the rules associated with it.
To reproduce:
git clone https://github.com/DefenSec/dssp1-base.git
cd dssp1-base
secilcls *.cil
sesearch -ASCT -s lib.ld_so.read_files_subj_type_attribute policy.30 seinfo -xalib.ld_so.read_files_subj_type_attribute policy.30Quoted 5 lines
Am i expecting the impossible by expecting SECILC to be smart enough to determine that something is redundant, and that it can be filtered out until it becomes applicable?
Quoted 7 lines
I don't think that it would be too hard to remove attributes that have no types associated with them along with rules containing those attributes. I have this nagging feeling, though, that there is a reason that we didn't do that. I'll have to think about it a bit.
Jim
I had a hack 'n' slash attempt at this earlier for just avrules by adding naive checks in avrule_write (libsepol/src/write.c) to check if both the source and target type_set bitmaps have a cardinality of 0, though couldn't help but think I was missing something else. That didn't work in any case, and didn't seem like the codepath is ever hit when a CIL policy is written to disk (maybe it's only module policy avrule_write is called for?).
Any hints on where I can start prodding? Would be nice to get an idea of how the binary policy is serialized too.
Quoted 18 lines
Quoted 8 lines
_______________________________________________
Selinux mailing list
[email protected]
To unsubscribe, send email to [email protected].
To get help, send an email containing "help" to [email protected].Signature · 7 lines
James Carter <[email protected]> National Security Agency _______________________________________________ Selinux mailing list [email protected] To unsubscribe, send email to [email protected]. To get help, send an email containing "help" to [email protected].
Signature · 4 lines
Gary Tierney GPG fingerprint: 412C 0EF9 C305 68E6 B660 BDAF 706E D765 85AA 79D8 https://sks-keyservers.net/pks/lookup?op=get&search=0x706ED76585AA79D8
Quoted 46 lines · Gary Tierney
Quoted 30 lines · James Carter
Quoted 23 lines · Dominick Grift
I am in the process of a DSSP rewrite, taking a different approach this time.
However I encountered something that seems suboptimal:
SECILC seems to not filter redundant attributes and rules
Example i have a type attribute and it has rules associated with it. However, the type attribute is not associated with any types.
I was hoping that SECILC would be smart enough to determine that it might as well filter both the type attribute as well as the rules associated with it.
To reproduce:
git clone https://github.com/DefenSec/dssp1-base.git
cd dssp1-base
secilcls *.cil
sesearch -ASCT -s lib.ld_so.read_files_subj_type_attribute policy.30 seinfo -xalib.ld_so.read_files_subj_type_attribute policy.30Quoted 5 lines
Am i expecting the impossible by expecting SECILC to be smart enough to determine that something is redundant, and that it can be filtered out until it becomes applicable?
Quoted 7 lines
I don't think that it would be too hard to remove attributes that have no types associated with them along with rules containing those attributes. I have this nagging feeling, though, that there is a reason that we didn't do that. I'll have to think about it a bit.
Jim
I had a hack 'n' slash attempt at this earlier for just avrules by adding naive checks in
avrule_write(libsepol/src/write.c) to check if both the source and targettype_setbitmaps have a cardinality of 0, though couldn't help but think I was missing something else. That didn't work in any case, and didn't seem like the codepath is ever hit when a CIL policy is written to disk (maybe it's only module policyavrule_writeis called for?).
Quoted 3 lines
Any hints on where I can start prodding? Would be nice to get an idea of how the binary policy is serialized too.
Quoted 1 line
In libsepol/src/write.c:policydb_write(), avtab_write(), and avtab_write_item() checks could be added, but I am not sure off the top of my head what they would look like. This would cause the rules to be removed for all kernel policies.
For CIL only, in libsepol/cil/src/cil_binary.c:__cil_avrule_to_avtab() you could add a check for the src and tgt like the function below:
static int cil_check_unused_attribute(struct cil_symtab_datum *datum)
{
struct cil_tree_node *node = datum->nodes->head->data;
if (node->flavor == CIL_TYPEATTRIBUTE) {
struct cil_typeattribute *attr = (struct cil_typeattribute *)datum;
if (ebitmap_cardinality(attr->types) == 0) {
return CIL_TRUE;
}
}
return CIL_FALSE;
}Jim
Quoted 26 lines
Quoted 9 lines
Quoted 7 lines
_______________________________________________
Selinux mailing list
[email protected]
To unsubscribe, send email to [email protected].
To get help, send an email containing "help" to [email protected].Quoted 8 lines
--
James Carter <[email protected]>
National Security Agency
_______________________________________________
Selinux mailing list
[email protected]
To unsubscribe, send email to [email protected].
To get help, send an email containing "help" to [email protected]._______________________________________________
Selinux mailing list
[email protected]
To unsubscribe, send email to [email protected].
To get help, send an email containing "help" to [email protected].
Signature · 2 lines
James Carter <[email protected]> National Security Agency
Quoted 30 lines · James Carter
Quoted 23 lines · Dominick Grift
I am in the process of a DSSP rewrite, taking a different approach this time.
However I encountered something that seems suboptimal:
SECILC seems to not filter redundant attributes and rules
Example i have a type attribute and it has rules associated with it. However, the type attribute is not associated with any types.
I was hoping that SECILC would be smart enough to determine that it might as well filter both the type attribute as well as the rules associated with it.
To reproduce:
git clone https://github.com/DefenSec/dssp1-base.git
cd dssp1-base
secilcls *.cil
sesearch -ASCT -s lib.ld_so.read_files_subj_type_attribute policy.30 seinfo -xalib.ld_so.read_files_subj_type_attribute policy.30Quoted 5 lines
Am i expecting the impossible by expecting SECILC to be smart enough to determine that something is redundant, and that it can be filtered out until it becomes applicable?
Quoted 6 lines
I don't think that it would be too hard to remove attributes that have no types associated with them along with rules containing those attributes. I have this nagging feeling, though, that there is a reason that we didn't do that. I'll have to think about it a bit.
Jim
Have you given this some thought?
I suspect this could have significant impact.
consider the following:
CIL encourages the use of attributes to the fullest extent, and with dssp1 i have taken this to heart.
This should make dssp1 very scale-able. The more an identifier is used the greater the potential benefit.
Attributes and templates are at the heart of dssp1 and if the dssp1 model turns out to work (it is still a work in progress and I dont quite see where this is eventually taking me) then this would be a very welcome feature.
If you want to see the current state of dssp1:
git clone https://github.com/DefenSec/dssp1-base.git
cd dssp1-base
secilc ls *.cil
seinfo policy.30
Quoted 12 lines
Quoted 10 lines
_______________________________________________
Selinux mailing list
[email protected]
To unsubscribe, send email to [email protected]. To get help, send an email containing "help" to [email protected].
Signature · 3 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02 https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02 Dominick Grift
Quoted 55 lines · Dominick Grift
Quoted 30 lines · James Carter
Quoted 23 lines · Dominick Grift
I am in the process of a DSSP rewrite, taking a different approach this time.
However I encountered something that seems suboptimal:
SECILC seems to not filter redundant attributes and rules
Example i have a type attribute and it has rules associated with it. However, the type attribute is not associated with any types.
I was hoping that SECILC would be smart enough to determine that it might as well filter both the type attribute as well as the rules associated with it.
To reproduce:
git clone https://github.com/DefenSec/dssp1-base.git
cd dssp1-base
secilcls *.cil
sesearch -ASCT -s lib.ld_so.read_files_subj_type_attribute policy.30 seinfo -xalib.ld_so.read_files_subj_type_attribute policy.30Quoted 5 lines
Am i expecting the impossible by expecting SECILC to be smart enough to determine that something is redundant, and that it can be filtered out until it becomes applicable?
Quoted 6 lines
I don't think that it would be too hard to remove attributes that have no types associated with them along with rules containing those attributes. I have this nagging feeling, though, that there is a reason that we didn't do that. I'll have to think about it a bit.
Jim
Have you given this some thought?
I suspect this could have significant impact.
consider the following:
CIL encourages the use of attributes to the fullest extent, and with dssp1 i have taken this to heart.
This should make dssp1 very scale-able. The more an identifier is used the greater the potential benefit.
Attributes and templates are at the heart of dssp1 and if the dssp1 model turns out to work (it is still a work in progress and I dont quite see where this is eventually taking me) then this would be a very welcome feature.
Quoted 6 lines
If you want to see the current state of dssp1:
git clone https://github.com/DefenSec/dssp1-base.git
cd dssp1-base
secilcls *.cil
seinfo policy.30
Here is a 10 minute demo that tries to explain the benefits and the current drawbacks of this approach (for anyone interested)
https://www.youtube.com/watch?v=MdqjVgjXvM8
Quoted 15 lines
Quoted 13 lines
Quoted 11 lines
_______________________________________________
Selinux mailing list
[email protected]
To unsubscribe, send email to [email protected]. To get help, send an email containing "help" to [email protected].
Signature · 3 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02 https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02 Dominick Grift