其實運維工作,出現各種問題是在所難免的,不僅要有很好的分析處理能力,而且還要避免問題再次發生。
要清楚認識到出現問題的真實原因:
支援對X11、Linux、Unix、資料庫、網路裝置、安全裝置等一系列授權賬號進行密碼的自動化週期更改,簡化密碼管理,讓使用者無需記憶眾多系統密碼,即可實現自動登入目標裝置,便捷安全;
裝置支援統一賬戶管理策略,能夠實現對所有伺服器、網路裝置、安全裝置等賬號進行集中管理,完成對賬號整個生命週期的監控,並且可以對裝置進行特殊角設定,如:審計巡檢員、運維操作員、裝置管理員等自定義,以滿足審計需求;
裝置提供統一的認證介面,對使用者進行認證,支援身份認證模式包括動態口令、靜態密碼、硬體key、生物特徵等多種認證方式,裝置具有靈活的客製化介面,可以與其他第三方認證伺服器直接結合;
安全的認證模式,有效提高了認證的安全性和可靠性;
裝置提供基於使用者、目標裝置、時間、協定型別IP、行為等要素實現細粒度的操作授權,最大限度保護使用者資源的安全;
裝置支援對不同使用者進行不同策略的制定,細粒度的存取控制能夠最大限度的保護使用者資源的安全,嚴防非法、越權存取事件的發生;
裝置能夠對字串、圖形、檔案傳輸、資料庫等安全操作進行行為審計;通過裝置錄影方式監控運維人員對作業系統、安全裝置、網路裝置、資料庫等進行的各種操作,對違規行為進行事中控制;對終端指令資訊能夠進行精確搜尋,進行錄影精確定位;
多出現在同一工作組中,由於工作需要,同時系統管理員賬號唯一,因此只能多使用者共用同一賬號;如果發生安全事故,不僅難以定位賬號的實際使用者和責任人,而且無法對賬號的使用範圍進行有效控制,存在較大的安全風險和隱患;
目前一個維護人員使用多個賬號時較為普遍的情況,使用者需要記憶多套口令同時在多套主機系統、網路裝置之間切換,降低工作效率,增加工作複雜度;
維護人員的許可權大多是粗放管理,無基於最小許可權分配原則的使用者許可權管理,難以實現更細粒度的命令許可權控制,系統安全性無法充分保證;
各個網路裝置、主機系統、資料庫是分別單獨審計記錄存取行為,由於沒有統一審計策略,而且各系統自身審計紀錄檔內容深淺不一,難以及時通過系統自身審計發現違規操作行為和追查取證;
[root@JumpServer ~]# cat /etc/redhat-release CentOS Linux release 7.9.2009 (Core) [root@JumpServer ~]# uname -r 3.10.0-1160.el7.x86_64 [root@JumpServer ~]# setenforce 0 [root@JumpServer ~]# systemctl stop friewalld [root@JumpServer ~]# hostname -I 172.16.70.181 [root@JumpServer ~]# yum update -y [root@JumpServer ~]# yum install wget curl tar gettext iptables vim net-tools lrzsz tree -y
[root@JumpServer ~]# cd /opt [root@JumpServer opt]# wget https://github.com/jumpserver/installer/releases/download/v2.28.6/jumpserver-installer-v2.28.6.tar.gz [root@JumpServer opt]# tar -xf jumpserver-installer-v2.28.6.tar.gz [root@JumpServer opt]# mv jumpserver-installer-v2.28.6 jumpserver [root@JumpServer opt]# ls jumpserver compose config-example.txt config_init jmsctl.sh LICENSE locale quick_start.sh README.md scripts static.env utils [root@JumpServer opt]# tree jumpserver jumpserver ├── compose │ ├── docker-compose-app.yml │ ├── docker-compose-db-tls.yml │ ├── docker-compose-es.yml │ ├── docker-compose-init-db.yml │ ├── docker-compose-init-tls.yml │ ├── docker-compose-init-xpack.yml │ ├── docker-compose-lb.yml │ ├── docker-compose-mariadb.yml │ ├── docker-compose-minio.yml │ ├── docker-compose-mysql.yml │ ├── docker-compose-network_ipv6.yml │ ├── docker-compose-network.yml │ ├── docker-compose-redis.yml │ ├── docker-compose-task.yml │ └── docker-compose-xpack.yml ├── config-example.txt ├── config_init │ ├── core │ │ └── config.yml │ ├── koko │ │ └── config.yml │ ├── mariadb │ │ └── mariadb.cnf │ ├── mysql │ │ └── my.cnf │ ├── nginx │ │ ├── cert │ │ │ ├── server.crt │ │ │ └── server.key │ │ └── lb_http_server.conf │ ├── README.md │ └── redis │ └── redis.conf ├── jmsctl.sh ├── LICENSE ├── locale │ ├── en │ │ └── LC_MESSAGES │ │ ├── jumpserver-installer.mo │ │ └── jumpserver-installer.po │ └── zh_CN │ └── LC_MESSAGES │ ├── jumpserver-installer.mo │ └── jumpserver-installer.po ├── quick_start.sh ├── README.md ├── scripts │ ├── 0_prepare.sh │ ├── 1_config_jumpserver.sh │ ├── 2_install_docker.sh │ ├── 3_load_images.sh │ ├── 4_install_jumpserver.sh │ ├── 5_db_backup.sh │ ├── 6_db_restore.sh │ ├── 7_upgrade.sh │ ├── 8_uninstall.sh │ ├── const.sh │ ├── docker.service │ └── utils.sh ├── static.env └── utils ├── build.sh └── messages.sh 16 directories, 48 files
[root@JumpServer opt]# ls jumpserver/config-example.txt jumpserver/config-example.txt
[root@JumpServer opt]# bash jumpserver/jmsctl.sh install ██╗██╗ ██╗███╗ ███╗██████╗ ███████╗███████╗██████╗ ██╗ ██╗███████╗██████╗ ██║██║ ██║████╗ ████║██╔══██╗██╔════╝██╔════╝██╔══██╗██║ ██║██╔════╝██╔══██╗ ██║██║ ██║██╔████╔██║██████╔╝███████╗█████╗ ██████╔╝██║ ██║█████╗ ██████╔╝ ██ ██║██║ ██║██║╚██╔╝██║██╔═══╝ ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██╔══╝ ██╔══██╗ ╚█████╔╝╚██████╔╝██║ ╚═╝ ██║██║ ███████║███████╗██║ ██║ ╚████╔╝ ███████╗██║ ██║ ╚════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚══════╝╚═╝ ╚═╝ Version: v2.28.6 1. Check Configuration File Path to Configuration file: /opt/jumpserver/config /opt/jumpserver/config/config.txt [ √ ] /opt/jumpserver/config/nginx/cert/server.crt [ √ ] /opt/jumpserver/config/nginx/cert/server.key [ √ ] complete >>> Install and Configure Docker 1. Install Docker Starting to download Docker engine ... Starting to download Docker Compose binary ... complete 2. Configure Docker Do you want to support IPv6? (y/n) (default n): complete 3. Start Docker Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /etc/systemd/system/docker.service. complete >>> Loading Docker Image [jumpserver/redis:6.2] ...... [jumpserver/mariadb:10.6] ...... [jumpserver/core:v2.28.6] ...... [jumpserver/koko:v2.28.6] ...... [jumpserver/lion:v2.28.6] ...... [jumpserver/magnus:v2.28.6] ...... [jumpserver/web:v2.28.6] ...... complete >>> Install and Configure JumpServer 1. Configure Private Key SECRETE_KEY: NmUxMzRkNTYtNTk5MS1kM2I0LWJiZTUtZmIwMWE0YzNhYWM1 BOOTSTRAP_TOKEN: NmUxMzRkNTYtNTk5MS1kM2I0 complete 2. Configure Persistent Directory Do you need custom persistent store, will use the default directory /data/jumpserver? (y/n) (default n): complete 3. Configure MySQL Do you want to use external MySQL? (y/n) (default n): complete 4. Configure Redis Do you want to use external Redis? (y/n) (default n): complete 5. Configure External Port Do you need to customize the JumpServer external port? (y/n) (default n): complete 6. Init JumpServer Database ...... complete >>> The Installation is Complete 1. You can use the following command to start, and then visit cd /opt/jumpserver ./jmsctl.sh start 2. Other management commands ./jmsctl.sh stop ./jmsctl.sh restart ./jmsctl.sh backup ./jmsctl.sh upgrade For more commands, you can enter ./jmsctl.sh --help to understand 3. Web access http://172.16.70.181:80 Default username: admin Default password: admin 4. SSH/SFTP access ssh -p2222 [email protected] sftp -P2222 [email protected] 5. More information Official Website: https://www.jumpserver.org/ Documentation: https://docs.jumpserver.org/
[root@JumpServer opt]# cat jumpserver/config/config.txt # JumpServer configuration file example. # # 如果不瞭解用途可以跳過修改此組態檔, 系統會自動填入 # 完整引數檔案 https://docs.jumpserver.org/zh/master/admin-guide/env/ ################################## 映象設定 ################################### # # 國內連線 docker.io 會超時或下載速度較慢, 開啟此選項使用華為雲映象加速 # 取代舊版本 DOCKER_IMAGE_PREFIX # # DOCKER_IMAGE_MIRROR=1 ################################## 安裝設定 ################################### # # JumpServer 資料庫持久化目錄, 預設情況下錄影、任務紀錄檔都在此目錄 # 請根據實際情況修改, 升級時備份的資料庫檔案(.sql)和組態檔也會儲存到該目錄 # VOLUME_DIR=/data/jumpserver # 加密金鑰, 遷移請保證 SECRET_KEY 與舊環境一致, 請勿使用特殊字串 # (*) Warning: Keep this value secret. # (*) 勿向任何人洩露 SECRET_KEY # SECRET_KEY=NmUxMzRkNTYtNTk5MS1kM2I0LWJiZTUtZmIwMWE0YzNhYWM1 # 元件向 core 註冊使用的 token, 遷移請保持 BOOTSTRAP_TOKEN 與舊環境一致, # 請勿使用特殊字串 # (*) Warning: Keep this value secret. # (*) 勿向任何人洩露 BOOTSTRAP_TOKEN # BOOTSTRAP_TOKEN=NmUxMzRkNTYtNTk5MS1kM2I0 # 紀錄檔等級 INFO, WARN, ERROR # LOG_LEVEL=ERROR # JumpServer 容器使用的網段, 請勿與現有的網路衝突, 根據實際情況自行修改 # DOCKER_SUBNET=192.168.250.0/24 # ipv6 nat, 正常情況下無需開啟 # 如果宿主不支援 ipv6 開啟此選項將會導致無法獲取真實的使用者端 ip 地址 # USE_IPV6=0 DOCKER_SUBNET_IPV6=fc00:1010:1111:200::/64 ################################# MySQL 設定 ################################## # 外接 MySQL 需要輸入正確的 MySQL 資訊, 內建 MySQL 系統會自動處理 # DB_HOST=mysql DB_PORT=3306 DB_USER=root DB_PASSWORD=NmUxMzRkNTYtNTk5MS1kM2I0LW DB_NAME=jumpserver # 如果外接 MySQL 需要開啟 TLS/SSL 連線, 參考 https://docs.jumpserver.org/zh/master/install/install_security/#ssl # # DB_USE_SSL=True ################################# Redis 設定 ################################## # 外接 Redis 需要請輸入正確的 Redis 資訊, 內建 Redis 系統會自動處理 # REDIS_HOST=redis REDIS_PORT=6379 REDIS_PASSWORD=NmUxMzRkNTYtNTk5MS1kM2I0LW # 如果使用外接 Redis Sentinel, 請手動填寫下面內容 # # REDIS_SENTINEL_HOSTS=mymaster/192.168.100.1:26379,192.168.100.1:26380,192.168.100.1:26381 # REDIS_SENTINEL_PASSWORD=your_sentinel_password # REDIS_PASSWORD=your_redis_password # REDIS_SENTINEL_SOCKET_TIMEOUT=5 # 如果外接 Redis 需要開啟 TLS/SSL 連線, 參考 https://docs.jumpserver.org/zh/master/install/install_security/#redis-ssl # # REDIS_USE_SSL=True ################################## 存取設定 ################################### # 對外提供伺服器埠, 如果與現有服務衝突請自行修改 # 如果不想對外提供存取可以使用 127.0.0.1:<port>, eg: 127.0.0.1:33060 # HTTP_PORT=80 SSH_PORT=2222 MAGNUS_PORTS=30000-30100 ################################# HTTPS 設定 ################################# # 參考 https://docs.jumpserver.org/zh/master/admin-guide/proxy/ 設定 # # HTTPS_PORT=443 # SERVER_NAME=your_domain_name # SSL_CERTIFICATE=your_cert # SSL_CERTIFICATE_KEY=your_cert_key # # Nginx 檔案上傳下載大小限制 # CLIENT_MAX_BODY_SIZE=4096m ################################## 元件設定 ################################### # 元件註冊使用, 預設情況下向 core 容器註冊, 叢集環境需要修改為叢集 vip 地址 # CORE_HOST=http://core:8080 PERIOD_TASK_ENABLED=True # Core Session 定義, # SESSION_COOKIE_AGE 表示閒置多少秒後 session 過期, # SESSION_EXPIRE_AT_BROWSER_CLOSE=true 表示關閉瀏覽器即 session 過期 # # SESSION_COOKIE_AGE=86400 SESSION_EXPIRE_AT_BROWSER_CLOSE=True # Lion 開啟字型平滑, 優化體驗 # JUMPSERVER_ENABLE_FONT_SMOOTHING=True ################################# XPack 設定 ################################# # XPack 包, 開源版本設定無效 # RDP_PORT=3389 ################################## 其他設定 ################################## # 終端使用宿主 HOSTNAME 標識, 首次安裝自動生成 # SERVER_HOSTNAME=JumpServer # 當前執行的 JumpServer 版本號, 安裝和升級完成後自動生成 # CURRENT_VERSION=v2.28.6 ============================================================================== # 組態檔前後對比如下 [root@JumpServer opt]# diff jumpserver/config-example.txt jumpserver/config/config.txt 24c24 < SECRET_KEY= --- > SECRET_KEY=NmUxMzRkNTYtNTk5MS1kM2I0LWJiZTUtZmIwMWE0YzNhYWM1 31c31 < BOOTSTRAP_TOKEN= --- > BOOTSTRAP_TOKEN=NmUxMzRkNTYtNTk5MS1kM2I0 53c53 < DB_PASSWORD= --- > DB_PASSWORD=NmUxMzRkNTYtNTk5MS1kM2I0LW 65c65 < REDIS_PASSWORD= --- > REDIS_PASSWORD=NmUxMzRkNTYtNTk5MS1kM2I0LW 124c124 < SERVER_HOSTNAME=${HOSTNAME} --- > SERVER_HOSTNAME=JumpServer 128c128 < CURRENT_VERSION= --- > CURRENT_VERSION=v2.28.6 ============================================================================= [root@JumpServer opt]# tree jumpserver/config jumpserver/config ├── config.txt # 主組態檔 ├── core │ └── config.yml # core yml 格式組態檔,可以留空,使用 config.txt 設定 ├── koko │ └── config.yml # koko yml 格式組態檔,可以留空,使用 config.txt 設定 ├── mariadb │ └── mariadb.cnf # mariadb 組態檔 ├── mysql │ └── my.cnf # mysql 組態檔 ├── nginx # nginx 組態檔 │ ├── cert │ │ ├── server.crt │ │ └── server.key │ └── lb_http_server.conf └── redis └── redis.conf # redis 組態檔 7 directories, 9 files
[root@JumpServer opt]# bash jumpserver/jmsctl.sh --help 或 [root@JumpServer opt]# jmsctl --help JumpServer Deployment Management Script Usage: ./jmsctl.sh [COMMAND] [ARGS...] ./jmsctl.sh --help Installation Commands: install Install JumpServer upgrade [version] Upgrade JumpServer check_update Check for updates JumpServer reconfig Reconfiguration JumpServer Management Commands: start Start JumpServer stop Stop JumpServer close Close JumpServer restart Restart JumpServer status Check JumpServer down Offline JumpServer uninstall Uninstall JumpServer More Commands: load_image Loading docker image backup_db Backup database restore_db [file] Data recovery through database backup file raw Execute the original docker-compose command tail [service] View log
[root@JumpServer opt]# jmsctl status NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS jms_mysql jumpserver/mariadb:10.6 "docker-entrypoint.s…" mysql 13 minutes ago Up 13 minutes (healthy) 3306/tcp jms_redis jumpserver/redis:6.2 "docker-entrypoint.s…" redis 13 minutes ago Up 13 minutes (healthy) 6379/tcp [root@JumpServer opt]# jmsctl start [+] Running 8/8 ⠿ Container jms_redis Healthy 0.6s ⠿ Container jms_mysql Healthy 0.6s ⠿ Container jms_core Healthy 11.9s ⠿ Container jms_magnus Started 14.1s ⠿ Container jms_celery Started 12.4s ⠿ Container jms_web Started 12.6s ⠿ Container jms_koko Started 12.4s ⠿ Container jms_lion Started 12.5s [root@JumpServer opt]# jmsctl status NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS jms_celery jumpserver/core:v2.28.6 "./entrypoint.sh sta…" celery About a minute ago Up About a minute (healthy) 8070/tcp, 8080/tcp jms_core jumpserver/core:v2.28.6 "./entrypoint.sh sta…" core About a minute ago Up About a minute (healthy) 8070/tcp, 8080/tcp jms_koko jumpserver/koko:v2.28.6 "./entrypoint.sh" koko About a minute ago Up About a minute (healthy) 0.0.0.0:2222->2222/tcp, :::2222->2222/tcp, 5000/tcp jms_lion jumpserver/lion:v2.28.6 "./entrypoint.sh" lion About a minute ago Up About a minute (healthy) 4822/tcp, 8081/tcp jms_magnus jumpserver/magnus:v2.28.6 "./entrypoint.sh" magnus About a minute ago Up About a minute (healthy) 0.0.0.0:30000-30100->30000-30100/tcp, :::30000-30100->30000-30100/tcp jms_mysql jumpserver/mariadb:10.6 "docker-entrypoint.s…" mysql 15 minutes ago Up 15 minutes (healthy) 3306/tcp jms_redis jumpserver/redis:6.2 "docker-entrypoint.s…" redis 15 minutes ago Up 15 minutes (healthy) 6379/tcp jms_web jumpserver/web:v2.28.6 "/docker-entrypoint.…" web About a minute ago Up About a minute (healthy) 0.0.0.0:80->80/tcp, :::80->80/tcp