From: Dominick Grift <dominick.grift@defensec.nl>
To: BOBx <kabc005009@163.com>
Cc: selinux@vger.kernel.org
Subject: Re: [Help] how to compile te with checkpolicy.
Date: Mon, 18 Aug 2025 11:53:18 +0200 [thread overview]
Message-ID: <87ikilyn01.fsf@defensec.nl> (raw)
In-Reply-To: <8925af9c-2977-4acf-9b48-7f6ce3b280ec@163.com> (BOBx's message of "Mon, 18 Aug 2025 16:01:04 +0800")
BOBx <kabc005009@163.com> writes:
> Hi all,
>
> These days I tried to compile te with tools named checkpolicy. I have
> searched the process with google and chatgpt, and I followed the steps
> they told me but I failed.
Hi,
checkpolicy is for monolithic policy. see below for modular policy:
>
> The following is my te file, cmd and response and other infomation.
>
> My te file(my_policy.te):
> ----------------------------------------------
This is modular policy that should be compiled with checkmodule and then
packaged with semodule_package:
checkmodule -M -m my_policy.te -o my_policy.mod
semodule_package -o my_policy.pp -m my_policy.mod
semodule -i my_policy.pp
for more information see:
man checkpolicy
man checkmodule
man semodule_package
man semodule
> policy_module(my_mypolicy, 1.0)
>
> # Define types
> type my_type_t;
> type my_type_exec_t, file_type;
>
> # Allow rules
> allow my_type_t my_type_exec_t:file execute;
> ----------------------------------------------
>
> The command:
> ----------------------------------------------
> sudo checkpolicy -M -o my_policy.pp my_policy.te
> ----------------------------------------------
>
> The response from command:
> ----------------------------------------------
> my_policy.te:1:ERROR 'syntax error' at token 'policy_module' on line 1:
>
>
> checkpolicy: error(s) encountered while parsing configuration
> ----------------------------------------------
>
> OS information: 6.11.0-29-generic, ubuntu 24.10.
>
> Would you like help me to compile te with checkpolicy please? Or which
> URL should I read please?
>
> Best regards
>
> BOBx
>
>
>
--
gpg --locate-keys dominick.grift@defensec.nl (wkd)
Key fingerprint = FCD2 3660 5D6B 9D27 7FC6 E0FF DA7E 521F 10F6 4098
Dominick Grift
Mastodon: @kcinimod@defensec.nl
next prev parent reply other threads:[~2025-08-18 9:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-18 8:01 [Help] how to compile te with checkpolicy BOBx
2025-08-18 9:53 ` Dominick Grift [this message]
2025-08-18 9:57 ` Dominick Grift
2025-08-18 10:20 ` Fei Shao
2025-08-18 10:43 ` Dominick Grift
2025-08-18 12:44 ` BOB x
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ikilyn01.fsf@defensec.nl \
--to=dominick.grift@defensec.nl \
--cc=kabc005009@163.com \
--cc=selinux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.