ps aux output under sysadm context in refpolicy
I'm having a heck of a time limiting the ps aux output to show only what I think sysadm should be able to see.
I have a number of types that are running and I get a ptrace denied, but sysadm can still see the process. I'm really not sure why this is the case. I've set all the build options correctly, ie left the defaults, the booleans are set to no. Somewhere there is something going on that lets sysadm see all of this stuff, and I just can't find it.
According to apol there is not way for me to read the proc files as sysadm. What Am I missing, or where should I look.
thanx,
-jj-
He thought he saw an albatross That fluttered 'round the lamp. He looked again and saw it was A penny postage stamp. "You'd best be getting home," he said, "The nights are rather damp."
Quoted 11 lines · Jeremiah Jahn
I'm having a heck of a time limiting the ps aux output to show only what I think sysadm should be able to see.
I have a number of types that are running and I get a ptrace denied, but sysadm can still see the process. I'm really not sure why this is the case. I've set all the build options correctly, ie left the defaults, the booleans are set to no. Somewhere there is something going on that lets sysadm see all of this stuff, and I just can't find it.
According to apol there is not way for me to read the proc files as sysadm. What Am I missing, or where should I look.
Access to the basic /proc/pid information is allowed by:
# search the /proc/pid directory for the target domain allow <source domain> <target domain>:dir search; # read public information about the target domain allow <source domain> <target domain>:file read; since the /proc/pid files are labeled with the domain of the associated process.
Certain /proc/pid nodes are further limited by ptrace since they reveal what should be private information to the process.
Quoted 9 lines
thanx,
-jj-He thought he saw an albatross That fluttered 'round the lamp. He looked again and saw it was A penny postage stamp. "You'd best be getting home," he said, "The nights are rather damp."
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.
I wonder if I'm using apol incorrectly. I have:
Analysis type = Doman Transition
Direction = Forward
source domain = sysadm_t
use access filters = checked
included object types = mysecure_t
included object classes = dir & file
permission for dir = getattr & read & search
permissions for file = getattr & read
results tree = sysadm_t & nothing else, no possible expansions.
I read this as, there is no possible path from sysadm_t to mysecure_t
yet, I get the following output from pas auxZ
system_u:system_r:mysecure_t:s0 mysecure 3531 0.0 0.0 139276 2396 ? Sl Feb14 0:00 /usr/local/mysecure/bin/mysecure -Umysecure
I'm stumped :)
Quoted 21 lines · Stephen Smalley
Quoted 11 lines · Jeremiah Jahn
I'm having a heck of a time limiting the ps aux output to show only what I think sysadm should be able to see.
I have a number of types that are running and I get a ptrace denied, but sysadm can still see the process. I'm really not sure why this is the case. I've set all the build options correctly, ie left the defaults, the booleans are set to no. Somewhere there is something going on that lets sysadm see all of this stuff, and I just can't find it.
According to apol there is not way for me to read the proc files as sysadm. What Am I missing, or where should I look.
Access to the basic
/proc/pidinformation is allowed by:# search the /proc/pid directory for the target domain allow <source domain> <target domain>:dir search; # read public information about the target domain allow <source domain> <target domain>:file read; since the /proc/pid files are labeled with the domain of the associated process.
Quoted 12 lines
Certain
/proc/pidnodes are further limited by ptrace since they reveal what should be private information to the process.Quoted 9 lines
thanx,
-jj-He thought he saw an albatross That fluttered 'round the lamp. He looked again and saw it was A penny postage stamp. "You'd best be getting home," he said, "The nights are rather damp."
Political T.V. commercials prove one thing: some candidates can tell all their good points and qualifications in just 30 seconds.
Quoted 10 lines · Jeremiah Jahn
I wonder if I'm using apol incorrectly. I have:
Analysis type = Doman Transition
Direction = Forward
source domain =sysadm_t
use access filters = checked
included object types =mysecure_t
included object classes = dir & file
permission for dir = getattr & read & search
permissions for file = getattr & read
Quoted 8 lines
results tree =
sysadm_t& nothing else, no possible expansions.I read this as, there is no possible path from
sysadm_ttomysecure_tyet, I get the following output from pas auxZ
system_u:system_r:mysecure_t:s0 mysecure 3531 0.0 0.0 139276 2396 ? Sl Feb14 0:00/usr/local/mysecure/bin/mysecure-UmysecureI'm stumped :)
Domain transitions are process transitions, i.e. can sysadm_t transition to mysecure_t. Not can it read from it.
You can use the rule searching facilities to look for direct read rules, or can use the information flow analysis to see if there is any path by which mysecure_t can flow to sysadm_t, but the latter is likely less useful because there is almost always at least one indirect path by which information can flow.
Quoted 37 lines · Stephen Smalley
Quoted 21 lines · Jeremiah Jahn
Quoted 11 lines
I'm having a heck of a time limiting the ps aux output to show only what I think sysadm should be able to see.
I have a number of types that are running and I get a ptrace denied, but sysadm can still see the process. I'm really not sure why this is the case. I've set all the build options correctly, ie left the defaults, the booleans are set to no. Somewhere there is something going on that lets sysadm see all of this stuff, and I just can't find it.
According to apol there is not way for me to read the proc files as sysadm. What Am I missing, or where should I look.
Access to the basic
/proc/pidinformation is allowed by:# search the /proc/pid directory for the target domain allow <source domain> <target domain>:dir search; # read public information about the target domain allow <source domain> <target domain>:file read; since the /proc/pid files are labeled with the domain of the associated process.Quoted 12 lines
Certain
/proc/pidnodes are further limited by ptrace since they reveal what should be private information to the process.Quoted 9 lines
thanx,
-jj-He thought he saw an albatross That fluttered 'round the lamp. He looked again and saw it was A penny postage stamp. "You'd best be getting home," he said, "The nights are rather damp."
Political T.V. commercials prove one thing: some candidates can tell all their good points and qualifications in just 30 seconds.
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.
okay, done, apparently I have some attribute set some place, but apol only shows it a @ttr2718 Is there some way I can get this to translate to English? I'm not that familiar with apol.
Quoted 20 lines · Stephen Smalley
Quoted 10 lines · Jeremiah Jahn
I wonder if I'm using apol incorrectly. I have:
Analysis type = Doman Transition
Direction = Forward
source domain =sysadm_t
use access filters = checked
included object types =mysecure_t
included object classes = dir & file
permission for dir = getattr & read & search
permissions for file = getattr & readQuoted 8 lines
results tree =
sysadm_t& nothing else, no possible expansions.I read this as, there is no possible path from
sysadm_ttomysecure_tyet, I get the following output from pas auxZ
system_u:system_r:mysecure_t:s0 mysecure 3531 0.0 0.0 139276 2396 ? Sl Feb14 0:00/usr/local/mysecure/bin/mysecure-UmysecureI'm stumped :)
Quoted 46 lines
Domain transitions are process transitions, i.e. can
sysadm_ttransition tomysecure_t. Not can it read from it.You can use the rule searching facilities to look for direct read rules, or can use the information flow analysis to see if there is any path by which
mysecure_tcan flow tosysadm_t, but the latter is likely less useful because there is almost always at least one indirect path by which information can flow.Quoted 37 lines · Stephen Smalley
Quoted 21 lines · Jeremiah Jahn
Quoted 11 lines
I'm having a heck of a time limiting the ps aux output to show only what I think sysadm should be able to see.
I have a number of types that are running and I get a ptrace denied, but sysadm can still see the process. I'm really not sure why this is the case. I've set all the build options correctly, ie left the defaults, the booleans are set to no. Somewhere there is something going on that lets sysadm see all of this stuff, and I just can't find it.
According to apol there is not way for me to read the proc files as sysadm. What Am I missing, or where should I look.
Access to the basic
/proc/pidinformation is allowed by:# search the /proc/pid directory for the target domain allow <source domain> <target domain>:dir search; # read public information about the target domain allow <source domain> <target domain>:file read; since the /proc/pid files are labeled with the domain of the associated process.Quoted 12 lines
Certain
/proc/pidnodes are further limited by ptrace since they reveal what should be private information to the process.Quoted 9 lines
thanx,
-jj-He thought he saw an albatross That fluttered 'round the lamp. He looked again and saw it was A penny postage stamp. "You'd best be getting home," he said, "The nights are rather damp."
Political T.V. commercials prove one thing: some candidates can tell all their good points and qualifications in just 30 seconds.
With every passing hour our solar system comes forty-three thousand miles closer to globular cluster M13 in the constellation Hercules, and still there are some misfits who continue to insist that there is no such thing as progress. -- Ransom K. Ferm
Quoted 3 lines · Jeremiah Jahn
okay, done, apparently I have some attribute set some place, but apol only shows it a @ttr2718 Is there some way I can get this to translate to English? I'm not that familiar with apol.
Kernel policy doesn't preserve attribute names in the symbol table, because it doesn't need them (my fault).
To get the attribute name, you'd need to run the analysis on the modular policy or source policy instead. The current version of apol can load up any form of policy.
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.
Gen_require scoping?
In reply to Stephen SmalleyHi all,
we're trying to setup an JBoss-module. As you probably know JBoss needs Java and vice versa.
For this we created an .te and if. Part of the .if is an interface to allow writing logfiles. Relevant part:
########################################
## <summary>
## Allow the specified domain to
## write jboss log files
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(jboss_write_log',
gen_require(`
type jboss_log_t;
')
logging_search_logs($1)
allow $1 jboss_log_t:dir list_dir_perms;
allow $1 jboss_log_t:dir rw_dir_perms;
allow $1 jboss_log_t:file read_file_perms;
write_files_pattern($1,jboss_log_t,jboss_log_t);
allow $1 jboss_log_t:dir search_dir_perms;
allow $1 jboss_log_t:dir getattr_dir_perms;')
However, when compiling this modules, all fails at "allow $1 jboss_log_t:dir list_dir_perms;" with this error:
Compiling targeted base module/usr/bin/checkmodule -M -U allow base.conf -o tmp/base.mod /usr/bin/checkmodule: loading policy configuration from base.conf policy/modules/apps/java.te:22:ERROR 'unknown type jboss_log_t' at token ';' on line 491016:
#line 22
allow java_t jboss_log_t:dir { getattr search read lock ioctl };/usr/bin/checkmodule: error(s) encountered while parsing configuration
make: *** [tmp/base.mod] Error 1
Just to try, we declared "type jboss_log_t;" before logging_search_logs and after the gen_require. After this I was able to compile the module (but did run into other problems)...
So, I believe I have an scoping issue; gen_require checks (and find) jboss_log_t. But as soon as someone is trying to use jboss_log_t in the interface, it breaks..
To make everything clear:
We changed java.te and added:
#Java needs access to jboss_log_tjboss_write_log(java_t);
What I am doing wrong here??
Cheers,
Bart
--
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.
Re: Gen_require scoping?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 63 lines · [email protected] wrote:
Hi all,
we're trying to setup an JBoss-module. As you probably know JBoss needs Java and vice versa.
For this we created an .te and if. Part of the .if is an interface to allow writing logfiles. Relevant part:
########################################
## <summary>
## Allow the specified domain to
## write jboss log files
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(jboss_write_log',gen_require(` type jboss_log_t; ') logging_search_logs($1) allow $1 jboss_log_t:dir list_dir_perms; allow $1 jboss_log_t:dir rw_dir_perms; allow $1 jboss_log_t:file read_file_perms; write_files_pattern($1,jboss_log_t,jboss_log_t); allow $1 jboss_log_t:dir search_dir_perms; allow $1 jboss_log_t:dir getattr_dir_perms;')
However, when compiling this modules, all fails at "allow $1 jboss_log_t:dir
list_dir_perms;" with this error:Compiling targeted base module
/usr/bin/checkmodule-M -U allow base.conf -o tmp/base.mod/usr/bin/checkmodule: loading policy configuration from base.conf policy/modules/apps/java.te:22:ERROR 'unknown typejboss_log_t' at token ';' on line 491016:
#line 22allow java_t jboss_log_t:dir { getattr search read lock ioctl };
/usr/bin/checkmodule: error(s) encountered while parsing configuration
make: *** [tmp/base.mod] Error 1Just to try, we declared "type
jboss_log_t;" beforelogging_search_logsand after thegen_require. After this I was able to compile the module (but did run into other problems)...So, I believe I have an scoping issue;
gen_requirechecks (and find)jboss_log_t. But as soon as someone is trying to usejboss_log_tin the interface, it breaks..To make everything clear:
We changed java.te and added:#Java needs access to
jboss_log_tjboss_write_log(java_t);What I am doing wrong here??
Cheers,
Quoted 8 lines
Bart
--
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.
No your module needs a te file that defined jboss_log_t, not just the interface, and probably need a file context file.
cat jboss.te
type jboss_log_t;logging_file_type(jboss_log_t)
cat jboss.fc/var/log/jboss.* gen_context(system_u:object_r:jboss_log_t,s0)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iEYEARECAAYFAke/AjAACgkQrlYvE4MpobP52QCgopXRW8J10kAKL3T4XULq077o u5QAoNcSqVRUryRI52Vo88qeZY+1V1ip
=z13R
-----END PGP SIGNATURE-----
--
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.
Re: Gen_require scoping?
Quoted 38 lines
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Quoted 5 lines · [email protected] wrote:
Hi all,
we're trying to setup an JBoss-module. As you probably know JBoss needs Java and vice versa.
Quoted 9 lines
For this we created an .te and if. Part of the .if is an interface to allow writing logfiles. Relevant part:
What I am doing wrong here??Cheers,
Bart
No your module needs a te file that defined
jboss_log_t, not just the interface, and probably need a file context file.cat jboss.te
type
jboss_log_t;logging_file_type(jboss_log_t)cat jboss.fc
/var/log/jboss.*gen_context(system_u:object_r:jboss_log_t,s0)-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.orgiEYEARECAAYFAke/AjAACgkQrlYvE4MpobP52QCgopXRW8J10kAKL3T4XULq077o u5QAoNcSqVRUryRI52Vo88qeZY+1V1ip
=z13R
-----END PGP SIGNATURE-----
Quoted 6 lines
--
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.
Hi Daniel,
We (Bart and I) just pasted the relevant part of our module. To be more complete I pasted the whole module (so the jboss.te, jboss.if and the jboss.fc) at the following urls:
http://pastebin.ca/914239
http://pastebin.ca/914240
http://pastebin.ca/914243
The only difference I can see in you statement and ours is this:
Our jboss.te:
type jboss_log_t;logging_log_file(jboss_log_t)
Your jboss.te example:
type jboss_log_t;logging_file_type(jboss_log_t)
Our jboss.fc:
/var/log/jboss(/.*)? gen_context(system_u:object_r:jboss_log_t,s0)
Your jboss.fc example:/var/log/jboss.* gen_context(system_u:object_r:jboss_log_t,s0)
Is that difference the reason why jboss_log_t isn't available to other modules?
Cheers,
Ronald
--
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.
Re: Gen_require scoping?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 18 lines · [email protected] wrote:
Quoted 9 lines · [email protected] wrote:
Quoted 9 lines
Quoted 9 lines
Hi all,
we're trying to setup an JBoss-module. As you probably know JBoss needs Java and vice versa.
For this we created an .te and if. Part of the .if is an interface to allow writing logfiles. Relevant part:
What I am doing wrong here??Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Cheers,
Bart
No your module needs a te file that defined
jboss_log_t, not just the interface, and probably need a file context file.
Quoted 9 lines
cat jboss.te
type
jboss_log_t;logging_file_type(jboss_log_t)cat jboss.fc
/var/log/jboss.*gen_context(system_u:object_r:jboss_log_t,s0)Quoted 1 line
- --
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.
Quoted 30 lines
Quoted 1 line
Hi Daniel,
We (Bart and I) just pasted the relevant part of our module. To be more complete I pasted the whole module (so the jboss.te, jboss.if and the jboss.fc) at the following urls:
http://pastebin.ca/914239
http://pastebin.ca/914240
http://pastebin.ca/914243The only difference I can see in you statement and ours is this:
Our jboss.te:
typejboss_log_t;logging_log_file(jboss_log_t)Your jboss.te example:
type
jboss_log_t;logging_file_type(jboss_log_t)Our jboss.fc:
/var/log/jboss(/.*)?gen_context(system_u:object_r:jboss_log_t,s0)Your jboss.fc example:
/var/log/jboss.*gen_context(system_u:object_r:jboss_log_t,s0)
Quoted 7 lines
Is that difference the reason why
jboss_log_tisn't available to other modules?Cheers,
Ronald
logging_log_file
is correct
You should have a files_type
Updated
http://pastebin.ca/914287
Everything else looks ok. Is jboss running as jboss_t? -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iEYEARECAAYFAke/J50ACgkQrlYvE4MpobOpBgCaAvbP+/afkqtpt01dD19c42d9 rPMAn3c3rbumQjcbmtriKFzYDXT2utWZ
=KYnl
-----END PGP SIGNATURE-----
--
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.