Skip to content

Commit 4b9863b

Browse files
[AUTO-CHERRYPICK] SymCrypt-OpenSSL -- Update mechanism for creating keysinuse logging directory. - branch 3.0-dev (#13739)
Co-authored-by: Tobias Brick <39196763+tobiasb-ms@users.noreply.github.com>
1 parent 1d3636f commit 4b9863b

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

SPECS/SymCrypt-OpenSSL/SymCrypt-OpenSSL.spec

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: The SymCrypt engine for OpenSSL (SCOSSL) allows the use of OpenSSL with SymCrypt as the provider for core cryptographic operations
22
Name: SymCrypt-OpenSSL
33
Version: 1.8.0
4-
Release: 1%{?dist}
4+
Release: 2%{?dist}
55
License: MIT
66
Vendor: Microsoft Corporation
77
Distribution: Azure Linux
@@ -49,6 +49,7 @@ mkdir -p %{buildroot}%{_libdir}/engines-3/
4949
mkdir -p %{buildroot}%{_libdir}/ossl-modules/
5050
mkdir -p %{buildroot}%{_includedir}
5151
mkdir -p %{buildroot}%{_sysconfdir}/pki/tls/
52+
mkdir -p %{buildroot}%{_localstatedir}/log/keysinuse/
5253

5354
# We still install the engine for backwards compatibility with legacy applications. Callers must
5455
# explicitly load the engine to use it. It will be removed in a future release.
@@ -57,15 +58,6 @@ install bin/SymCryptProvider/symcryptprovider.so %{buildroot}%{_libdir}/ossl-mod
5758
install SymCryptEngine/inc/e_scossl.h %{buildroot}%{_includedir}/e_scossl.h
5859
install SymCryptProvider/symcrypt_prov.cnf %{buildroot}%{_sysconfdir}/pki/tls/symcrypt_prov.cnf
5960

60-
%post
61-
mkdir -p -m 1733 /var/log/keysinuse
62-
63-
%preun
64-
# Remove the logging directory on uninstall, leaving it there on upgrade.
65-
if [ "${1}" = "0" ]; then
66-
rm -rf /var/log/keysinuse
67-
fi
68-
6961
%check
7062
./bin/SslPlay/SslPlay
7163

@@ -76,7 +68,21 @@ fi
7668
%{_includedir}/e_scossl.h
7769
%{_sysconfdir}/pki/tls/symcrypt_prov.cnf
7870

71+
# The log directory for certsinuse logging has permissions set to 1733.
72+
# These permissions are a result of a security review to mitigate potential risks:
73+
# - Group and others are denied read access to prevent user-level code from inferring
74+
# details about other running applications and their certsinuse usage.
75+
# - All users have write and execute permissions to create new log files and to
76+
# check file attributes (e.g., to ensure a log file hasn't been tampered with or
77+
# replaced by a symlink).
78+
# - The sticky bit is set to prevent malicious users from deleting the log files
79+
# and interfering with certsinuse alerting mechanisms.
80+
%dir %attr(1733, root, root) %{_localstatedir}/log/keysinuse/
81+
7982
%changelog
83+
* Thu May 08 2025 Tobias Brick <tobiasb@microsoft.com> - 1.8.0-2
84+
- Update mechanism for creating keysinuse logging directory.
85+
8086
* Thu Mar 27 2025 Maxwell Moyer-McKee <mamckee@microsoft.com> - 1.8.0-1
8187
- Upgrade to SymCrypt-OpenSSL 1.8.0 with PBKDF2 and minor bugfixes
8288

0 commit comments

Comments
 (0)