תוכן
סקירה כללית
Let's Encrypt היא רשות אישורים פתוחה ואוטומטית המשתמשת ב- ACME (סביבת ניהול אישורים אוטומטית) פרוטוקול לספק חינם TLS / SSL אישורים לכל לקוח תואם. אישורים אלה יכולים לשמש להצפנת תקשורת בין שרתי האינטרנט והמשתמשים.
הדרכה זו תדון בקצרה ברשויות האישורים ובאופן שבו אינטגרציה של Zevenet פועלת עם Let's Enrypt, ואז תסקור כיצד Zevenet משתמשת סרבוט (לקוח ACME) על מנת ליצור את התקשורת עם תשתית בואו להצפין.
Zevenet טען איזון 6.0.3 או גרסה גבוהה יותר כולל מעטפת certbot זעיר שנקרא letsencryptz על מנת להשתמש בפונקציונליות webbot של Certbot, השורות הבאות מסבירות כיצד פועל עטיפה זו, אנא קחו את כל זה בחשבון כדי להפוך אותו לעבוד בסביבות ייצור.
כיצד בואו להצפין אימות?
כפונקציה קצרה של פונקציונליות webroot, תוסף Webroot פועל על-ידי יצירת קובץ זמני עבור כל אחד מהדומיינים המבוקשים שלך בנתיב הקובץ Zevenet /usr/local/zevenet/app/letsencryptz/webroot/.well-known/acme-challenge/. ואז שרת האימות של בואו להצפין מבצע בקשות HTTP כדי לאמת ש- DNS עבור כל תחום מבוקש פותר לשרת שמריץ מעטפת letsencryptz והקובץ הזמני למטרות אימות נגיש, התרשים הבא מתאר דוגמה אמיתית:
בתרשים הקודם, האיזון של Zevenet Load עומד מאחורי נתב / חומת אש עם כתובת IP ציבורית 185.79.20.147 (כדוגמה), התנועה HTTP ו HTTPS הוא natted כדי איזון עומס פנימי עם VIP 192.168.101.31 (כדוגמה), שבו איזון עומס מוגדר עם 2 חוות שונות:
שם החווה HTTPS WebHosting באמצעות 192.168.101.31:443 -. חווה זו אחראית על אירוח אתרים, שרתי אינטרנט שונים מתפרסמים יחד עם זה לאינטרנט. לדוגמה, test1.zevenet.es, test2.zevenet.es, test3.zevenet.es בודקים דפי אינטרנט שפורסמו על שירות וירטואלי זה בין היתר.
שם החווה של HTTP WebhostingRirect באמצעות 192.168.101.31:80 -. החווה הזו משמשת רק למטרות ניתוב מחדש, היא מאלצת את כל התנועה מ- HTTP ל- HTTPS.
התרשים הקודם מתאר בקשת אישור SSL בואו להצפין עבור הדומיין test1.zevenet.es באופן הבא:
1. בקשת אישור נשלחת ממאזנת העומס עצמה לתשתית Let's Encrypt.
2. בואו להצפין מזהה את בקשת האישור החדשה ל- SSL test1.zevenet.es
3. בואו להצפין להריץ רזולוציית DNS של ה- IP עבור המארח המבוקש: test1.zevenet.es בודקים שהתוצאה היא ה- IP הציבורי, אותו מקור IP שיזם את הבקשה.
4. בשלב זה בואו להצפין מכריז על letsencryptz סקריפט (webroot cerbot) כי זה צריך ליצור קובץ עם HASH בדרך הציבורית http://test1.zevenet.es/.well-know/acme-challenge/ (80 TCP Port), מדריך מקומי /usr/local/zevenet/app/letsencryptz/webroot/.well-known/acme-challenge/. לאחר מכן, letsencryptz מגדיר את השירות הזמני כדי להפוך את הקובץ נגיש מהאינטרנט (החווה WebhostingRirect הוא הולך להיות שונה לשם כך. אם אין חווה כבר מוגדר letsencryptz תיצור אחד הזמני זה VIP ופורט).
6. ברגע ש letsencryptz מאשרת את יצירת השירות הזמני, מאפשר הצפנת שרתים לוודא כי קובץ האימות הזמני נוצר HASH התוכן נכון.
7. לבסוף, בואו להצפין שרתים לענות לבקשה הראשונה עם האישור שכבר נוצר עבור ה- שם נפוץ (CN) test1.zevenet.es.
8. Zevenet ישמור את האישור שכבר נוצר בנתיב המקומי / usr / local / zevenet / config / והוא מוכן להיות מוגדר בחווה WebHosting.
בשלב זה, האישור החדש Let's Encrypt ישמש לשירות הווירטואלי HTTPS.
בואו להצפין פקודות אוטומציה
כפי שתואר, letsencryptz סקריפט יהיה להפוך את הפעולות הנדרשות כדי לנהל את אישורי SSL כמו ליצור, לחדש, להרוס או רשימה, בין היתר. מצא מתחת לפקודות הזמינות.
root@zva6k:~# letsencryptz letsencryptz description: letsencryptz is a let's encrypt (certbot) wrapper with minimal parameters ready to manage Let's Encrypt certificates for ZEVENET https profiles. Take into account that this wrapper uses certbot webroot feature so the public Let's encrypt architecture requires to connect with a local Virtual IP and port (TCP 80 by default) in order to do a request validation for the requested domain, so as soon as the "obtain" param is used, this script will configure an HTTP farm which will be accessed by Let's encrypt for verification purpose, this configuration is done automatically by this script itself, only ensure that the used Virtual IP and HTTP port 80 is not used by any another load balanced farm, and also ensure that the DNS resolution for the requested domain is reachable from let's encrypt system. usage: /usr/local/zevenet/bin/letsencryptz <action> <commands> action: --obtain | --destroy | --renew | --list | --listconf | --help --obtain: Request new Certificates using webroot cert-bot module. commands: --vip <Virtual IP> --farm <Farm Name> --domain <domain1> --domain <domain2> --domain <domainN> --test --vip: The Virtual IP already configured were to publish a temporal web server, this will be connected by let's encrypt public servers to verify the certificate request. The Virtual IP has to be free on the 80 port in order to be bound by a local process, if it isn't free then use --farm instead. --farm: The farm name which configures a temporal Service called "letsencryptz", if no farm is used a temporal farm called "letsencryptZevenet" will be configured in the selected Virtual IP. --domain: The domain which requests the Certificate for, i.e. www.mycompany.com. --test: Optional parameter, if used the certificate is requested for test purpose. --destroy: Revoke and delete the indicated Certificate Name, the action is rejected if the given certificate is in use by a farm. commands: --certname <Certificate Name> --certname: Certificate Name, this value can be obtained from the action --list. --renew: Renew the certificates near to expiry, no commands needed commands: --test --forcerestart --vip <Virtual IP> --farm <Farm Name> --test: Optional parameter, if used a dry-run is executed, the renew of the certificates is simulated. --forcerestart: Optional parameter, if used the farms that are using the renewed certificates will be restarted in order to apply the changes. --vip: The Virtual IP already configured where to publish a temporal web server, this will be connected by let's encrypt public servers to verify the certificate renew. The Virtual IP has to be free on the 80 port in order to be bound by a local process, if it isn't free then use --farm instead. --farm: The farm name which configures a temporal Service called "letsencryptz", if no farm is used a temporal farm called "letsencryptZevenet" will be configured in the selected Virtual IP. --list: List all the local certificates managed by let's encrypt and the status, no commands needed. --listconf: List the Zevenet let's encrypt configuration module (check global.conf file), no commands needed. --help: Obtain this help.
זה ייקח זמן מה בפעם הראשונה שמופעלת letsencryptz מכיוון שהמערכת הולכת להתקין תלות לא פתורה באופן אוטומטי, כמו כן בדיקת תצורה נעשית לפני שתתחיל להשתמש בה, Let's Encrypt מבקש חשבון דוא"ל או מטרות קשר הקשורות לאישורים, חשבון דוא"ל זה ישמש לאורך כל פעולה שנעשתה נגד מערכת Let's Enrypt. ניתן להגדיר דוא"ל זה בקובץ התצורה הראשי /usr/local/zevenet/config/global.conf, הנחיה $ le_email.
להלן מספר דוגמאות לשימוש.
Zevenet בואו להצפין את יצירת האישורים
פקודה זו מבקשת אישור חדש לדומיין test2.zevenet.es. קח בחשבון שה- VIP הנתון יהיה זה הפנימי, אשר התנועה צריכה להיות מלוכלכת מהאי.פי הציבורי לזו הפנימית. אם Let's Encrypt לא מצליח להגיע לשירות זה, הבקשה תידחה.
root@zva6k:~# letsencryptz --obtain --vip 192.168.101.31 --domain test2.zevenet.es WARNING: No farm name specified, a temporal farm with name letsencryptZevenet will be created in VIP 192.168.101.31 port 80. Configuring farm for let's encrypt Certificate Name verification Obtaining Certificate for domains test2.zevenet.es... Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator webroot, Installer None Obtaining a new certificate Non-standard path(s), might not work with crontab installed by your operating system package manager Certificate Request for the domain(s) test2.zevenet.es OK Created Certificate name test2.zevenet.es in PEM format ready for HTTPS profile Destroying webroot configuration for the farm letsencryptZevenet Deleting already configuration for letsencryptZevenet, service letsencryptz Restarting farms using renewed certificates:
Zevenet בואו להצפין את רישום האישורים
ביצוע פקודה זו יציג את האישורים הנוכחיים המנוהלים על ידי מערכת Zevenet Let's Encrypt.
root@zva6k:~# letsencryptz --list Listing all available certificates for the current configuration in config dir /usr/local/zevenet/config/letsencrypt/ Saving debug log to /var/log/letsencrypt/letsencrypt.log Certificate Name: test1.zevenet.es Domain(s): test1.zevenet.es Expiry Date: 2019-09-19 10:48:02+00:00 (VALID: 77 days) Pem Certificate file: /usr/local/zevenet/config/test1_zevenet_es.pem Certificate Name: test3.zevenet.es Domain(s): test3.zevenet.es Expiry Date: 2019-09-26 06:32:52+00:00 (VALID: 83 days) Pem Certificate file: /usr/local/zevenet/config/test3_zevenet_es.pem
קח בחשבון את השדה שם התעודה, שדה זה יוכר על ידי עטיפת letsencryptz כ- - שם תעודה.
Zevenet בואו להצפין את חידוש האישור
הפקודה הקודמת בודקת אם אישור שכבר נוצר דורש חידוש, ובמקרה זה החידוש ייעשה באופן אוטומטי. קח בחשבון שאם האישור המחודש נמצא בשימוש, יידרש הפעלה מחדש של החווה על מנת להחיל את השינוי, אנא השתמש באפשרות התחלה בכוח אם אתה רוצה letsencryptz מפעיל מחדש את כל החוות הנדרשות כדי ליישם את השינויים.
root@zva6k:~# letsencryptz --renew --vip 192.168.101.31 Renewing all the required certificates Saving debug log to /var/log/letsencrypt/letsencrypt.log Cert not yet due for renewal Cert not yet due for renewal
Zevenet בואו להצפין את מחיקת האישורים
פקודה זו מבטלת ומוחקת את האישור הנתון. במקרה שהמערכת מגלה שהתעודה שנבחר נמצאת בשימוש כרגע על ידי כל חוות HTTPS, הפעולה תידחה, בדוגמה שלמעלה פעולת המחיקה נדחית מכיוון שהתעודה נמצאת בשימוש על ידי החווה מבחן.
root@zva6k:~# letsencryptz --destroy --certname test3.zevenet.es Revoking and deleting certificate(s) test3.zevenet.es for the current configuration... This file can't be deleted because is used by the farm(s): testhttps
ברגע שהתעודה לא תוקצה מהמשק, הפעולה תבוצע:
root@zva6k:~# letsencryptz --destroy --certname test3.zevenet.es Revoking and deleting certificate(s) test3.zevenet.es for the current configuration... Saving debug log to /var/log/letsencrypt/letsencrypt.log Deleted certificate(s) test3.zevenet.es in path /usr/local/zevenet/config/test3_zevenet_es.pem
העבר בואו להצפין אישורים ל- Zevenet
איזון עומס Zevenet שומר את כל קבצי התצורה של סרבוט בשביל המקומי / usr / local / zevenet / config / letsencrypt /. על מנת להעביר את קבצי התצורה הקיימים של certbot שלך (כברירת מחדל ב- / etc / letsencrypt) של שרת אחר ל- Zevenet, עליך להכין רק tarball (קובץ tar.gz) של ספריית התצורה הקיימת הזו בשרת שלך ולבטל את דחיסת התוכן בנתיב התצורה של Zevenet Let's Encrypt. לבסוף, שקול לשנות את המשתנה $ le_email בקובץ global.conf לאותו דוא"ל ששימש בבקשות הקודמות.
בואו להצפין תמיכה באשכולות אישורים
תוסף Zevenet Let's Encrypt נתמך לחלוטין בשירות אשכול Zevenet. כל הפעולות בואו להצפין נשמרות בקובץ תצורה המשוכפל על ידי שירות אשכול Zevenet, כך שכל פעולה המבוצעת ב MASTER הצומת ישוכפל ל- עבד צומת אוטומטית, אך כל פעולה שמתבצעת ב- עבד צומת הקשור ל- Let's Encrypt יימחק על מנת למנוע כל סנכרון.
בואו להצפין אישורים להתחדש אוטומטית
ניתן להגדיר את התוסף של Zevenet Let's Encrypt על מנת לבדוק מדי יום אם תעודה כלשהי זקוקה לחידוש, במקרה שהמערכת תחדש אוטומטית אישור נתון והיא נמצאת בשימוש על ידי משק כלשהו, אז החווה תופעל מחדש אוטומטית על מנת להחיל את שינוי תעודה.
כדי להגדיר את התצורה של החידוש האוטומטי, אנא בצע את הפעולות הבאות:
צור את קובץ ה- cron הבא /etc/cron.d/letsencryptz עם התוכן הבא:
root@zva6k:~# cat /etc/cron.d/letsencryptz 00 00 * * * root /usr/local/zevenet/bin/letsencryptz --renew --forcerestart --vip 192.168.101.31
בתצורה זו, בדיקת החידוש תבוצע מדי יום בשעה 00:00 (חצות). ו- VIP 192.168.101.31 ישמש ביציאה 80 למטרת אימות מ- Let's Encrypt System.
הפניות
כמה הפניות המשמשות במאמר זה הן: