{"id":273869,"date":"2016-02-09T11:48:03","date_gmt":"2016-02-09T08:48:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=273869"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=273869","title":{"rendered":"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 rsyslog \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u043b\u043e\u0433\u043e\u0432 \u043f\u043e \u0441\u0435\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435"},"content":{"rendered":"<p>       \u041d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0430\u0442\u0435\u0439 \u043f\u043e rsyslog, \u043d\u043e \u043d\u0435 \u043d\u0430\u0448\u043b\u043e\u0441\u044c \u043d\u0438 \u043e\u0434\u043d\u043e\u0439, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0435\u0439, \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442.<\/p>\n<p>  \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432, \u0438\u043c\u0435\u044e\u0449\u0438\u0445 \u0434\u043e\u0441\u0442\u0443\u043f \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0438 \u043d\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u0445 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439. \u0412 \u043e\u0434\u0438\u043d \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043c \u043d\u0430\u0434\u043e\u0435\u0434\u0430\u0435\u0442 \u043b\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0445 \u043d\u0438\u0445 \u043f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0438 \u043c\u044b \u0440\u0435\u0448\u0430\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043b\u043e\u0433\u043e\u0432. \u0422\u0430\u043a \u043a\u0430\u043a \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0445 \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u0438\u0445 \u0447\u0435\u0440\u0435\u0437 TLS.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u043e\u0434\u043e\u043f\u044b\u0442\u043d\u044b\u0445 \u0443 \u043d\u0430\u0441 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u044e\u0442 \u043c\u0430\u0448\u0438\u043d\u043a\u0438 \u0441 CentOS 6.7, \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441 rsyslog 7.x. rsyslog server (rslserver) \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f server.com, \u0430 rsyslog client (rslclient) \u2014 example.com.<\/p>\n<h4>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430<\/h4>\n<p>  \u0421\u0442\u0430\u0432\u0438\u0442\u044c rsyslog \u0431\u0443\u0434\u0435\u043c \u0441 \u0438\u0445 \u043e\u0444\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f (http:\/\/www.rsyslog.com\/rhelcentos-rpms\/).<\/p>\n<h5>\u0421\u0435\u0440\u0432\u0435\u0440<\/h5>\n<p>  <\/p>\n<pre><code>wget http:\/\/rpms.adiscon.com\/v7-stable\/rsyslog.repo -O \/etc\/yum.repos.d\/rsyslog.repo yum install gnutls-utils rsyslog rsyslog-gnutls mv \/etc\/rsyslog.conf.rpmnew \/etc\/rsyslog.conf #\u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u0434\u043e \u044d\u0442\u043e\u0433\u043e, \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f service rsyslog restart less \/var\/log\/messages #\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0447\u0442\u043e rsyslog \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0441\u044f \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a <\/code><\/pre>\n<p>  <\/p>\n<h5>\u041a\u043b\u0438\u0435\u043d\u0442<\/h5>\n<p>  <\/p>\n<pre><code>wget http:\/\/rpms.adiscon.com\/v7-stable\/rsyslog.repo -O \/etc\/yum.repos.d\/rsyslog.repo yum install rsyslog rsyslog-gnutls #gnutls-utils \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d mv \/etc\/rsyslog.conf.rpmnew \/etc\/rsyslog.conf #\u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u0434\u043e \u044d\u0442\u043e\u0433\u043e, \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f service rsyslog restart less \/var\/log\/messages #\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0447\u0442\u043e rsyslog \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0441\u044f \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a <\/code><\/pre>\n<p>  <\/p>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430<\/h4>\n<p>  <\/p>\n<h5>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432<\/h5>\n<p>  \u0421\u0430\u043c\u0430\u044f \u043c\u0443\u0442\u043e\u0440\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c. \u041d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0443 \u043a\u043b\u044e\u0447\u0435\u0439 CA \u0438 \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443+\u043f\u0430\u0440\u0435 \u043a\u043b\u044e\u0447\u0435\u0439 \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430. \u0412\u0441\u0435 \u0441\u0435\u043a\u044c\u044e\u0440\u043d\u043e. \u0414\u043b\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0441\u0442\u043e\u0438\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435\/\u043a\u043b\u0438\u0435\u043d\u0442\u0435, \u0430 \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435.<\/p>\n<h6>CA<\/h6>\n<p>  \u0421\u0435\u0440\u0434\u0446\u0435 \u043d\u0430\u0448\u0435\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. \u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c private key:<\/p>\n<pre><code>[root@sysadmin ~]# certtool --generate-privkey --outfile ca-key.pem Generating a 2048 bit RSA private key... <\/code><\/pre>\n<p>  \u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0441\u0430\u043c\u043e\u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442:<\/p>\n<pre><code>[root@sysadmin ~]# certtool --generate-self-signed --load-privkey ca-key.pem --outfile ca.pem Generating a self signed certificate... Please enter the details of the certificate's distinguished name. Just press enter to ignore a field. Country name (2 chars): RU Organization name: myorg Organizational unit name:  Locality name:  State or province name:  Common name: cacert UID:  This field should not be used in new certificates. E-mail:  Enter the certificate's serial number in decimal (default: 1395159808):   Activation\/Expiration time. The certificate will expire in (days): 3650  Extensions. Does the certificate belong to an authority? (y\/N): y Path length constraint (decimal, -1 for no constraint):  Is this a TLS web client certificate? (y\/N):  Is this also a TLS web server certificate? (y\/N):  Enter the e-mail of the subject of the certificate: email@admin.com Will the certificate be used to sign other certificates? (y\/N): y Will the certificate be used to sign CRLs? (y\/N):  Will the certificate be used to sign code? (y\/N):  Will the certificate be used to sign OCSP requests? (y\/N):  Will the certificate be used for time stamping? (y\/N):  Enter the URI of the CRL distribution point:  X.509 Certificate Information: [...]  Is the above information ok? (Y\/N): y  Signing certificate... [root@sysadmin ~]# ls -l total 136 -rw-------  1 root root  1675 Mar 18 11:12 ca-key.pem -rw-r--r--  1 root root  1318 Mar 18 12:24 ca.pem [root@sysadmin ~]# <\/code><\/pre>\n<p>  \u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0447\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e ca-key.pem \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0434\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u043d\u0430 \u0441\u0432\u043e\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435.<\/p>\n<h6>\u0421\u0435\u0440\u0432\u0435\u0440<\/h6>\n<p>  \u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c private key \u0434\u043b\u044f rsyslog \u0441\u0435\u0440\u0432\u0435\u0440\u0430:<\/p>\n<pre><code>[root@sysadmin ~]# certtool --generate-privkey --outfile rslserver-key.pem --bits 2048 Generating a 2048 bit RSA private key... <\/code><\/pre>\n<p>  \u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c certificate request. Rsyslog \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u043e \u043f\u043e\u043b\u044e \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 X509\/name, \u0442\u0430\u043a \u0447\u0442\u043e \u0432 \u0441ommon name \u043b\u0443\u0447\u0448\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c FQDN \u0445\u043e\u0441\u0442\u0430.<\/p>\n<pre><code>[root@sysadmin ~]# certtool --generate-request --load-privkey rslserver-key.pem --outfile request.pem Generating a PKCS #10 certificate request... Country name (2 chars): RU Organization name: myorg Organizational unit name:  Locality name:  State or province name:  Common name: server.com UID:  Enter a dnsName of the subject of the certificate: server.com Enter a dnsName of the subject of the certificate:  Enter the IP address of the subject of the certificate:  Enter the e-mail of the subject of the certificate:  Enter a challenge password:  Does the certificate belong to an authority? (y\/N): n Will the certificate be used for signing (DHE and RSA-EXPORT ciphersuites)? (y\/N):  Will the certificate be used for encryption (RSA ciphersuites)? (y\/N):  Is this a TLS web client certificate? (y\/N): y Is this also a TLS web server certificate? (y\/N): y <\/code><\/pre>\n<p>  \u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0438\u0437 request&#8217;\u0430.<\/p>\n<pre><code>[root@sysadmin ~]# certtool --generate-certificate --load-request request.pem --outfile rslserver-cert.pem --load-ca-certificate ca.pem --load-ca-privkey ca-key.pem  Generating a signed certificate... Enter the certificate's serial number in decimal (default: 1395162401):   Activation\/Expiration time. The certificate will expire in (days): 3650  Extensions. Do you want to honour the extensions from the request? (y\/N):  Does the certificate belong to an authority? (y\/N): n Is this a TLS web client certificate? (y\/N): y Is this also a TLS web server certificate? (y\/N): y Enter a dnsName of the subject of the certificate: server.com Enter a dnsName of the subject of the certificate:  Enter the IP address of the subject of the certificate:  Will the certificate be used for signing (DHE and RSA-EXPORT ciphersuites)? (y\/N):  Will the certificate be used for encryption (RSA ciphersuites)? (y\/N):  X.509 Certificate Information: [...]  Is the above information ok? (Y\/N): y  Signing certificate... [root@sysadmin ~]# rm -f request.pem <\/code><\/pre>\n<p>  \u0422\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c wildcards \u0432 common name \u0438 dns name, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044f \u043e\u0434\u0438\u043d \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0441\u0440\u0430\u0437\u0443 \u0434\u043b\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0445\u043e\u0441\u0442\u043e\u0432, \u043d\u043e \u043b\u0443\u0447\u0448\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c. \u041f\u043e\u0441\u043b\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 request \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c.<\/p>\n<h6>\u041a\u043b\u0438\u0435\u043d\u0442<\/h6>\n<p>  \u0414\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0432\u0441\u0435 \u0448\u0430\u0433\u0438 \u0442\u0435 \u0436\u0435, \u0447\u0442\u043e \u0438 \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430: \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043a\u043b\u044e\u0447, \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441, \u0437\u0430\u0442\u0435\u043c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442. \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0438\u043c\u0435\u043d\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0441 rslserver \u043d\u0430 rslclient, \u0430 common name\/dns name \u2014 \u0441 server.com \u043d\u0430 example.com.<\/p>\n<h6>\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0444\u0430\u0439\u043b\u044b<\/h6>\n<p>  \u041f\u0430\u043a\u0435\u0442 \u0434\u043b\u044f CentOS \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \/etc\/pki\/rsyslog\/, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0433\u0440\u0435\u0445 \u043d\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f. \u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0444\u0430\u0439\u043b\u044b ca.pem, rslserver-cert.pem, rslserver-key.pem, \u0430 \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0444\u0430\u0439\u043b\u044b ca.pem, rslclient-cert.pem, rslclient-key.pem.<\/p>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435:<\/p>\n<pre><code>[root@server.com]# ls -l1 \/etc\/pki\/rsyslog\/ -rw-r--r-- 1 root root 1172 Feb  8 20:19 ca.pem -rw-r--r-- 1 root root 1294 Feb  8 21:13 rslserver-cert.pem -rw-r--r-- 1 root root 1675 Feb  8 21:11 rslserver-key.pem  [root@example.com]# ls -l1 \/etc\/pki\/rsyslog\/ -rw-r--r--   1 root root 1172 Feb  8 20:21 ca.pem -rw-r--r--   1 root root 1273 Feb  8 20:21 rslclient-cert.pem -rw-------   1 root root 1675 Feb  8 20:21 rslclient-key.pem <\/code><\/pre>\n<p>  <\/p>\n<h5>\u041a\u043e\u043d\u0444\u0438\u0433\u0438<\/h5>\n<p>  <\/p>\n<h6>\u0421\u0435\u0440\u0432\u0435\u0440<\/h6>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \/etc\/rsyslog.conf, \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 imuxsock \u0438 imklog:<\/p>\n<pre><code>################### REMOTE LOGGING BEGIN ######################### # Increase the amount of open files rsyslog is allowed, which includes open tcp sockets # This is important if there are many clients. # http:\/\/www.rsyslog.com\/doc\/rsconf1_maxopenfiles.html $MaxOpenFiles 2048  # make gtls driver the default $DefaultNetstreamDriver gtls  # certificate files generated on RHEL6 and stored in \/root $DefaultNetstreamDriverCAFile \/etc\/pki\/rsyslog\/ca.pem $DefaultNetstreamDriverCertFile \/etc\/pki\/rsyslog\/rslserver-cert.pem $DefaultNetstreamDriverKeyFile \/etc\/pki\/rsyslog\/rslserver-key.pem  # Provides TCP syslog reception # for parameters see http:\/\/www.rsyslog.com\/doc\/imtcp.html module(load=&quot;imtcp&quot;        MaxSessions=&quot;2000&quot;        StreamDriver.mode=&quot;1&quot;        StreamDriver.authmode=&quot;x509\/name&quot;        PermittedPeer=&quot;example.com&quot;        ) input(type=&quot;imtcp&quot; port=&quot;10514&quot; name=&quot;tcp-tls&quot;) ################### REMOTE LOGGING END ######################### <\/code><\/pre>\n<p>  \u0418\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432 \u0432\u0440\u043e\u0434\u0435 \u0432\u0441\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e: \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u043c \u043b\u0438\u043c\u0438\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0447\u0442\u043e \u043f\u043e\u0442\u043e\u043a \u0438\u0434\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 TLS, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430 \u043a\u043b\u044e\u0447\u0438 \u0434\u043b\u044f \u0435\u0433\u043e \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0438, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043f\u043e\u0442\u043e\u043a \u0432 \u043c\u043e\u0434\u0443\u043b\u044c imtcp, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u043e \u043f\u043e\u043b\u044e x509\/name, \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044f \u0441 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043d\u044b\u043c \u043f\u0438\u0440\u043e\u043c.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438 \u0441 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u0442\u043e \u0432 \u043a\u043e\u043d\u0446\u0435 \/etc\/rsyslog.conf (\u0438\u043b\u0438 \u0432 \u043a\u0430\u043a\u043e\u043c-\u0442\u043e \u0438\u0437 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \/etc\/rsyslog.d) \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c rsyslog \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n<pre><code># This one is the template to generate the log filename dynamically, depending on the client's hostname. $template FileForRemote,&quot;\/var\/log\/remote\/%fromhost%\/syslog.log&quot;  if ($inputname contains &quot;tcp-tls&quot;) then  {   ?FileForRemote   stop } <\/code><\/pre>\n<p>  \u0422\u0443\u0442 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u0437\u0430\u0434\u0430\u0435\u043c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0438\u043c\u0435\u043d\u0438 \u0444\u0430\u0439\u043b\u0430, \u0438 \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u044d\u0442\u0438 \u0444\u0430\u0439\u043b\u044b \u0432\u0441\u0435, \u0447\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0438\u0437 \u00abtcp-tls\u00bb (\u0438\u043c\u044f \u0437\u0430\u0434\u0430\u043d\u043e \u0432\u044b\u0448\u0435 \u0432 input). \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u044c, \u043c\u044b \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f (\u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 stop), \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u043d\u0435 \u043f\u043e\u043f\u0430\u043b\u0430 \u0432 \u00ab\u043e\u0431\u0449\u0438\u0439 \u043a\u043e\u0442\u0435\u043b\u00bb.<\/p>\n<h6>\u041a\u043b\u0438\u0435\u043d\u0442<\/h6>\n<p>  \u041d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u0432\u0441\u0435 \u0435\u0449\u0435 \u043f\u0440\u043e\u0449\u0435. \u0412 \u0444\u0430\u0439\u043b\u0435 \/etc\/rsyslog.d\/tls.conf \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u043f\u043e\u0442\u043e\u043a \u043d\u0430\u0434\u043e \u0433\u043d\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 TLS \u0441 \u0442\u0430\u043a\u0438\u043c\u0438-\u0442\u043e \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430\u043c\u0438, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044f x509\/name \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u043e \u0441\u0435\u0442\u0438, \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b TCP (@@) \u043d\u0430 \u0430\u0434\u0440\u0435\u0441 server.com \u043c\u044b \u0448\u043b\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0438\u0441\u0438 \u043e\u0442 \u044f\u0434\u0440\u0430 (kern).<\/p>\n<pre><code># make gtls driver the default $DefaultNetstreamDriver gtls  # certificate files $DefaultNetstreamDriverCAFile \/etc\/pki\/rsyslog\/ca.pem $DefaultNetstreamDriverCertFile \/etc\/pki\/rsyslog\/rslreverb-cert.pem $DefaultNetstreamDriverKeyFile \/etc\/pki\/rsyslog\/rslreverb-key.pem  #### GLOBAL DIRECTIVES ####  # Use default timestamp format $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat  # gtls Network Stream Driver #  x509\/name - certificate validation and subject name authentication  #  http:\/\/www.rsyslog.com\/doc\/ns_gtls.html $ActionSendStreamDriverAuthMode x509\/name $ActionSendStreamDriverPermittedPeer server.com $ActionSendStreamDriverMode 1 # run driver in TLS-only mode  kern.*                                              @@server.com:10514 <\/code><\/pre>\n<p>  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u0432\u0441\u0435. \u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043f\u043e\u0440\u0442\u044b \u043d\u0430 \u0444\u0430\u0435\u0440\u0432\u043e\u043b\u0435 \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c rsyslog \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0435. \u0412 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f <a href=\"http:\/\/www.rsyslog.com\/doc\/v8-stable\/tutorials\/tls_cert_client.html\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f<\/a> rsyslog \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u0438\u0437 <a href=\"http:\/\/kb.kristianreese.com\/index.php?View=entry&amp;EntryID=148\">\u0431\u043b\u043e\u0433\u0430<\/a> Kristian Reese.       <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/276847\/\"> https:\/\/habrahabr.ru\/post\/276847\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u041d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0430\u0442\u0435\u0439 \u043f\u043e rsyslog, \u043d\u043e \u043d\u0435 \u043d\u0430\u0448\u043b\u043e\u0441\u044c \u043d\u0438 \u043e\u0434\u043d\u043e\u0439, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0435\u0439, \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442.<\/p>\n<p>  \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432, \u0438\u043c\u0435\u044e\u0449\u0438\u0445 \u0434\u043e\u0441\u0442\u0443\u043f \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0438 \u043d\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u0445 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439. \u0412 \u043e\u0434\u0438\u043d \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043c \u043d\u0430\u0434\u043e\u0435\u0434\u0430\u0435\u0442 \u043b\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0445 \u043d\u0438\u0445 \u043f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0438 \u043c\u044b \u0440\u0435\u0448\u0430\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043b\u043e\u0433\u043e\u0432. \u0422\u0430\u043a \u043a\u0430\u043a \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0445 \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u0438\u0445 \u0447\u0435\u0440\u0435\u0437 TLS.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-273869","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/273869","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=273869"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/273869\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=273869"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=273869"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=273869"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}