Skip to contentSkip to conversation

Does it matter where .cil modules are build.

DISCUSSION Dan 3 participants 5 messages Jul 31, 2015 – Aug 4, 2015 SELinux security module

lore
Share & tools
lore

Dan

author
#0 lore raw

Hello everyone,

I have been reading up on the cil documentation and am starting to
get the hang of it and have successfully built my first module. I have a a module called test.cil. Now my only question on is where exactly would I put this module to build it or does it not matter where you stick them at? I know when you take the .pp packages and convert them to .cil they get stored in /var/lib/selinux/targeted/active/modules/400, but I'm just using the secilc compiler and nothing else to build policy.

Thanks.

#1 lore raw
Quoted 10 lines · Dan

Hello everyone,

I have been reading up on the cil documentation and am starting to get the
hang of it and have successfully built my first module. I have a a module called test.cil. Now my only question on is where exactly would I put this module to build it or does it not matter where you stick them at? I know when you take the .pp packages and convert them to .cil they get stored in /var/lib/selinux/targeted/active/modules/400, but I'm just using the secilc compiler and nothing else to build policy.

If you are using the CIL compiler to build the whole policy, then it doesn't matter where the files are located. Just specify all of the files that are part of the policy on the command line for secilc.

Do note that the CIL compiler does not build modules, it builds the complete policy, so if you are only building a module than it should go into the policy store. You should also use the policy store if you want to use the management functions of semanage.

Signature · 2 lines
James Carter <[email protected]>
National Security Agency
author
#2 lore raw

Yeah I'm just looking to build selinux policies to confine applications, etc, with the cil language and nothing else, so when you say the policy store is that the /var/lib/selinux/targeted/active/modules/400 directory?

Quoted 17 lines · James Carter
Quoted 11 lines · Dan

Hello everyone,

I have been reading up on the cil documentation and am starting
to get the
hang of it and have successfully built my first module. I have a a module called test.cil. Now my only question on is where exactly would I put this module to build it or does it not matter where you stick them at? I know when you take the .pp packages and convert them to .cil they get stored in /var/lib/selinux/targeted/active/modules/400, but I'm just using the secilc compiler and nothing else to build policy.

If you are using the CIL compiler to build the whole policy, then it doesn't matter where the files are located. Just specify all of the files that are part of the policy on the command line for secilc.

Do note that the CIL compiler does not build modules, it builds the complete policy, so if you are only building a module than it should go into the policy store. You should also use the policy store if you want to use the management functions of semanage.

#3 lore raw
Quoted 4 lines · Dan

Yeah I'm just looking to build selinux policies to confine applications, etc, with the cil language and nothing else, so when you say the policy store is that the /var/lib/selinux/targeted/active/modules/400 directory?

Quoted 16 lines
Quoted 15 lines · James Carter
Quoted 14 lines · Dan

Hello everyone,

I have been reading up on the cil documentation and am starting
to get the
hang of it and have successfully built my first module. I have a a module called
test.cil. Now my only question on is where exactly would I put this module to
build it or does it not matter where you stick them at? I know when you take the
.pp packages and convert them to .cil they get stored in /var/lib/selinux/targeted/active/modules/400, but I'm just using the secilc
compiler and nothing else to build policy.

/var/lib/selinux is a default location for your module store. It can be changed in semanage.conf.

Basically if you want to add a local policy module, just use

# semodule -i mypol.cil

This module will be loaded with the default priority for custom policies.

# semodule --list-module=full |grep mypol
400 mypol                    cil
Quoted 18 lines
Quoted 11 lines
Quoted 1 line

If you are using the CIL compiler to build the whole policy, then it doesn't matter where the files are located. Just specify all of the files that are part of the policy on the command line for secilc.

Do note that the CIL compiler does not build modules, it builds the complete policy, so if you are only building a module than it should go into the policy store. You should also use the policy store if you want to use the management functions of semanage.

_______________________________________________
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
Miroslav Grepl
Senior Software Engineer, SELinux Solutions
Red Hat, Inc.
author
#4 lore raw

Oh okay cool I understand now. It just built and everything went smoothly. Thanks guys.

Quoted 49 lines · Miroslav Grepl
Quoted 4 lines · Dan

Yeah I'm just looking to build selinux policies to confine applications, etc, with the cil language and nothing else, so when you say the policy store is that the /var/lib/selinux/targeted/active/modules/400 directory?

Quoted 16 lines
Quoted 15 lines · James Carter
Quoted 14 lines · Dan

Hello everyone,

I have been reading up on the cil documentation and am starting
to get the
hang of it and have successfully built my first module. I have a a module called
test.cil. Now my only question on is where exactly would I put this module to
build it or does it not matter where you stick them at? I know when you take the
.pp packages and convert them to .cil they get stored in /var/lib/selinux/targeted/active/modules/400, but I'm just using the secilc
compiler and nothing else to build policy.

/var/lib/selinux is a default location for your module store. It can be changed in semanage.conf.

Basically if you want to add a local policy module, just use

# semodule -i mypol.cil

This module will be loaded with the default priority for custom policies.

# semodule --list-module=full |grep mypol
400 mypol                    cil
Quoted 15 lines
Quoted 9 lines

If you are using the CIL compiler to build the whole policy, then it doesn't matter where the files are located. Just specify all of the files that are part of the policy on the command line for secilc.

Do note that the CIL compiler does not build modules, it builds the complete policy, so if you are only building a module than it should go into the policy store. You should also use the policy store if you want to use the management functions of semanage.

_______________________________________________
Selinux mailing list
[email protected]
To unsubscribe, send email to [email protected]. To get help, send an email containing "help" to [email protected].