איסוף יומנים של OpenLDAP

נתמך ב:

במאמר הזה מוסבר איך להטמיע יומנים של OpenLDAP ב-Google Security Operations באמצעות Bindplane.

‫OpenLDAP הוא שרת מדריך LDAP בקוד פתוח שיוצר יומני גישה, ביקורת ושכפול. המנתח מחלץ שדות מרשומות ביומן של OpenLDAP וממפה אותם למודל הנתונים המאוחד (UDM), ומתעד את זהות המשתמש, אירועי אימות, פעולות LDAP ותוצאות אבטחה.

לפני שמתחילים

חשוב לוודא שיש לכם את הדברים הבאים:

  • מכונה של Google SecOps
  • ‫Windows Server 2016 ואילך, או מארח Linux עם systemd
  • קישוריות רשת בין סוכן Bindplane לבין שרת OpenLDAP
  • אם השרת פועל מאחורי שרת proxy, צריך לוודא שהיציאות של חומת האש פתוחות בהתאם לדרישות של סוכן Bindplane.
  • גישה מורשית לשרת OpenLDAP עם הרשאות אדמין או הרשאות ברמת הבסיס (root)

קבלת פרטי כניסה ל-Google SecOps עבור סוכן Bindplane

כדי לאמת את סוכן Bindplane ב-Google SecOps, בוחרים באחת מהשיטות הבאות:

  • פריסות חדשות: משתמשים ב-Chronicle API (אפשרות 1).
  • פריסות קודמות: ממשיכים להשתמש בקובץ האימות להטמעת נתונים (אפשרות 2) עד שה-Ingestion API יופסק ב-20 ביולי 2027.
  1. נכנסים אל Google Cloud המסוף ובוחרים את Google Cloud הפרויקט שמקושר למופע של Google SecOps.
  2. נכנסים לדף IAM & Admin > Service Accounts.
  3. לוחצים על יצירת חשבון שירות.
  4. מזינים את פרטי ההגדרה הבאים:
    • Service account name: מזינים שם לחשבון (לדוגמה, bindplane-ingest).
    • Service account description: מזינים תיאור (לדוגמה, Bindplane agent log ingestion).
  5. לוחצים על Create and continue.
  6. בקטע Grant this service account access to project, לוחצים על Select a role ובוחרים באפשרות Chronicle Editor.
  7. לוחצים על המשך ואז על סיום.
  8. לוחצים על חשבון השירות שיצרתם ועוברים לכרטיסייה Keys.
  9. לוחצים על Add key > Create new key.
  10. בוחרים באפשרות JSON ולוחצים על Create. קובץ המפתח יורד למחשב.
  11. שומרים את קובץ המפתח בתור ingestion-auth.json בספריית ה-collector של Bindplane (/opt/observiq-otel-collector/ingestion-auth.json ב-Linux או C:\Program Files\observIQ OpenTelemetry Collector\ingestion-auth.json ב-Windows), או מעדכנים את creds_file_path ב-config.yaml כך שיתאים לנתיב שבו שמרתם אותו.
  12. עוברים אל IAM & Admin > Settings (ניהול הרשאות גישה ואדמין > הגדרות) ומעתיקים את מספר הפרויקט. תצטרכו אותו כדי להגדיר את הייצוא.

אפשרות 2: הורדת קובץ אימות להטמעת נתונים (גרסה מדור קודם)

  1. נכנסים למסוף Google SecOps.
  2. עוברים אל הגדרות SIEM > סוכני איסוף.
  3. מורידים את קובץ האימות להטמעת נתונים.
  4. שומרים את הקובץ בצורה מאובטחת במערכת שבה יותקן הסוכן של Bindplane.

איך מקבלים את מספר הלקוח ב-Google SecOps

  1. נכנסים למסוף Google SecOps.
  2. עוברים אל SIEM Settings > Profile.
  3. מעתיקים את מספר הלקוח מהקטע פרטי הארגון ושומרים אותו.

התקנת סוכן Bindplane

מתקינים את הסוכן של Bindplane במערכת ההפעלה Windows או Linux לפי ההוראות הבאות.

התקנה ב-Windows

  1. פותחים את שורת הפקודה או את PowerShell כאדמין.
  2. מריצים את הפקודה הבאה:

    msiexec /i "https://github.com/observIQ/bindplane-agent/releases/latest/download/observiq-otel-collector.msi" /quiet
    
  3. מחכים שההתקנה תסתיים.

  4. כדי לוודא שההתקנה בוצעה, מריצים את הפקודה:

    sc query observiq-otel-collector
    

השירות אמור להופיע כ-RUNNING.

התקנה ב-Linux

  1. פותחים טרמינל עם הרשאות root או sudo.
  2. מריצים את הפקודה הבאה:

    sudo sh -c "$(curl -fsSlL https://github.com/observiq/bindplane-agent/releases/latest/download/install_unix.sh)" install_unix.sh
    
  3. מחכים שההתקנה תסתיים.

  4. מאמתים את ההתקנה על ידי הרצת:

    sudo systemctl status observiq-otel-collector
    

השירות אמור להופיע כ-active (running).

מקורות מידע נוספים להתקנה

אפשרויות התקנה נוספות ופתרון בעיות מפורטים במדריך להתקנת סוכן Bindplane.

הגדרה של סוכן Bindplane לקליטת syslog ושליחה ל-Google SecOps

איתור קובץ התצורה

  • ‫Linux:

    sudo nano /opt/observiq-otel-collector/config.yaml
    
  • ‫Windows:

    notepad "C:\Program Files\observIQ OpenTelemetry Collector\config.yaml"
    

עריכת קובץ תצורה

  • מחליפים את כל התוכן של config.yaml בהגדרות הבאות:

    receivers:
      udplog:
        listen_address: "0.0.0.0:514"
    
    exporters:
      chronicle/openldap:
        protocol: https
        # Region of your instance, for example us, europe, asia-southeast1
        location: <LOCATION>
        # Project number of the Google Cloud project linked to the instance
        project: '<PROJECT_NUMBER>'
        compression: gzip
        creds_file_path: '/opt/observiq-otel-collector/ingestion-auth.json'
        customer_id: '<customer_id>'
        endpoint: chronicle.googleapis.com
        log_type: OPENLDAP
        raw_log_field: body
    
    service:
      pipelines:
        logs/openldap:
          receivers:
            - udplog
          exporters:
            - chronicle/openldap
    

פרמטרים להגדרה

מחליפים את ה-placeholders הבאים:

  • הגדרת מקלט:

    • ‫udplog: סוג המקלט לפי הפרוטוקול:
      • ‫udplog ל-UDP syslog
      • ‫tcplog ל-syslog של TCP
      • ‫syslog עבור syslog RFC 3164/5424
    • ‫0.0.0.0: כתובת ה-IP להאזנה:
      • 0.0.0.0 כדי להאזין בכל הממשקים (מומלץ)
      • כתובת IP ספציפית להאזנה בממשק אחד
    • ‫514: מספר היציאה להאזנה (לדוגמה, 514, ‏ 1514, ‏ 6514)
  • הגדרת הייצוא:

    • ‫<customer_id>: מספר הלקוח מהשלב הקודם
    • ‫location: מחליפים את <LOCATION> באזור של מופע Google SecOps (לדוגמה, us,‏ europe או asia-southeast1). ערך זה מתווסף לתחילית chronicle.googleapis.com של הכלי לייצוא. רשימה מלאה של נקודות הקצה האזוריות מופיעה במאמר Regional Endpoints.
    • ‫project: מחליפים את <PROJECT_NUMBER> במספר הפרויקט שמופיע בקטע IAM & Admin > Settings.
    • ‫endpoint: משאירים את הערך chronicle.googleapis.com.
    • משנים את creds_file_path לנתיב של קובץ המפתח בפורמט JSON של חשבון השירות (אפשרות 1), בהתאם לפלטפורמה:
      • Linux: /opt/observiq-otel-collector/ingestion-auth.json
      • Windows: C:\Program Files\observIQ OpenTelemetry Collector\ingestion-auth.json

מייצא API להטמעה מדור קודם

  • אם משתמשים בקובץ האימות של ההעלאה מאפשרות 2, מחליפים את הבלוק exporters בבלוק הבא. מגדירים את creds_file_path לנתיב לקובץ האימות של ההעברה, ואם המופע שלכם נמצא מחוץ לארה"ב, מחליפים את malachiteingestion-pa.googleapis.com בנקודת הקצה האזורית (לדוגמה, europe-malachiteingestion-pa.googleapis.com).

    exporters:
      chronicle/openldap:
        compression: gzip
        creds_file_path: '/opt/observiq-otel-collector/ingestion-auth.json'
        customer_id: '<customer_id>'
        endpoint: malachiteingestion-pa.googleapis.com
        log_type: OPENLDAP
        raw_log_field: body
    

שמירת קובץ התצורה

  • אחרי שמסיימים לערוך, שומרים את הקובץ:
    • Linux: מקישים על Ctrl+O, אחר כך על Enter ואז על Ctrl+X
    • Windows: לוחצים על קובץ > שמירה

מפעילים מחדש את סוכן Bindplane כדי להחיל את השינויים.

כדי להפעיל מחדש את הסוכן של Bindplane ב-Linux:

  1. מריצים את הפקודה הבאה:

    sudo systemctl restart observiq-otel-collector
    
  2. מוודאים שהשירות פועל:

    sudo systemctl status observiq-otel-collector
    
  3. בודקים אם יש שגיאות ביומנים:

    sudo journalctl -u observiq-otel-collector -f
    

כדי להפעיל מחדש את הסוכן של Bindplane ב-Windows:

  1. בוחרים אחת מהאפשרויות האלה:

    • שורת פקודה או PowerShell כאדמין:
    net stop observiq-otel-collector && net start observiq-otel-collector
    
    • מסוף השירותים:
      1. לוחצים על Win+R, מקלידים services.msc ולוחצים על Enter.
      2. מחפשים את observIQ OpenTelemetry Collector.
      3. לוחצים לחיצה ימנית ובוחרים באפשרות הפעלה מחדש.
  2. מוודאים שהשירות פועל:

    sc query observiq-otel-collector
    
  3. בודקים אם יש שגיאות ביומנים:

    type "C:\Program Files\observIQ OpenTelemetry Collector\log\collector.log"
    

הגדרת העברת syslog ב-OpenLDAP

אפשר להגדיר את OpenLDAP (slapd) כך שיתעד ביומן באמצעות syslog. מגדירים את שד ה-syslog להעברת יומנים של OpenLDAP לסוכן Bindplane.

  1. מוודאים ש-OpenLDAP מוגדר להתחבר ל-syslog. בודקים את slapd.conf או את cn=config כדי למצוא את ההוראה loglevel:

    loglevel stats conns
    
  2. כברירת מחדל, OpenLDAP מתעד ביומן את מתקן ה-syslog של local4. מגדירים את rsyslog כך שיעביר את היומנים האלה לסוכן Bindplane. יוצרים קובץ תצורה:

    sudo nano /etc/rsyslog.d/openldap-forward.conf
    
  3. מוסיפים את התוכן הבא:

    local4.* @BINDPLANE_AGENT_IP:514
    
  4. מפעילים מחדש את שירות rsyslog:

    sudo systemctl restart rsyslog
    

טבלת מיפוי UDM

שדה ביומן מיפוי UDM היגיון
op, fd, ou, cn, dc, dc1, base1, base2, base3, scope_data, valueData, method, filter, tag_data, err, attrData, ou_2, ou_1, syslog_message, immutable_user_id, resource additional.fields מוזגו עם תוויות שנוצרו מהשדות האלה
extensions.auth.type הערך שמוגדר הוא AUTHTYPE_UNSPECIFIED
caller_ip, proxy1_ip, proxy2_ip מתווך מוזג ממתווך, proxy_1, ‏ proxy_2
msg1, inner_message metadata.description ערך מ-msg1 או מ-inner_message
metadata.event_type מוגדר בהתחלה כ-"GENERIC_EVENT", לאחר מכן כ-"STATUS_UPDATE" אם יש כתובת IP של משתמש, כ-"USER_UNCATEGORIZED" אם יש משתמש, כ-"USER_LOGIN" אם יש חותמת זמן או inner_ts
ldap_action metadata.product_event_type ערך מ-ldap_action באותיות קטנות
ldap_conn metadata.product_log_id הערך מ-ldap_conn אחרי הסרת "conn="
user_agent network.http.user_agent הערך הועתק ישירות
session_id network.session_id הערך הועתק ישירות
principal_ip, prin_ip, caller_ip, r_ip_or_host, proxy_client_ip, src_ip, client_ip principal.asset.ip מוזג מ-principal_ip (אחרי החלפת - ב-.), מ-prin_ip, מ-caller_ip, מ-r_ip_or_host (אם IP), מ-proxy_client_ip, מ-src_ip, מ-client_ip
r_ip_or_host, src_host principal.hostname הערך מ-r_ip_or_host אם שם המארח, אחרת src_host
principal_ip, prin_ip, caller_ip, r_ip_or_host, proxy_client_ip, src_ip, client_ip principal.ip מוזג מ-principal_ip (אחרי החלפת - ב-.), מ-prin_ip, מ-caller_ip, מ-r_ip_or_host (אם IP), מ-proxy_client_ip, מ-src_ip, מ-client_ip
מדינה principal.location.country_or_region הערך הועתק ישירות
prin_port, ‏ port, ‏ src_port principal.port הערך מ-prin_port,‏ port או src_port, שהומר למספר שלם
syslog_process principal.process.file.full_path הערך הועתק ישירות
syslog_pid principal.process.pid הערך הועתק ישירות
org_name principal.user.company_name הערך הועתק ישירות
user, cn, uid principal.user.userid ערך מהמשתמש, cn או uid
security_result security_result מיזוג ישיר
action, sec_action security_result.action ערך מ-action (על סמך קודי שגיאה) או מ-sec_action (על סמך login_status)
resource, immutable_user_id security_result.detection_fields מוזג עם תוויות מהמשאב ומ-immutable_user_id
inner_descrption, security_description security_result.description ערך מ-inner_descrption או מ-security_description
tuser, username, userid target.user.userid ערך מ-tuser,‏ username או userid
metadata.product_name ההגדרה היא OpenLDAP
metadata.vendor_name ההגדרה היא OpenLDAP
eventType event.idm.read_only_udm.metadata.product_event_type מופה מיומן השינויים
cn event.idm.read_only_udm.additional.fields מופה מיומן השינויים
sequenceId event.idm.read_only_udm.additional.fields מופה מיומן השינויים
dc_2 event.idm.read_only_udm.additional.fields מופה מיומן השינויים
dc_3 event.idm.read_only_udm.additional.fields מופה מיומן השינויים
dc event.idm.read_only_udm.additional.fields מופה מיומן השינויים
dc_1 event.idm.read_only_udm.additional.fields מופה מיומן השינויים
user event.idm.read_only_udm.principal.user.userid מופה מיומן השינויים
path event.idm.read_only_udm.principal.process.file.full_path מופה מיומן השינויים
ip1 principal.ip מופה מיומן השינויים
base", "err", "attr", "tag", "scope", and "valueData additional.fields מופה מיומן השינויים
security_result.action ALLOW מופה מיומן השינויים
security_result.action BLOCK מופה מיומן השינויים

יומן שינויים

צפייה ביומן השינויים של המנתח הזה

הבעיה עדיין לא נפתרה? קבלת תשובות מחברי הקהילה וממומחי Google SecOps.