Skip to content

Commit 8149eb8

Browse files
committed
Allow gpg-agent create insights-client lib sock files
The commit addresses the following AVC denial: type=PROCTITLE msg=audit(08/05/25 16:42:05.503:155) : proctitle=gpg-agent --homedir /var/lib/insights/tmpgwfdzd9w --use-standard-socket --daemon type=SYSCALL msg=audit(08/05/25 16:42:05.503:155) : arch=x86_64 syscall=bind success=no exit=EACCES(Permission denied) a0=0x3 a1=0x5606da6316e0 a2=0x2b a3=0x0 items=0 ppid=1888 pid=1889 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=gpg-agent exe=/usr/bin/gpg-agent subj=system_u:system_r:gpg_agent_t:s0 key=(null) type=AVC msg=audit(08/05/25 16:42:05.503:155) : avc: denied { create } for pid=1889 comm=gpg-agent name=S.gpg-agent scontext=system_u:system_r:gpg_agent_t:s0 tcontext=system_u:object_r:insights_client_var_lib_t:s0 tclass=sock_file permissive=0 Resolves: RHEL-107589
1 parent f3c49b2 commit 8149eb8

File tree

2 files changed

+58
-1
lines changed

2 files changed

+58
-1
lines changed

policy/modules/contrib/gpg.te

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ optional_policy(`
358358
insights_client_setattr_lib_dirs(gpg_agent_t)
359359
insights_client_watch_lib_dirs(gpg_agent_t)
360360
insights_client_manage_lib_files(gpg_agent_t)
361-
# insights_client_manage_lib_sock_files(gpg_agent_t)
361+
insights_client_create_lib_sock_files(gpg_agent_t)
362362
insights_client_manage_tmp_sock_files(gpg_agent_t)
363363
')
364364

policy/modules/contrib/insights_client.if

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,63 @@ interface(`insights_client_manage_lib_files',`
245245
allow $1 insights_client_var_lib_t:file map;
246246
')
247247

248+
########################################
249+
## <summary>
250+
## Read insights_client lib socket files.
251+
## </summary>
252+
## <param name="domain">
253+
## <summary>
254+
## Domain allowed access.
255+
## </summary>
256+
## </param>
257+
#
258+
interface(`insights_client_read_lib_sock_files',`
259+
gen_require(`
260+
type insights_client_var_lib_t;
261+
')
262+
263+
files_search_var_lib($1)
264+
read_sock_files_pattern($1, insights_client_var_lib_t, insights_client_var_lib_t)
265+
')
266+
267+
########################################
268+
## <summary>
269+
## Write insights_client lib socket files.
270+
## </summary>
271+
## <param name="domain">
272+
## <summary>
273+
## Domain allowed access.
274+
## </summary>
275+
## </param>
276+
#
277+
interface(`insights_client_write_lib_sock_files',`
278+
gen_require(`
279+
type insights_client_var_lib_t;
280+
')
281+
282+
files_search_var_lib($1)
283+
write_sock_files_pattern($1, insights_client_var_lib_t, insights_client_var_lib_t)
284+
')
285+
286+
########################################
287+
## <summary>
288+
## Create insights_client lib socket files.
289+
## </summary>
290+
## <param name="domain">
291+
## <summary>
292+
## Domain allowed access.
293+
## </summary>
294+
## </param>
295+
#
296+
interface(`insights_client_create_lib_sock_files',`
297+
gen_require(`
298+
type insights_client_var_lib_t;
299+
')
300+
301+
files_search_var_lib($1)
302+
create_sock_files_pattern($1, insights_client_var_lib_t, insights_client_var_lib_t)
303+
')
304+
248305
########################################
249306
## <summary>
250307
## Create insights_client lib dirs.

0 commit comments

Comments
 (0)