ユーザーがコマンドライン引数を表示できないようにするにはどうすればよいですか?

ユーザーがコマンドライン引数を表示できないようにするにはどうすればよいですか?

buildユーザーとして実行されるCIサーバーアプリケーションがあります。 CIサーバー上で実行されるパラメータを含むすべてのコマンドはを介して表示できますps。管理者以外のユーザーには、CIサーバーにシェルをロードする権限がありませんが、操作を介してunixコマンドを実行できます。

私が興味を持っているのは、ユーザーAが単にps

CIサーバーのすべてのジョブはユーザーとして実行されますbuild。ユーザーは他に切り替えることはできませんuser

psユーザーが実行できない操作になるようにコマンドをブロックしてps問題を解決することもできますが、知りたいのですが。

  1. 権限なしでコマンドライン引数を公開する他のコマンドを実行できますかroot
  2. この質問の文脈を考えると、これを管理するより良い安全な方法がありますか?

ベストアンサー1

hidepid/proc インストールオプションの表示

On multi-user systems, it is often useful to secure the process directories stored in /proc/ so that they can be viewed only by the root user. You can restrict the access to these directories with the use of the hidepid option.
To change the file system parameters, you can use the mount command with the -o remount option. As root, type:

mount -o remount,hidepid=value /proc

Here, value passed to hidepid is one of:

    0 (default) — every user can read all world-readable files stored in a process directory.
    1 — users can access only their own process directories. This protects the sensitive files like cmdline, sched, or status from access by non-root users. This setting does not affect the actual file permissions.
    2 — process files are invisible to non-root users. The existence of a process can be learned by other means, but its effective UID and GID is hidden. Hiding these IDs complicates an intruder's task of gathering information about running processes. 

詳細情報リンク -

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/ch-proc.html

おすすめ記事