LinuxのDockerコンテナ内でユーザー1000をどのように想定できますか?

LinuxのDockerコンテナ内でユーザー1000をどのように想定できますか?

Fedora 36でターゲットアプリケーションをパージするためにAFL ++を使用しようとしています。上記の指示に従いました。このページAFL++コンテナをインポートして実行してビルドし、コンテナのディレクトリにマップされたターゲット/src/アプリケーションのソースコードを使用してターゲットコンテナを作成します。両方のコンテナはうまく機能しています。ただし、ターゲットコンテナに移動するとエラーがcd /src/発生し、このディレクトリで何もできません。access denied私ならwhoamiそうだろうroot。それで行ってこれを見ましたcd ..:。 A)uid 1000が誰なのか、なぜそこにいるのかわからないので混乱しています。 B)ルートなので、どのように進むべきかわかりません。私も試してみましたが、次のようなAVCの拒否を受けました。ls -lhadrwxr-xr-x. 7 1000 1000 4.0K Jul 23 20:49 srcchown root:root ./src

SELinux is preventing chown from setattr access on the directory postgres.

*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that chown should be allowed setattr access on the postgres directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'chown' --raw | audit2allow -M my-chown
# semodule -X 300 -i my-chown.pp

Additional Information:
Source Context                system_u:system_r:container_t:s0:c9,c234
Target Context                unconfined_u:object_r:user_home_t:s0
Target Objects                postgres [ dir ]
Source                        chown
Source Path                   chown
Port                          <Unknown>
Host                          localhost.localdomain
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-36.18-1.fc36.noarch
Local Policy RPM              selinux-policy-targeted-36.18-1.fc36.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     localhost.localdomain
Platform                      Linux localhost.localdomain 6.2.15-100.fc36.x86_64
                              #1 SMP PREEMPT_DYNAMIC Thu May 11 16:51:53 UTC
                              2023 x86_64 x86_64
Alert Count                   3
First Seen                    2023-07-27 01:34:49 PDT
Last Seen                     2023-07-27 01:35:10 PDT
Local ID                      e862a3ed-4709-4cf4-89f5-9d3bf197af96

Raw Audit Messages
type=AVC msg=audit(1690446910.128:646): avc:  denied  { setattr } for  pid=49017 comm="chown" name="postgres" dev="dm-2" ino=1475147 scontext=system_u:system_r:container_t:s0:c9,c234 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=dir permissive=0


Hash: chown,container_t,user_home_t,dir,setattr

実行すると、sudo ausearch -c 'chown' --raw | audit2allow -M my-chown次のようになります。

could not write output file: [Errno 13] Permission denied: 'my-chown.te'

ベストアンサー1

おすすめ記事