SMTP는 버전 8.13의 sendmail에서 TLS(전송 계층 보안)를 사용할 수 있습니다. 이 서비스를 사용하면 SMTP 서버와 클라이언트에 인터넷을 통해 개인 인증 통신을 제공하며, 도청자와 공격자로부터 보호합니다. 이 서비스는 기본적으로 사용으로 설정되지 않습니다.
다음 절차에서는 샘플 데이터를 사용하여 sendmail에 TLS를 사용할 수 있도록 하는 인증서를 설정하는 방법을 보여줍니다. 자세한 내용은 sendmail 버전 8.13에서 TLS를 사용하는 SMTP 실행 지원을 참조하십시오.
자세한 내용은 Oracle Solaris 11.2의 사용자 및 프로세스 보안 의 지정된 관리 권한 사용을 참조하십시오.
# svcadm disable -t network/smtp:sendmail
# cd /etc/mail # mkdir -p certs/CA # cd certs/CA # mkdir certs crl newcerts private # echo "01" > serial # cp /dev/null index.txt # cp /etc/openssl/openssl.cnf .
다음 명령줄에서는 대화형 텍스트를 생성합니다.
# openssl req -new -x509 -keyout private/cakey.pem -out cacert.pem -days 365 \ -config openssl.cnf Generating a 1024 bit RSA private key .....................................++++++ .....................................++++++ writing new private key to 'private/cakey.pem' Enter PEM pass phrase: Verifying - Enter PEM pass phrase: ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) []:US State or Province Name (full name) []:California Locality Name (eg, city) []:Menlo Park Organization Name (eg, company) [Unconfigured OpenSSL Installation]:Oracle Organizational Unit Name (eg, section) []:Solaris Common Name (eg, YOUR name) []:somehost.somedomain.example.com Email Address []:someuser@example.com
이 명령은 인증서 요청을 만들고 처리합니다.
이 req 옵션은 새 인증서 요청을 생성합니다.
이 req 옵션은 자체 서명 인증서를 만듭니다.
이 req 옵션을 사용하면 새로 만든 개인 키의 파일 이름으로 private/cakey.pem을 지정할 수 있습니다.
이 req 옵션을 사용하면 cacert.pem을 출력 파일로 지정할 수 있습니다.
이 req 옵션을 사용하면 인증서를 365일 동안 인증할 수 있습니다. 기본값은 30입니다.
req 옵션을 사용하면 openssl.cnf를 구성 파일로 지정할 수 있습니다.
이 명령을 사용하려면 다음을 제공해야 합니다.
Country Name(예: US)
State or Province Name(예: California)
Locality Name(예: Menlo Park)
Organization Name(예: Oracle)
Organizational Unit Name(예: Solaris)
Common Name(시스템의 정규화된 호스트 이름) 자세한 내용은 check-hostname(1M) 매뉴얼 페이지를 참조하십시오.
Email Address(예: someuser@example.com)
# cd /etc/mail/certs/CA # openssl req -nodes -new -x509 -keyout newreq.pem -out newreq.pem -days 365 \ -config openssl.cnf Generating a 1024 bit RSA private key ..............++++++ ..............++++++ writing new private key to 'newreq.pem' ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) []:US State or Province Name (full name) []:California Locality Name (eg, city) []:Menlo Park Organization Name (eg, company) [Unconfigured OpenSSL Installation]:Oracle Organizational Unit Name (eg, section) []:Solaris Common Name (eg, YOUR name) []:somehost.somedomain.example.com Email Address []:someuser@example.com
이 명령을 사용하려면 3c단계에서 제공한 것과 동일한 정보를 제공해야 합니다.
이 예에서 인증서와 개인 키는 newreq.pem 파일에 있습니다.
# cd /etc/mail/certs/CA # openssl x509 -x509toreq -in newreq.pem -signkey newreq.pem -out tmp.pem Getting request Private Key Generating certificate request # openssl ca -config openssl.cnf -policy policy_anything -out newcert.pem -infiles tmp.pem Using configuration from openssl.cnf Enter pass phrase for /etc/mail/certs/CA/private/cakey.pem: Check that the request matches the signature Signature ok Certificate Details: Serial Number: 1 (0x1) Validity Not Before: Jun 23 18:44:38 2005 GMT Not After : Jun 23 18:44:38 2006 GMT Subject: countryName = US stateOrProvinceName = California localityName = Menlo Park organizationName = Oracle organizationalUnitName = Solaris commonName = somehost.somedomain.example.com emailAddress = someuser@example.com X509v3 extensions: X509v3 Basic Constraints: CA:FALSE Netscape Comment: OpenSSL Generated Certificate X509v3 Subject Key Identifier: 93:D4:1F:C3:36:50:C5:97:D7:5E:01:E4:E3:4B:5D:0B:1F:96:9C:E2 X509v3 Authority Key Identifier: keyid:99:47:F7:17:CF:52:2A:74:A2:C0:13:38:20:6B:F1:B3:89:84:CC:68 DirName:/C=US/ST=California/L=Menlo Park/O=Oracle/OU=Solaris/\ CN=someuser@example.com/emailAddress=someuser@example.com serial:00 Certificate is to be certified until Jun 23 18:44:38 2006 GMT (365 days) Sign the certificate? [y/n]:y 1 out of 1 certificate requests certified, commit? [y/n]y Write out database with 1 new entries Data Base Updated # rm -f tmp.pem
이 예에서 파일 newreq.pem에는 서명되지 않은 인증서와 개인 키가 있습니다. 파일 newcert.pem에 서명된 인증서가 있습니다.
인증서 정보를 표시하고 인증서를 다양한 형태로 변환하며 인증서 요청에 서명합니다.
다양한 형태의 인증서 요청에 서명하고 CRL(인증서 해지 목록)을 생성하는 데 사용됩니다.
define(`confCACERT_PATH', `/etc/mail/certs')dnl define(`confCACERT', `/etc/mail/certs/CAcert.pem')dnl define(`confSERVER_CERT', `/etc/mail/certs/MYcert.pem')dnl define(`confSERVER_KEY', `/etc/mail/certs/MYkey.pem')dnl define(`confCLIENT_CERT', `/etc/mail/certs/MYcert.pem')dnl define(`confCLIENT_KEY', `/etc/mail/certs/MYkey.pem')dnl
자세한 내용은 TLS를 사용하여 SMTP를 실행하기 위한 구성 파일 옵션을 참조하십시오.
자세한 내용은 sendmail 구성 변경을 참조하십시오.
# cd /etc/mail/certs # ln -s CA/cacert.pem CAcert.pem # ln -s CA/newcert.pem MYcert.pem # ln -s CA/newreq.pem MYkey.pem
# chmod go-r MYkey.pem
# C=CAcert.pem # ln -s $C `openssl x509 -noout -hash < $C`.0
host.domain을 다른 호스트의 정규화된 호스트 이름으로 대체합니다.
# C=host.domain.cert.pem # ln -s $C `openssl x509 -noout -hash < $C`.0
host.domain을 다른 호스트의 정규화된 호스트 이름으로 대체합니다.
# svcadm enable network/smtp:sendmail
다음은 TLS를 사용하는 보안 메일의 Received: 헤더 예입니다.
Received: from his.example.com ([IPv6:2001:db8:3c4d:15::1a2f:1a2b]) by her.example.com (8.13.4+Sun/8.13.4) with ESMTP id j2TNUB8i242496 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for <janepc@her.example.com>; Tue, 29 Mar 2005 15:30:11 -0800 (PST) Received: from her.example.com (her.city.example.com [192.168.0.0]) by his.example.com (8.13.4+Sun/8.13.4) with ESMTP id j2TNU7cl571102 version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for <janepc@her.example.com>; Tue, 29 Mar 2005 15:30:07 -0800 (PST)
verify의 값은 OK이며 인증이 성공적이라는 의미입니다. 자세한 내용은 TLS를 사용하여 SMTP를 실행하기 위한 매크로를 참조하십시오.
참조
다음 OpenSSL 매뉴얼 페이지를 참조하십시오.