RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1353964 - Log files for ipa in /var/log/ipa and /var/log directory must have similar permissions.
Summary: Log files for ipa in /var/log/ipa and /var/log directory must have similar pe...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: ipa
Version: 8.0
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: ---
Assignee: IPA Maintainers
QA Contact: Kaleem
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-08 14:31 UTC by Sudhir Menon
Modified: 2023-09-14 03:28 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-22 11:49:18 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker FREEIPA-10378 0 None None None 2023-09-14 03:28:50 UTC

Description Sudhir Menon 2016-07-08 14:31:47 UTC
Description of problem: Log files in /var/log/ipa directory have different permissions.

Version-Release number of selected component (if applicable):
ipa-server-4.4.0-1.el7.x86_64

How reproducible: Always

Steps to Reproduce:

1. Install IPA server
2. Navigate to /var/log/ipa directory and check log file permissions.
3. Check /var/log directory for ipa related log file permissions.

Actual results:

/var/log/ipa
[root@server ipa]# ls -l
-rw-r--r--. 1 root root 4830 Jul  8 18:27 ipactl.log
-rw-------  1 root root    0 Jul  5 14:51 renew.log
-rw-r--r--  1 root root  912 Jul  8 17:52 server.log

[root@server log]# pwd
/var/log
-rw-------  1 root   root      54141 Jul  8 16:47 ipabackup.log
-rw-------. 1 root   root      62059 Jul  8 16:54 ipaclient-install.log
-rw-------. 1 root   root      47168 Jul  8 12:00 ipaclient-uninstall.log
-rw-------  1 root   root       5749 Jul  8 16:10 ipareplica-install.log
-rw-------  1 root   root      36796 Jul  8 17:24 iparestore.log
-rw-------. 1 root   root      28651 Jul  8 18:43 ipaserver-install.log
-rw-------  1 root   root      91545 Jul  8 17:58 ipaserver-kra-install.log
-rw-------  1 root   root       2562 Jul  8 17:15 ipaserver-kra-uninstall.log
-rw-------. 1 root   root      65098 Jul  8 12:00 ipaserver-uninstall.log
-rw-------  1 root   root      61890 Jul  8 11:41 ipaserver-uninstall.log.crash
-rw-------  1 root   root   10542916 Jul  8 17:30 ipaupgrade.log

Expected results:
Permissions of log file should be consistent with other log files of ipaserver
i.e 600 unless specifically required to be different.

Additional info:

Comment 2 Petr Vobornik 2016-07-21 15:55:43 UTC
triage notes:     
"""
mbasti: it looks like these logs (ipactl.log, default.log) are created by something else (systemd?) and they contain text from stderr

I suspect that ipactl.log is STDERR output from `systemctl start ipa`

IPA default logger setup has permission 0o600
"""

Comment 3 Petr Vobornik 2016-07-21 15:56:24 UTC
Upstream ticket:
https://fedorahosted.org/freeipa/ticket/6104

Comment 7 Rob Crittenden 2020-08-25 17:43:51 UTC
These are logs created via the context log in ipalib/plugable.py and not by standard ipa logger.

We can approach this in one of two ways:

If the log doesn't exist:
    create it
    chmod it to 0600

or

If the log doesn't exist:
     create it
chmod it to 0600

Something like:

diff --git a/ipalib/plugable.py b/ipalib/plugable.py
index 4c2782dbf..899805b46 100644
--- a/ipalib/plugable.py
+++ b/ipalib/plugable.py
@@ -521,6 +521,9 @@ class API(ReadOnly):
         if self.env.log is not None:
             try:
                 handler = logging.FileHandler(self.env.log)
+                if not os.path.exists(self.env.log):
+                    open(self.env.log, 'a').close()
+                os.chmod(self.env.log, 0o600)
             except IOError as e:
                 logger.error('Cannot open log file %r: %s', self.env.log, e)
             else:


I don't know why a user would want to temporarily change the mode of the log file and the second method would tighten up perms on existing context logs once the context is used again.

Comment 10 Petr Čech 2020-10-22 11:49:18 UTC
This BZ has been evaluated multiple times over the last several years and we assessed that it is a valuable request to keep in the backlog and address it at some point in future. Time showed that we did not have such capacity, nor have it now nor will have in the foreseeable future. In such a situation keeping it in the backlog is misleading and setting the wrong expectation that we will be able to address it. Unfortunately we will not. To reflect this we are closing this BZ. If you disagree with the decision please reopen or open a new support case and create a new BZ. However this does not guarantee that the request will not be closed during the triage as we are currently applying much more rigor to what we actually can accomplish in the foreseeable future. Contributions and collaboration in the upstream community and CentOS Stream is always welcome!
Thank you for understanding.
Red Hat Enterprise Linux Identity Management Team

Comment 11 Red Hat Bugzilla 2023-09-14 03:27:47 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days


Note You need to log in before you can comment on or make changes to this bug.