|
|
0c5bd9 |
Name: tlog
|
|
|
b98f6a |
Version: 12.1
|
|
|
b98f6a |
Release: 2%{?dist}
|
|
|
0c5bd9 |
Summary: Terminal I/O logger
|
|
|
0c5bd9 |
|
|
|
0c5bd9 |
License: GPLv2+
|
|
|
0c5bd9 |
URL: https://github.com/Scribery/%{name}
|
|
|
0c5bd9 |
Source: https://github.com/Scribery/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz
|
|
|
0c5bd9 |
|
|
|
cbbbaa |
BuildRequires: gcc
|
|
|
0c5bd9 |
BuildRequires: json-c-devel
|
|
|
0c5bd9 |
BuildRequires: curl-devel
|
|
|
0c5bd9 |
BuildRequires: m4
|
|
|
07f23d |
BuildRequires: libutempter-devel
|
|
|
0c5bd9 |
# If it's not RHEL6 and older
|
|
|
0c5bd9 |
%if 0%{?rhel} == 0 || 0%{?rhel} >= 7
|
|
|
0c5bd9 |
BuildRequires: systemd-devel
|
|
|
0c5bd9 |
BuildRequires: systemd-units
|
|
|
0c5bd9 |
%endif
|
|
|
0c5bd9 |
Requires(post): sed
|
|
|
0c5bd9 |
Requires(postun): sed
|
|
|
0c5bd9 |
|
|
|
0c5bd9 |
|
|
|
0c5bd9 |
%description
|
|
|
0c5bd9 |
Tlog is a terminal I/O recording program similar to "script", but used in
|
|
|
0c5bd9 |
place of a user's shell, starting the recording and executing the real user's
|
|
|
0c5bd9 |
shell afterwards. The recorded I/O can then be forwarded to a logging server
|
|
|
0c5bd9 |
in JSON format.
|
|
|
0c5bd9 |
|
|
|
0c5bd9 |
%global _hardened_build 1
|
|
|
0c5bd9 |
|
|
|
0c5bd9 |
%prep
|
|
|
0c5bd9 |
%setup -q
|
|
|
0c5bd9 |
|
|
|
0c5bd9 |
%build
|
|
|
0c5bd9 |
# If it's not RHEL6 and older
|
|
|
0c5bd9 |
%if 0%{?rhel} == 0 || 0%{?rhel} >= 7
|
|
|
07f23d |
%configure --disable-rpath --disable-static --enable-utempter
|
|
|
0c5bd9 |
# Else, if it's RHEL6 or older
|
|
|
0c5bd9 |
%else
|
|
|
0c5bd9 |
%configure --disable-rpath --disable-static --disable-journal
|
|
|
0c5bd9 |
%endif
|
|
|
0c5bd9 |
make %{?_smp_mflags}
|
|
|
0c5bd9 |
|
|
|
0c5bd9 |
%check
|
|
|
0c5bd9 |
make %{?_smp_mflags} check
|
|
|
0c5bd9 |
|
|
|
0c5bd9 |
%pre
|
|
|
0c5bd9 |
getent group %{name} >/dev/null ||
|
|
|
0c5bd9 |
groupadd -r %{name}
|
|
|
0c5bd9 |
getent passwd %{name} >/dev/null ||
|
|
|
0c5bd9 |
useradd -r -g %{name} -d %{_localstatedir}/run/%{name} -s /sbin/nologin \
|
|
|
0c5bd9 |
-c "Tlog terminal I/O logger" %{name}
|
|
|
0c5bd9 |
|
|
|
0c5bd9 |
%install
|
|
|
0c5bd9 |
make install DESTDIR=%{buildroot}
|
|
|
0c5bd9 |
rm %{buildroot}/%{_libdir}/*.la
|
|
|
0c5bd9 |
# Remove development files as we're not doing a devel package yet
|
|
|
0c5bd9 |
rm %{buildroot}/%{_libdir}/*.so
|
|
|
0c5bd9 |
rm -r %{buildroot}/usr/include/%{name}
|
|
|
0c5bd9 |
|
|
|
0c5bd9 |
# If it's not RHEL6 and older
|
|
|
0c5bd9 |
%if 0%{?rhel} == 0 || 0%{?rhel} >= 7
|
|
|
0c5bd9 |
# Create tmpfiles.d configuration for the lock dir
|
|
|
0c5bd9 |
mkdir -p %{buildroot}%{_tmpfilesdir}
|
|
|
0c5bd9 |
{
|
|
|
0c5bd9 |
echo "# Type Path Mode UID GID Age Argument"
|
|
|
0c5bd9 |
echo "d /run/%{name} 0755 %{name} %{name}"
|
|
|
0c5bd9 |
} > %{buildroot}%{_tmpfilesdir}/%{name}.conf
|
|
|
0c5bd9 |
# Create the lock dir
|
|
|
0c5bd9 |
mkdir -p %{buildroot}/run
|
|
|
0c5bd9 |
install -d -m 0755 %{buildroot}/run/%{name}
|
|
|
0c5bd9 |
# Else, if it's RHEL6 or older
|
|
|
0c5bd9 |
%else
|
|
|
0c5bd9 |
# Create the lock dir
|
|
|
0c5bd9 |
mkdir -p %{buildroot}%{_localstatedir}/run
|
|
|
0c5bd9 |
install -d -m 0755 %{buildroot}%{_localstatedir}/run/%{name}
|
|
|
0c5bd9 |
%endif
|
|
|
0c5bd9 |
|
|
|
0c5bd9 |
%files
|
|
|
0c5bd9 |
%{!?_licensedir:%global license %doc}
|
|
|
0c5bd9 |
%license COPYING
|
|
|
0c5bd9 |
%doc %{_defaultdocdir}/%{name}
|
|
|
0c5bd9 |
%{_bindir}/%{name}-rec
|
|
|
0c5bd9 |
%attr(6755,%{name},%{name}) %{_bindir}/%{name}-rec-session
|
|
|
0c5bd9 |
%{_bindir}/%{name}-play
|
|
|
0c5bd9 |
%{_libdir}/lib%{name}.so*
|
|
|
0c5bd9 |
%{_datadir}/%{name}
|
|
|
0c5bd9 |
%{_mandir}/man5/*
|
|
|
0c5bd9 |
%{_mandir}/man8/*
|
|
|
0c5bd9 |
# If it's not RHEL6 and older
|
|
|
0c5bd9 |
%if 0%{?rhel} == 0 || 0%{?rhel} >= 7
|
|
|
0c5bd9 |
%config(noreplace) %{_tmpfilesdir}/%{name}.conf
|
|
|
0c5bd9 |
%dir %attr(-,%{name},%{name}) /run/%{name}
|
|
|
0c5bd9 |
# Else if it's RHEL6 or older
|
|
|
0c5bd9 |
%else
|
|
|
0c5bd9 |
%dir %attr(-,%{name},%{name}) %{_localstatedir}/run/%{name}
|
|
|
0c5bd9 |
%endif
|
|
|
0c5bd9 |
%dir %{_sysconfdir}/%{name}
|
|
|
0c5bd9 |
%config(noreplace) %{_sysconfdir}/%{name}/%{name}-rec.conf
|
|
|
0c5bd9 |
%config(noreplace) %{_sysconfdir}/%{name}/%{name}-rec-session.conf
|
|
|
0c5bd9 |
%config(noreplace) %{_sysconfdir}/%{name}/%{name}-play.conf
|
|
|
0c5bd9 |
|
|
|
0c5bd9 |
%post
|
|
|
0c5bd9 |
/sbin/ldconfig
|
|
|
0c5bd9 |
|
|
|
0c5bd9 |
%postun
|
|
|
0c5bd9 |
/sbin/ldconfig
|
|
|
0c5bd9 |
|
|
|
0c5bd9 |
%changelog
|
|
|
b98f6a |
* Mon May 23 2022 Justin Stephenson <jstephen@redhat.com> - 12.1
|
|
|
b98f6a |
- Exit transfer loop when output fd is closed
|
|
|
b98f6a |
- Revert "Prevent infinite transfer loop on GDM login"
|
|
|
b98f6a |
|
|
|
2b13ac |
* Wed Nov 17 2021 Justin Stephenson <jstephen@redhat.com> - 12-1
|
|
|
2b13ac |
- Release v12
|
|
|
2b13ac |
- Prevent infinite transfer loop on GDM login.
|
|
|
2b13ac |
- tlog-play: add journal namespace support.
|
|
|
2b13ac |
- tlitest: extend delay for limit-action delay test.
|
|
|
2b13ac |
|
|
|
b175af |
* Tue Apr 27 2021 Justin Stephenson <jstephen@redhat.com> - 11-1
|
|
|
b175af |
- Fire SIGCHLD after utempter_add_record since it probably eats it.
|
|
|
b175af |
- Correct suse rpmbuild
|
|
|
b175af |
- Update debbuild for travis CI
|
|
|
b175af |
|
|
|
07f23d |
* Thu Oct 15 2020 Justin Stephenson <jstephen@redhat.com> - 9-2
|
|
|
07f23d |
- Skip utmp removal with piped IO on stdin
|
|
|
07f23d |
|
|
|
07f23d |
* Thu Oct 15 2020 Justin Stephenson <jstephen@redhat.com> - 9-1
|
|
|
07f23d |
- Release v9
|
|
|
07f23d |
- Add libutempter support
|
|
|
07f23d |
- Require journal match filter
|
|
|
07f23d |
- Add file reader match functionality
|
|
|
07f23d |
- Restore cursor visibility and color attributes on tlog-play exit
|
|
|
07f23d |
- Add "time" real clock timestamp message field
|
|
|
07f23d |
- Various upstream CI improvements
|
|
|
07f23d |
|
|
|
d81bef |
* Tue May 26 2020 Justin Stephenson <jstephen@redhat.com> - 8-2
|
|
|
d81bef |
- Test fixups from v8
|
|
|
d81bef |
|
|
|
d81bef |
* Thu May 21 2020 Justin Stephenson <jstephen@redhat.com> - 8-1
|
|
|
d81bef |
- Release v8
|
|
|
d81bef |
- Spec file fixes for EL6
|
|
|
d81bef |
- Spec file improvements for Debian/Ubuntu pkg-config
|
|
|
d81bef |
- Tlog-play improve authentication options
|
|
|
d81bef |
- Handle piped in I/O from stdin and improve the main recording transfer exit
|
|
|
d81bef |
condition.
|
|
|
d81bef |
- Use empty string on hostname resolution failure
|
|
|
d81bef |
|
|
|
cbbbaa |
* Tue Nov 12 2019 Justin Stephenson <jstephen@redhat.com> - 7-1
|
|
|
cbbbaa |
- Release v7
|
|
|
cbbbaa |
- Allow tlog-play redirection of stdout
|
|
|
cbbbaa |
- Add -i/--interactive option to tlog-rec-session. Allows login
|
|
|
cbbbaa |
programs to call tlog-rec-session more transparently.
|
|
|
cbbbaa |
- Make in_txt/out_txt fields optional. This handles missing fields
|
|
|
cbbbaa |
when reading from Elasticsearch or other backends.
|
|
|
cbbbaa |
|
|
|
cbbbaa |
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 6-2
|
|
|
cbbbaa |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
|
|
cbbbaa |
|
|
|
cbbbaa |
* Tue May 28 2019 Justin Stephenson <jstephen@redhat.com> - 6-1
|
|
|
0c5bd9 |
- Release v6. Added features and implemented fixes follow. See README.md and
|
|
|
0c5bd9 |
manpages for documentation of new features.
|
|
|
0c5bd9 |
- Add integration tests for end-to-end test coverage.
|
|
|
0c5bd9 |
- Fix compiler type comparison error with json-c json_object_array_length
|
|
|
0c5bd9 |
return value.
|
|
|
0c5bd9 |
- Fix a distribution issue causing incorrect M4_CONF_PATH expansion.
|
|
|
0c5bd9 |
- Log more detailed error when systemd journal is not present.
|
|
|
0c5bd9 |
|
|
|
cbbbaa |
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 5-2
|
|
|
cbbbaa |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
|
|
cbbbaa |
|
|
|
cbbbaa |
* Wed Dec 5 2018 Kirill Glebov <kgliebov@redhat.com> - 5-1
|
|
|
cbbbaa |
- Release v5. Added features and implemented fixes follow. See README.md and
|
|
|
cbbbaa |
manpages for documentation of new features.
|
|
|
cbbbaa |
- Implement support for --configuration option for all programs.
|
|
|
cbbbaa |
The option makes the program output its configuration in JSON and then
|
|
|
cbbbaa |
exit.
|
|
|
cbbbaa |
- Add BuildDependencies to allow yum-builddep.
|
|
|
cbbbaa |
- Open JSON writer file with euid/egid. To allow creating protected log files
|
|
|
cbbbaa |
with tlog-rec-session, open the JSON writer's file with the EUID and
|
|
|
cbbbaa |
GUID the program was started with.
|
|
|
cbbbaa |
- Installing Packages with the APT Addon instead of apt-get.
|
|
|
cbbbaa |
- Switch to using TLOG_ERRS_RAISE macros.
|
|
|
cbbbaa |
- Fix tlog-play cleanup-path segfault.
|
|
|
cbbbaa |
- Modify command-line option parsing.
|
|
|
cbbbaa |
- Remove "fields" field from ES query URL to fix compatibility with
|
|
|
cbbbaa |
Elasticsearch 5.
|
|
|
cbbbaa |
- Remove unused _source parameter from ES query URL.
|
|
|
cbbbaa |
- Fix tlog-rec-session file permissions bug.
|
|
|
cbbbaa |
- Use CLOCK_MONOTONIC for rate-limiting writing.
|
|
|
cbbbaa |
- Filter out some more input control sequences.
|
|
|
0c5bd9 |
|
|
|
cbbbaa |
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4-4
|
|
|
cbbbaa |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
|
|
0c5bd9 |
|
|
|
0c5bd9 |
* Tue Mar 06 2018 Björn Esser <besser82@fedoraproject.org> - 4-3
|
|
|
0c5bd9 |
- Rebuilt for libjson-c.so.4 (json-c v0.13.1)
|
|
|
0c5bd9 |
|
|
|
0c5bd9 |
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4-2
|
|
|
0c5bd9 |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
|
|
0c5bd9 |
|
|
|
0c5bd9 |
* Wed Jan 24 2018 Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> - 4-1
|
|
|
0c5bd9 |
- Release v4. Added features and implemented fixes follow. See README.md and
|
|
|
0c5bd9 |
manpages for documentation of new features.
|
|
|
0c5bd9 |
- Extract user session recording functionality from tlog-rec into a new tool:
|
|
|
0c5bd9 |
tlog-rec-session. It should be used as the user's login shell now, and
|
|
|
0c5bd9 |
tlog-rec should be used as a general recording and testing tool.
|
|
|
0c5bd9 |
- Add (optional) support for writing to and reading from Systemd Journal - the
|
|
|
0c5bd9 |
"journal" reader and writer.
|
|
|
0c5bd9 |
- Make tlog-rec default to "file" writer, and tlog-rec-session to "journal",
|
|
|
0c5bd9 |
if built with Journal support, and to "syslog" otherwise.
|
|
|
0c5bd9 |
- Add "-o" option to tlog-rec as an alias to "--file-path".
|
|
|
0c5bd9 |
- Add "-i" option to tlog-play as an alias to "--file-path".
|
|
|
0c5bd9 |
- Assume locale charset is UTF-8, if ASCII charset is detected, since that is
|
|
|
0c5bd9 |
a likely indication the locale settings were lost. E.g. upon console login
|
|
|
0c5bd9 |
or "su -" on Fedora and RHEL.
|
|
|
0c5bd9 |
- Switch the "ver" JSON field type to string. Now it should be two numbers
|
|
|
0c5bd9 |
separated by a dot. The increase of the first number indicates
|
|
|
0c5bd9 |
forward-incompatible changes, the increase of the second number -
|
|
|
0c5bd9 |
forward-compatible. If the dot and the second number are omitted, the second
|
|
|
0c5bd9 |
number is considered to be zero. Bump the format version to "2".
|
|
|
0c5bd9 |
- Add a new JSON field: "rec", containing an opaque host-unique recording ID.
|
|
|
0c5bd9 |
Bump the format version to "2.1".
|
|
|
0c5bd9 |
- Add support for playback controls, both through the command line and via
|
|
|
0c5bd9 |
playback-time control keys, including: speed adjustment, pause/resume,
|
|
|
0c5bd9 |
fast-forward to a time, and packet-by-packet stepping through the recording.
|
|
|
0c5bd9 |
- Add optional rate-limiting of logged messages. Both throttling and dropping
|
|
|
0c5bd9 |
messages are supported.
|
|
|
0c5bd9 |
- Add "--lax" option to tlog-play to allow playing back recordings with
|
|
|
0c5bd9 |
missing messages.
|
|
|
0c5bd9 |
- Fix input being ignored when there is a lot of output, while recording.
|
|
|
0c5bd9 |
- Remove addition of tlog-rec (tlog-rec-session) to /etc/shells from RPM
|
|
|
0c5bd9 |
packaging to prevent users from changing their shells themselves once it has
|
|
|
0c5bd9 |
been assigned.
|
|
|
0c5bd9 |
- Add support for specifying the shell to start via the tlog-rec-session
|
|
|
cbbbaa |
executable name. E.g. by making a tlog-rec-session-shell-zsh ->
|
|
|
0c5bd9 |
tlog-rec-session symlink and executing it. That can be used to specify
|
|
|
0c5bd9 |
particular shells to be recorded for specific users by assigning these
|
|
|
0c5bd9 |
symlinks as their login shells.
|
|
|
0c5bd9 |
- Make error messages from all the tools a bit less noisy and more readable.
|
|
|
0c5bd9 |
|
|
|
cbbbaa |
* Sun Dec 10 2017 Björn Esser <besser82@fedoraproject.org> - 3-4
|
|
|
cbbbaa |
- Rebuilt for libjson-c.so.3
|
|
|
cbbbaa |
|
|
|
cbbbaa |
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3-3
|
|
|
cbbbaa |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
|
|
|
cbbbaa |
|
|
|
cbbbaa |
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3-2
|
|
|
cbbbaa |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
|
|
cbbbaa |
|
|
|
cbbbaa |
* Wed Feb 22 2017 Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> - 3-1
|
|
|
0c5bd9 |
- Release v3. Added features and implemented fixes follow.
|
|
|
0c5bd9 |
- Make each JSON message timing data start with window size.
|
|
|
0c5bd9 |
This makes it possible to pick up the stream from any message and also
|
|
|
0c5bd9 |
combine messages, with window size known and preserved at all times.
|
|
|
0c5bd9 |
- Add "term" field to JSON messages, specifying terminal type.
|
|
|
0c5bd9 |
- Add "ver" field to JSON messages, specifying message format version.
|
|
|
0c5bd9 |
- Set "SHELL" environment variable to actual user shell in tlog-rec.
|
|
|
0c5bd9 |
- Check for locale's charset and abort tlog-rec if it's anything but the only
|
|
|
0c5bd9 |
supported UTF-8.
|
|
|
0c5bd9 |
- Add -v/--version option support to tlog-rec and tlog-play.
|
|
|
0c5bd9 |
- Fix tlog-rec and tlog-play error output by accumulating error messages and
|
|
|
0c5bd9 |
outputting them only after terminal settings are restored, on exit. Output
|
|
|
0c5bd9 |
startup warnings before switching to raw terminal settings.
|
|
|
0c5bd9 |
- Output a newline after restoring terminal settings in tlog-rec and
|
|
|
0c5bd9 |
tlog-play, so that following output is not stuck to the end of the last line
|
|
|
0c5bd9 |
of the raw output.
|
|
|
0c5bd9 |
- Add an Elasticsearch mapping to documentation directory.
|
|
|
0c5bd9 |
- Disable input logging by default to avoid storing passwords. Please enable
|
|
|
0c5bd9 |
it explicitly in configuration, or on the command line, if necessary.
|
|
|
0c5bd9 |
- Close log file written by tlog-rec on executing the shell in the child to
|
|
|
0c5bd9 |
prevent log modification by the recorded user.
|
|
|
0c5bd9 |
- Support running tlog-rec SUID/SGID to prevent recorded users from killing or
|
|
|
0c5bd9 |
modifying it. Make tlog-rec SUID/SGID to user "tlog" in the RPM package.
|
|
|
0c5bd9 |
- Add session locking to tlog-rec. This prevents tlog-rec from recording if
|
|
|
0c5bd9 |
the audit session is already recorded by creating per-audit-session lock
|
|
|
0c5bd9 |
files in /var/run/tlog. This only makes sense with tlog-rec SUID/SGID.
|
|
|
0c5bd9 |
When certain failures occur while creating a lock file, session is assumed
|
|
|
0c5bd9 |
unlocked and is recorded anyway, as it is safer to record a session than
|
|
|
0c5bd9 |
not. Add corresponding setup to the RPM package.
|
|
|
0c5bd9 |
- Reproduce the recorded program (shell) exit status in tlog-rec similarly to
|
|
|
0c5bd9 |
how Bash reproduces the last executed command status.
|
|
|
0c5bd9 |
- Update and expand README.md to describe secure log message filtering with
|
|
|
0c5bd9 |
rsyslog, and playback directly from Elasticsearch, among other, smaller
|
|
|
0c5bd9 |
additions.
|
|
|
0c5bd9 |
|
|
|
cbbbaa |
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2-2
|
|
|
cbbbaa |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
|
|
|
cbbbaa |
|
|
|
0c5bd9 |
* Wed Apr 6 2016 Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> - 2-1
|
|
|
0c5bd9 |
- Release v2. Not ready for production. Following features are added.
|
|
|
0c5bd9 |
- Fully-fledged command-line interface to tlog-play, along with config file
|
|
|
0c5bd9 |
and man pages.
|
|
|
0c5bd9 |
- Support for playback from file in tlog-play.
|
|
|
0c5bd9 |
- Make tlog-play follow mode controllable and off by default.
|
|
|
0c5bd9 |
- Get tlog-rec shell also from TLOG_REC_SHELL environment variable.
|
|
|
0c5bd9 |
- Support non-TTY stdin/stdout in tlog-rec, allowing its use with
|
|
|
0c5bd9 |
non-interactive SSH sessions.
|
|
|
0c5bd9 |
- Support building on and packaging for EPEL5.
|
|
|
0c5bd9 |
|
|
|
0c5bd9 |
* Thu Feb 25 2016 Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> - 1-1
|
|
|
0c5bd9 |
- Release v1. Not ready for production. Following features are included.
|
|
|
0c5bd9 |
- Recording of user input, program output and window size changes.
|
|
|
0c5bd9 |
- Support for writing into syslog and files.
|
|
|
0c5bd9 |
- Tlog-rec configuration through system-wide configuration file
|
|
|
0c5bd9 |
/etc/tlog/tlog-rec.conf, environment variables and command line.
|
|
|
0c5bd9 |
- Very basic playback directly from ElasticSearch.
|