Intercalaire 4 : INFRA DEPLOIEMENT

Généré le 4 Avril 2026 - Projet Talas


📄 README.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/README.md

Infrastructure – Ansible

Ce dossier contient les rôles et playbooks Ansible utilisés pour provisionner, configurer et maintenir l'infrastructure Talas.

Objectifs :

Contenu recommandé :

Conseil : isole bien les variables sensibles dans vault.yml et documente les secrets via README_secrets.md.

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/auditd/readme.md

Auditd

This roles installs auditd and activate it with 3 differents logging tags that are described bellow: 1. exec_metal_admin 1. exec_container_admin 1. exec_container_user

1. Logging Commands by Admins on the Host

-a always,exit -F arch=b64 -S execve -F auid>=10000 -F auid<=10999 -k exec_metal_admin

2. Logging Commands by Admins in Containers

-a always,exit -F arch=b64 -S execve -F auid>=1010000 -F auid<=1010999 -k exec_container_admin

3. Logging Commands by Non-Admin Users in Containers

-a always,exit -F arch=b64 -S execve -F auid>=1012000 -F auid<=1012999 -k exec_container_user

Noise Reduction Rules

The following rules exclude specific message types to reduce unnecessary log entries:

-a exclude,always -F msgtype=CRED_ACQ
-a exclude,always -F msgtype=CRED_DISP
-a exclude,always -F msgtype=CRED_REFR
-a exclude,always -F msgtype=CWD
-a exclude,always -F msgtype=PATH
-a exclude,always -F msgtype=PROCTITLE
-a exclude,always -F msgtype=SERVICE_START
-a exclude,always -F msgtype=SERVICE_STOP
-a exclude,always -F msgtype=SOCKADDR
-a exclude,always -F msgtype=USER_ACCT
-a exclude,always -F msgtype=USER_AUTH
-a exclude,always -F msgtype=USER_END
-a exclude,always -F msgtype=USER_START
-a exclude,always -F auid=4294967295

Compliance and Validation

Log Shipping

Filebeat is used to send the logs to Elasticsearch for easy access via Kibana.

Auditd useful commands

Show current audit rules:

auditctl -l

Search logs by tags:

ausearch -k exec_metal_admin

Search by uid or uidnumber:

ausearch -ua adm-jgrauer

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/coraza/readme.md

Coraza role

This role installs the Coraza WAF SPOA connector, an HTTP filtering layer that integrates the OWASP Core Rule Set (CRS) via HAProxy's SPOE mechanism.

It is intended for production environments where applications require firewalling, and it supports tuning of security behavior through multiple paranoia levels and customizable directives.

Variable reference

Optional variables

Variable Description Type of variable Default value Other value
coraza_spoa_transaction_ttl_ms Transaction lifetime in milliseconds integer 500 300, 900, 3000
coraza_directives Block of Coraza/ModSecurity directives to inject multiline Default OWASP CRS directives block SecRuleEngine DetectionOnly, custom directives
coraza_sec_rule_engine Enables or disables Coraza traffic processing string DetectionOnly On, DetectionOnly, Off
coraza_paranoia_level OWASP CRS paranoia level: strictness & false positive sensitivity integer 1 1, 2, 3, 4

Configuration

By default, this role applies a moderate Coraza WAF configuration, using the lowest paranoia level and loading all available OWASP CRS rules and plugins:

SecAction "id:1000001,phase:1,pass,t:none,nolog,setvar:tx.blocking_paranoia_level=1
Include /etc/coraza/coraza.conf
Include /etc/coraza/crs-setup.conf
Include /etc/coraza/plugins/*.conf
Include /etc/coraza/rules/*.conf

This default setup is safe for most production environments, with minimal risk of blocking legitimate traffic. However, if your application requires stricter protections, you can adjust the behavior using the coraza_paranoia_level variable, which supports 4 levels of rule strictness:

If you choose a paranoia level higher than 1, be aware that false positives are more likely, potentially blocking legitimate traffic. In such cases, it is strongly advised to tune the WAF directives for your specific application by overriding the default rules with the coraza_directives variable.

This allows you to include only selected rule sets or inject custom SecRule logic that satisfies your needs.

You can check what's in the rules in OWASP CRS documentation.

Usefull links

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/crontab/readme.md

Manage crontab

This role is very simple is use the same parameters of module cron (https://docs.ansible.com/ansible/latest/modules/cron_module.html).

Examples

Cron restart apache2 every 4 hours:

cron_tasks:
  - name: "Restart apache2 - https://tracker.cosium.com/browse/IT-5016"
    minute: "0"
    hour: "*/4"
    job: "systemctl restart apache2.service"

Environnement variable:

cron_tasks:
  - name: MAILTO
    env: yes
    value: ""

Silence /etc/cron.d/ crons

This is an edge case, crons souldn't be managed this way, but you can silence mails from crons inside /etc/cron.d/* files by adding MAILTO="" for root, e.g. with:

crontab_silence_files: [sentry, belgique_demo]

N.B.: only existing files are updated.

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/docker/readme.md

Docker role

This role will install Docker on a target machine running Debian or Ubuntu.

Variable reference

Optional variables

Variable Description Default value
docker_compose install docker-compose true
docker_user name of the user who is going to use docker root
docker_rootless run the Docker daemon as a non-root user (Rootless mode) false
docker_pinned see section Select the Docker version bellow None
docker_compose_version see section Select the Docker-compose version bellow None
docker_registry_login see bellow None

docker_registry_login is used when you need to define an url/username/password to access specific dockers registries.

The object is defined like this:

docker_registry_login:
  - url: "docker.cosium.dev"
    username: "user"
    password: "pass"
  - url: "something"
    username: "user"
    password: "pass"

Example

Select the Docker version

By default, the latest version of Docker will be installed, but you can specify a version by setting this variable:

docker_pinned: "17.09.0~ce-0~debian"
# Or only pin the major version
docker_pinned: "27*"

To find out the list of available versions, use this command on the target server:

# apt-cache madison docker-ce
 docker-ce | 17.09.0~ce-0~debian | https://download.docker.com/linux/debian stretch/stable amd64 Packages
 docker-ce | 17.06.2~ce-0~debian | https://download.docker.com/linux/debian stretch/stable amd64 Packages
 docker-ce | 17.06.1~ce-0~debian | https://download.docker.com/linux/debian stretch/stable amd64 Packages
 docker-ce | 17.06.0~ce-0~debian | https://download.docker.com/linux/debian stretch/stable amd64 Packages
 docker-ce | 17.03.2~ce-0~debian-stretch | https://download.docker.com/linux/debian stretch/stable amd64 Packages
 docker-ce | 17.03.1~ce-0~debian-stretch | https://download.docker.com/linux/debian stretch/stable amd64 Packages
 docker-ce | 17.03.0~ce-0~debian-stretch | https://download.docker.com/linux/debian stretch/stable amd64 Packages

Select the Docker-compose version

By default, this role will install the latest version of docker-compose. You can also select a specific docker-compose version by setting this variable:

docker_compose_version: "1.17.1"

You can find the list of docker-compose release here: https://github.com/docker/compose/releases/

Informations

Important about the network

This role let docker create the docker0 bridge interface. This means that if docker sees a route for all the rfc1918 networks (10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16), it will fail.

This basically is the case for the machines in the DMZ: all those routes are defined so that the default gateway can be the BGP router, typically you have such configuration for their DMZ interface:

# DMZ6
auto eth136
       iface eth136 inet static
       address 10.12.36.96
       netmask 24
       dns-nameservers 10.12.1.207 10.12.1.2
       dns-search cosium.com


# static route
up route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.12.36.254 dev eth136
up route add -net 172.16.0.0 netmask 255.240.0.0 gw 10.12.36.254 dev eth136
up route add -net 192.168.0.0 netmask 255.255.0.0 gw 10.12.36.254 dev eth136

To allow doker to create the docker0 interface, you basically have to remove the last line. Currently we don't use any 192.168.0.0/16 network so it won't be an issue.

Update of docker-compose

To perform an update, add this parameter: --extra-vars "docker_compose_update_now=true" , true is case-sensitive since it's evaluated as a string in this case.

This role will also update if this parameter is present: --extra-vars "global_update_now=true" , true is also case-sensitive since it's evaluated as a string in this case.

The update will be skipped if you already have the latest version of the binary.

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/elasticsearch/readme.md

This role will install elasticsearch from the official repository.

Mandatory variables

You must define the elastic repository major version with this form: "N.x" where N is the major version, for example:

elastic_major_version: "7.x"

Currently the 3 supported versions are "7.x", "6.x" and "5.x", for other version, you need to create a new jvm.options template file.

This variable is also used for other elastic.co tools like logstash.

You also must define the elasticsearch clustername, please respect the naming convention (mode is either "prod" or "test"):

elasticsearch_clustername: "center-stats-mode-client"

ElasticSearch optional variables

The variable you are the most likely to change is the JAVA heap size, the default variable is:

elasticsearch_heap_size: "10g"

Other variables have sane default and should not be changed except if you know what you are doing:

elasticsearch_node_name: "${HOSTNAME}"
elasticsearch_node_name_path_data: "/var/lib/elasticsearch"
elasticsearch_node_name_path_logs: "/var/log/elasticsearch"
elasticsearch_node_name_network_host: "_site_"
elasticsearch_cluster_routing_allocation:
  cluster_concurrent_rebalance: 4
  node_concurrent_recoveries: 4
  node_initial_primaries_recoveries: 8

An finaly, you can define any arbitrary variables using the object "elasticsearch_additional_config" like that for version 6.x:

elasticsearch_additional_config:
  action.destructive_requires_name: "true"
  script.painless.regex.enabled: "true"
  script.max_compilations_rate: "120/1m" # this is specific for 6.x

or an other example for 5.x:

elasticsearch_additional_config:
  action.destructive_requires_name: "true"
  script.painless.regex.enabled: "true"
  script.max_compilations_per_minute: "1000" # this is specific for 5.x

Update

To perform an update, add this to the command line: --extra-vars '{ "elasticsearch_update_now" : true }'.

You still have to double check the different settings between major version if you are doing a major update. For minor ones, the update should be painless.

systemd service optional variables

To modify the systemd service for elasticsearch, the official documentation (at https://www.elastic.co/guide/en/elasticsearch/reference/master/setting-system-settings.html) explains that a systemd override file must be used.

This role uses an override file to change the following default values:

LimitNOFILE: "655360"       # same as ulimit -n
LimitNPROC: "4096"      # same as ulimit -u
LimitMEMLOCK: "infinity"    # same as ulimit -l

You can override any of those 3 settings with this variable (undefined variable will use the default from above):

elasticsearch_systemd_override:
  LimitNOFILE: "655360"
  LimitNPROC: "4096"

Clustering

Your cluster must have an odd number of master nodes with a quorum of 1/2 + 1 node (minimum of 3 nodes, quorum of 2), this is necessary to avoid data loss. Look at the official documentation for more details.

To define a master only node, you must specify this:

(!) replace the expected_data_nodes with the number of data nodes that must be up to start the cluster, without replication, this is all your data nodes.

elasticsearch_node:
  master: "true"
  data: "false"
  ingest: "false"
elasticsearch_gateway:
  expected_data_nodes: "3"

For a data node, use this instead:

elasticsearch_node:
  master: "false"

You also need to define on every node the cluster topology, with the DNS of every nodes and the minimum number of master to start the cluster (= the quorum), this is an example:

elasticsearch_additional_config:
  discovery.zen.ping.unicast.hosts: '[ "center-stats-prod-o2k-1.cosium.com", "center-stats-prod-o2k-2.cosium.com", "center-stats-prod-o2k-3.cosium.com", "center-stats-prod-o2k-4.cosium.com", "center-stats-prod-o2k-5.cosium.com", "center-stats-prod-o2k-6.cosium.com" ]'
  discovery.zen.minimum_master_nodes: "2"

If you already defined elasticsearch_additional_config, just add those settings to the already defined variables.

Security

By default, there is absolutely no security restricting the access to the elasticsearch instance from anywhere. The only protection is the network.

To protect the instance, use iptables rule with the firewall role.

JMX monitoring

By default, JMX monitoring is active and listening on port 8301. You also must protect this port using a firewall rule because it is not protected by a login/pass. I tried to use the classic JMX login/password mechnism but for an unknown reason, this doesn't work.

You can deactivate the JMX monitoring by setting this variable to False:

elasticsearch_jvm_monitoring: False

Useful curl command

General informations:

# curl http://localhost:9200/
{
  "name" : "infra-log-elasticsearch-1",
  "cluster_name" : "infra-prod",
  "cluster_uuid" : "kbEf8yXQT1amAZrKhGZbTg",
  "version" : {
    "number" : "7.5.0",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "e9ccaed468e2fac2275a3761849cbee64b39519f",
    "build_date" : "2019-11-26T01:06:52.518245Z",
    "build_snapshot" : false,
    "lucene_version" : "8.3.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

Show indices:

# curl http://localhost:9200/_cat/indices?v
health status index                            uuid                   pri rep docs.count docs.deleted store.size pri.store.size
green  open   filebeat-7.5.0-2019.12.09-000001 2rCN7-qPQrS-HKG1tGPwvQ   1   1          0            0       460b           230b
green  open   .kibana_task_manager_1           GFzoyVwfQvOaolx46qlCaw   1   1          2            1     32.5kb         16.2kb
green  open   .apm-agent-configuration         zVcE8tJWT_63J-tX1zcx-A   1   1          0            0       566b           283b
green  open   .kibana_1                        LxaUmUqpR6ibZOXlbrNmhw   1   1       1058           44        1mb          514kb

Show mappings:

curl http://localhost:9200/_mapping

curl http://localhost:9200/filebeat-7.5.0-2019.12.05-000001/_mapping | jq .

Delete an indice or sevferal indices:

curl -X DELETE "localhost:9200/filebeat-7.5.0?pretty"

curl -XDELETE 'http://localhost:9200/filebeat-*'

Import a template:

filebeat export template > filebeat.template.json
curl -XPUT -H 'Content-Type: application/json' http://localhost:9200/_template/filebeat-7.5.0 -d@filebeat.template.json

See the ILM status if it exists:

curl -s http://localhost:9200/filebeat-7.5.0-2019.12.09-000001/_ilm/explain| jq .

Shards

Show shards status:

curl -s 'http://localhost:9200/_cat/shards'

Explain shards allocation issues:

curl -s "http://localhost:9200/_cluster/allocation/explain" | jq .

Retry failed shards allocation:

curl -X POST -s 'http://localhost:9200/_cluster/reroute?retry_failed=true'

Upgrade of an elasticsearch cluster

Rolling upgrade works and will allow full access to the cluster while updating but is very time consuming, method is here: https://www.elastic.co/guide/en/elasticsearch/reference/current/rolling-upgrades.html

Full cluster restart upgrade is faster, but it means shutting down all nodes in the cluster, method is here: https://www.elastic.co/guide/en/elasticsearch/reference/current/restart-upgrade.html

Summary for full cluster restart upgrade:

1/ disable allocation via

curl -X PUT "localhost:9200/_cluster/settings?pretty" -H 'Content-Type: application/json' -d'
{
  "persistent": {
    "cluster.routing.allocation.enable": "primaries"
  }
}
'

For cluster with not too many indices, you can also change the cluster configuration to not move index until a node is down for more than 10 minutes, be careful, this can take a while to apply because it will need to be applied to all indices:

curl -X PUT -u elastic:xxx "localhost:9200/_all/_settings?pretty" -H 'Content-Type: application/json' -d'
{
  "settings": {
    "index.unassigned.node_left.delayed_timeout": "10m"
  }
}
'

2/ stop all nodes

3/ apt update && apt dist-upgrade && apt autoremove -y

4/ start all nodes

5/ wait for the status to turn yellow by checking curl -s http://localhost:9200/_cluster/health | jq and for curl -X GET "localhost:9200/_cat/recovery?pretty" to return existing_store on every lines

6/ re-enable shard allocation via:

curl -X PUT "localhost:9200/_cluster/settings?pretty" -H 'Content-Type: application/json' -d'
{
  "persistent": {
    "cluster.routing.allocation.enable": null
  }
}
'

If you changed the delayed_timeout value, reset it too:

curl -X PUT -u elastic:xxx "localhost:9200/_all/_settings?pretty" -H 'Content-Type: application/json' -d'
{
  "settings": {
    "index.unassigned.node_left.delayed_timeout": null
  }
}
'

7/ Since ES version 7.X, ths cluster should come back resonably quickly.

Securing Elasticsearch with login/pass

By default, Elasticsearch is not secured via login/pass, only the firewall is protecting it.

Securing ElasticSearch via login/pass also allow the configuration of rights on kibana.

Certificate generation for the cluster

(!) Currently this step is not handled automatically by ansible.

This is mandatory: you must add certificate security first for internode communication.

Generate the CA for the internode communication:

/usr/share/elasticsearch/bin/elasticsearch-certutil ca

This will generate the CA at this location: /usr/share/elasticsearch/elastic-stack-ca.p12.

Then generate the certificate for the internode communication:

/usr/share/elasticsearch/bin/elasticsearch-certutil cert --ca /usr/share/elasticsearch/elastic-stack-ca.p12

The certificate is generated to: /usr/share/elasticsearch/elastic-certificates.p12

Copy the file /usr/share/elasticsearch/elastic-certificates.p12 to /etc/elasticsearch/elastic-certificates.p12 on all nodes.

enable xpack + certificate

To enable x-pack:

xpack.security.enabled: "true"
xpack.security.transport.ssl.enabled: "true"
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.client_authentication: required
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: elastic-certificates.p12

At this point, the cluster is NOT USABLE anymore. You must set up login and pass.

set-up the default accounts

Use this command to generate the default login/password for elasticsearch:

/usr/share/elasticsearch/bin/elasticsearch-setup-passwords auto

The admin user is elastic, use this user/pass for all super-admin actions.

To allow the monitoring to work, you need to use those variable:

elasticsearch_xpack_login: "elastic" # this is the default value, you can omit it
elasticsearch_xpack_password: "{{ lookup('hashi_vault', 'secret=cosium-kv/data/group_vars/name_of_group')['elastic'] }}"

Kibana

If you are using kibana to access the cluster, you need to add the following to its configuration so that it can access the cluster using login/pass:

kibana_extra_config:
  elasticsearch.username: "kibana_system"
  elasticsearch.password: "{{ lookup('hashi_vault', 'secret=cosium-kv/xxxxxxxxxxxxxxxxxxx')['kibana_system'] }}"

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/filebeat/readme.md

Mandatory variables

Define the elastic repository version that will determine the version of filebeat:

elastic_major_version: "7.x"

Define the list of logstash endpoint where to send the logs: Define the output for the logs, it can be either elasticsearch or logstash:

filebeat_output_elasticsearch_hosts:
  - host1
  - host2

or

filebeat_output_logstash_hosts:
  - host1
  - host2

If you use elasticsearch, the connection will use https and use the login/password of the server to authenticate itself. You can change the protocol to http with:

filebeat_output_elasticsearch_protocol: "http"

Optional variables

You can disable this filebeat role by setting this variable :

filebeat_install: false

By default, filebeat will send the system logs to the index logs-infra-system and the other logs to logs-{{ cosium_project }}-{{ cosium_group }}.

Sometime, you want to send all logs (even for the system), to the logs-{{ cosium_project }}-{{ cosium_group }} index.

If this is the case, you need to set this variable to false:

filebeat_separate_system_logs: false

You can define the loglevel of filebeat, the default is warning, possible values are error, warning, info, debug:

filebeat_logging_level: "warning"

Modules

The system module is always enabled.

This role will automatically detect the installation of the following software and enable the correct modules: - apache httpd - elasticsearch - haproxy - kibana - logstash

You can add more module by creating this list:

filebeat_modules_list:
  - system

You can see the list of modules with filebeat modules list.

Update

You can perform an update of filebeat by adding: --extra-vars '{ "filebeat_update" : true }'

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/gerrit/readme.md

Gerrit role important information

This role will install gerrit from a pre-installed version. It is not suitable to install a gerrit from scratch. Some users already exists.

The pre-installed version was created by Réda Housni Alaoui.

This role depends on 2 other roles: - docker - httpd

The config for httpd is defined in the vars folder of this role.

Mandatory variables

Gerrit need its postgresql database password, which cannot be changed (encoded in the original archive). But for security issue, you must define it in the host vault file with this variable:

gerrit_pg_pass: xxxxxxxxxxxxxxxx

You also need to define the domain name of your gerrit installation:

gerrit_domain: "gerrit.example.org"

Optional variables

Bellow are optional variables, either because a default it shipped with this role, or because the whole feature is optional.

docker images and storage

This will define where the data will be stored for gerrit, it can be anywhere:

gerrit_docker_volume: "/srv/gerrit"

You can also change where postgresql store its data, but in this case you will have to move it manually first because the archive store it at this location:

gerrit_docker_pg_volume: "{{ gerrit_docker_volume }}/postgres"

Gerrit main configuration file

The whole configuration is done using the dictionary "gerrit". You can configure any number of categories from the official documentation with it: https://gerrit-review.googlesource.com/Documentation/config-gerrit.html

To do so, the dictionary must be in this form:

gerrit:
  category1:
    item1: value1
    item2: value2
  category2
    item1: value1
    item2: value2
  ...
  categoryN
    item1: value1
    item2: value2

This will generate a configuration like this: (tabs are used because when gerrit itself modifies the file, it uses tabs)

[category1]
    item1 = value1
    item2 = value2

[category2]
    item1 = value1
    item2 = value2

[category3]
    item1 = value1
    item2 = value2

Some categories have default values if undefined, you can see those in the template file "gerrit.config".

TODO

debug mode

This role has an undefined variable gerrit_debug that add a port 4000 to the gerrit container if defined. This currently does nothing because the debug mode of gerrit needs other settings.

make an installation from scratch

This role currently does not create a gerrit from scratch.

use postgresql 10

This role should use pg 10 (currently it uses pg 9.6). It also should have a way to upgrade its postgresql from one version to the next.

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/git_generic_deploy_files/readme.md

Deploy files from a git repository

This role will localy clone any number of git repositories with any number of branches, then create an archive for each repositories/branches combinations.

Those archives will then be extracted to the remote server in the correct directory.

To make this work, you need to define an object with all the necessary variables, like this:

git_generic_deploy_files_list:
  - repository_url: 'https://scmlab.cosium.com/VirtualTryOn/CosiumTryOn_API_Booth.git'
    branch: 'opticworld'
    deploy_directory: '/var/www/opticworld.vto.cosium.io/'
  - repository_url: 'https://scmlab.cosium.com/VirtualTryOn/CosiumTryOn_API_Booth.git'
    branch: 'master'
    deploy_directory: '/dev/shm/test/'

Mandatory variable

Variable Description Example
repository_url repo url https://scmlab.cosium.com/VirtualTryOn/CosiumTryOn_API_Booth.git
branch branch to clone master
deploy_directory path to unpack archive /var/www/freescout

Optional variable

Variable for git_generic_deploy_files_list Description Default value
deploy_directory_owner Owner of deploy_directory path none, same as user executing
deploy_directory_group group owning of deploy_directory path none, same as user executing
deploy_directory_mode perms of deploy_directory path
owner owner of files inside the repo, same for all files same as user executing
group group owning files inside the repo, same for all files same as user executing
mode perms for files inside the repo perserve those from repo

The git_generic_deploy_copy variable is very simple and use the same parameters of module copy (https://docs.ansible.com/ansible/latest/modules/copy_module.html).

Example:

git_generic_deploy_copy:
  - dest: "/var/www/prerequisites.cosium.net/center_prerequisites/configuration.php"
    content: |
      <?php
      define('ACJS_URL', 'https://c1.cosium.biz/43ACJS17007');
      define('ACJS_USER', '{{ local_ACJS_USER }}');
      define('ACJS_PASSWORD', '{{ local_ACJS_PASSWORD }}');
      define('ACJS_SITE', 'm');

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/go/readme.md

Go role

This is a basic role to install Go. By default this role will install the latest release of Go you can change the version by setting go_version.

To use the Go binary you need to specify the whole path : /usr/local/go/bin/go

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/grafana/readme.md

Grafane role

Provision and manage grafana instances.

Compatibility : debian >= 12

Role Variables

All variables which can be overridden are stored in defaults/main.yml file as well as in the table below.

Name Default Description
grafana_address 0.0.0.0 Address on which grafana listens
grafana_port 3000 Port on which grafana listens
grafana_admin_user ansible The name of the default Grafana Admin user, who has full permissions
grafana_admin_password "" The password of the default Grafana Admin. Automatically generated and pushed to hashicorpvault if empty.
grafana_instance "{{ ansible_hostname }}" Set the name of the grafana-server instance. Used in logging, internal metrics, and clustering info.
grafana_url "http://{{ grafana_address }}:{{ grafana_port }}" Full URL used to access Grafana from a web browser
grafana_api_url "{{ grafana_url }}" URL used for API calls in provisioning if different from public URL.
grafana_logs_dir /var/log/grafana Path to logs directory
grafana_data_dir /var/lib/grafana Path to data directory
grafana_plugins [] List of Grafana plugins which should be installed
grafana_organizations [] List of grafana organizations names that should be created
grafana_ldap {} ldap configuration section. group_mappings are expanded
grafana_datasources [] List of datasources which should be configured
grafana_dashboards [] List of dashboards which should be configured
grafana_teams [] List of teams that should be created
grafana_users [] List of users that should be created
grafana_alerting {} alerting configuration section
grafana_snapshots {"external_enabled": False} snapshots configuration section
grafana_custom_icon False Use a custom UI icon in the web UI, must be present as files/grafana_icon.svg

Exemples

Datasources

grafana_datasources:
  - name: Zabbix
    type: alexanderzobnin-zabbix-datasource
    access: proxy
    url: https://myzabbixservr.com/api_jsonrpc.php
    isDefault: true
    jsonData:
      username: grafana_api_ro
      password: "{{ lookup('hashi_vault', 'secret=toto/data/services/zabbix')['grafana_api_ro'] }}"
      trends: true
      trendsFrom: "30d"
      trendsRange: "7d"
      cacheTTL: "1h"
      alerting: false
      addThresholds: false
      dbConnectionEnable: false
      disableReadOnlyUsersAck: true
      disableDataAlignment: false
      useZabbixValueMapping: true
    version: 1
    editable: false

If orgId is not set, the datasource will be added to all available organizations.

Organizations

grafana_organizations:
  - Org2
  - Org3

The first organization "Main Org." (the default) can be omitted as it is always created.

Teams

grafana_teams:
  - name: Team2
    org: Org2
    home_dashboard: "My Dashboard"
    members:
      - "User1"
      - "User2"
  - name: Team3
    org: Org3
    home_dashboard: "My second Dashboard"
    members:
      - "User3"

Users

grafana_users:
  - name: "Titi Tester"
    email: "ttester@example.com"
    login: tititester
    org: Org2
  - name: ""
    email: ""
    login: "tototester"
    org: Org3

Dashboards

grafana_dashboards:
  - org: Main Org.
    allowUiUpdates: True
    files:
      - "dashboard_1.json"
      - "dashboard_2.json"
      - "dashboard_3.json"
  - org: Org2
    files:
      - "dashboard_2.json"
  - org: Org3
    files:
      - "dashboard_3.json"

LDAP

grafana_ldap:
  servers:
    host: "myldap.com"
    port: 389
    start_tls: true
    bind_dn: "uid=server,ou=servers,dc=example,dc=com"
    bind_password: "XXXXXX"
    search_filter: "(uid=%s)"
    search_base_dns:
      - "dc=example,dc=com"
    group_search_filter: "(&(objectClass=posixGroup)(memberUid=%s))"
    group_search_base_dns:
      - "ou=groups,dc=example,dc=com"
    attributes:
      name: givenName
      surname: sn
      username: uid
      member_of: memberOf
      email: mail
  group_mappings:
    - name: Grafana admins for all organizations
      org_name: Org2 # Optional; use it if the name of your group is not the same as the name of the org in which you want to map this group
      groups:
        - group_dn: "cn=mygroup,ou=groups,dc=example,dc=com"
          org_role: Admin
          grafana_admin: true

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/haproxy/readme.md

This role will install haproxy from the official repository http://haproxy.debian.net.

Important

This role consider that haproxy will always serve https.

This role currently doesn't handle the management of the https certificates and private keys. HAproxy looks for files in /usr/local/etc/tls/haproxy: each files here must contain the private key, the certificate and the full chain (yes, everything in one file!).

HAproxy will automatically answer https requests with SNI with the correct certificate.

Mandatory variables

This role uses object to define configuration parameters.

The haproxy version is mandatory, but should already be defined in group_vars/all/software_versions, so except in very specific cases (like testing of new version), you don't need to override it:

haproxy_version: "2.8"

For the backends, you can define several of them this way:

haproxy_backend:
  - name: "identity-test"
    balance: "roundrobin" # this is the default and can be ommitted
    server:
      - name: "id-test-1" # if undefined, takes the value of the "fqdn"
        fqdn: "identity-test-node-1.cosium.com" # if undefined, takes the value of the "name""
        port: "8080"
      - name: "id-test-2"
        fqdn: "identity-test-node-2.cosium.com"
        port: "8080"
    proto: "h2"
    check: "check inter 2s fastinter 2s downinter 2s" # default is "check"
    options: "string containing the options for this server, this is optional"

Unfortunately, currently this role cannot find out which certificate are active and thus which ones should be seen by zabbix so you must list the https website with this list:

haproxy_https_monitoring:
  - identity.cosium.com

TLS profiles

Changelog of the TLS parameter:

The TLS configuration is generated with https://ssl-config.mozilla.org/#server=haproxy&version=2.8.

The default profile is "intermediate" (which supports TLS 1.2+) but you can switch it to modern (which supports TLS 1.3+) via this variable:

haproxy_tls_profile: "modern"

Optional variables

You can change the default backend of the frontend:

haproxy_frontend:
  default_backend: "error404"

This roles has a default maximum number of connection set to 20000 (the default in vanilla haproxy is 500). You can adjust this with this variable:

haproxy_maxconn: 20000

You can also adjust the timeout values of haproxy, which are explained here: - https://serverfault.com/questions/504308/by-what-criteria-do-you-tune-timeouts-in-ha-proxy-config / https://thehftguy.com/2016/05/22/configuring-timeouts-in-haproxy/

The default are:

haproxy_timeout_connect: "5s"
haproxy_timeout_client: "50s"
haproxy_timeout_server: "50s"

From haproxy documentation:

In TCP mode (and to a lesser extent, in HTTP mode), it is highly recommended that the client timeout remains equal to the server timeout in order to avoid complex situations to debug.

You can handle all robots.txt for all frontends via this variable:

haproxy_robotstxt: True

When set to true, the url /robots.txt will return:

User-agent: *
Disallow: /

Is it usefull when backends should not be indexed.

You can also use the robots.txt backend in only some cases, for this, just reference the robots_txt acl. Example:

acl something hdr(host) something.example.org
use_backend robotstxt if is_robots_txt something

The default acl robotstxt is in the standard frontend.

You can define several user lists, to have one authentication page (basic_auth):

haproxy_userlist:
  mailcatcher:
    - bolle_mailcatcher
    - user2

In this example: - mailcatcher is the userlist name which you can specify in your haproxy configuration - bolle_mailcatcher and user2 are the users

Passwords are automatically generated by the role and added to hashicorpvault. If you wish, you can define them in advance, respecting this name:

haproxy_basicauth_%USERNAME%_password # replace %USERNAME% with the username you've defined

Information: the password is added to the haproxy configuration in clear text to avoid this: http://docs.haproxy.org/2.9/configuration.html#3.4-user

Attention: Be aware that using encrypted passwords might cause significantly increased CPU usage, depending on the number of requests, and the algorithm used.
For any of the hashed variants, the password for each request must be processed through the chosen algorithm, before it can be compared to the value specified in the config file.
Most current algorithms are deliberately designed to be expensive to compute to achieve resistance against brute force attacks. They do not simply salt/hash the clear text password once, but thousands of times.
This can quickly become a major factor in HAProxy's overall CPU consumption!

Example of haproxy configuration:

haproxy_frontend_raw_config: |
  acl mailcatcher.bollebrands.com   hdr(host)       -i mailcatcher.bollebrands.com
  http-request auth             if mailcatcher.bollebrands.com !{ http_auth(mailcatcher) } !acme-challenge
  use_backend mailcatcher.bollebrands.com           if mailcatcher.bollebrands.com { http_auth_group(mailcatcher) }

Frontends

By default, this role create a frontend named "https" which has the following default configuration:

frontend https
    filter compression
    compression algo gzip
    compression type text/html text/plain text/xml text/css text/csv text/rtf text/richtext application/x-javascript application/javascript application/ecmascript application/rss+xml application/xml application/json application/wasm
    mode    http
    bind    :443,:::443 v6only ssl crt /usr/local/etc/tls/haproxy alpn h2,http/1.1
    bind    :80,:::80 v6only
    http-request set-header X-Forwarded-Proto https if { ssl_fc }
    redirect scheme https code 301 if !{ ssl_fc }
    option forwardfor
    # block access to any git paths
    acl git path,url_dec -m sub /.git
    use_backend error404 if git
    # block access to path begining by "/manager" except from 10.0.0.0/8
    acl internal_network src 10.0.0.0/8
    acl manager path,url_dec -m beg /manager
    use_backend error404 if manager !internal_network
    # redirect multiple traling slash to one slash
    acl has_multiple_slash path_reg /{2,}
    http-request set-path %[path,regsub(/+,/,g)] if has_multiple_slash

You can override the "bind" lines with this list:

haproxy_frontend:
  bind_list:
    - "127.0.0.1:443 ssl crt /usr/local/etc/tls/haproxy alpn h2,http/1.1"
    - "127.0.0.1:80"

You can add a raw configuration to the default frontend with this variable:

haproxy_frontend_raw_config: |
  acl admin path,url_dec -m beg /auth/admin
  use_backend error404 if admin !internal_network

You can deactivate the default frontend with this variable:

haproxy_default_frontend: false

You can also define any number of custom frontends with this object:

haproxy_frontend_list:
  - name: "something"
    mode: "http/tcp"
    bind_list:
      - "*:389"
      - "1.1.1.1:80"
    config: |
      free field to define the config of the frontend

This allows full control over custom frontends for haproxy.

letsencrypt automatic certificate generation

/!\ Lets encrypt automatic certificate generation can only be used on single node cluster (no keepalived).

For this to work correctly, you need to need to have all domains in the haproxy_https_monitoring variable. Each domains has its own certificate, alternative names are not supported.

To activate it, set this variable:

haproxy_letsencrypt: true

During certificate generation and renew, an http server is created to handle the challenge on port 8888. The server is created via a simple python command line and is only active during lets encrypt operations.

Coraza WAF installation

Enable coraza WAF like this:

haproxy_coraza: true

If the haproxy_waf_sample_percent variable is defined, Coraza will be enabled in the default frontend. However, if waf_sample_percent is defined within the haproxy_frontend_list, Coraza will be enabled in each frontend where waf_sample_percent is explicitly set.

IIS specific headers for https

The header Front-End-Https On is the equivalent to X-Forwarded-Proto https for IIS, to activate it, set this variable to true:

haproxy_iis: true

Issues with compression

Some mime types are problematic if compressed so compression was disabled for them, those are:

application/hal+json
application/prs.hal-forms+json

See the following tickets for more informations: - https://tracker.cosium.com/browse/OP-4916 - https://tracker.cosium.com/browse/OP-6532 - https://tracker.cosium.com/browse/IT-9018

haproxy and journald

In the systemd file for haproxy, the following line was added:

BindReadOnlyPaths=/dev/log:/var/lib/haproxy/dev/log

This line gives to haproxy the capability to send its log to journald. While this looks like a good idea, it is not.

With this lines, the logs are duplicated between /var/log/haproxy.log and journald. On production, this means an increase by a factor of 40 (!!!) of the amount of write to the disk.

With this line: 400KB/s, without: 10KB/s.

This is crazy... and remember that this is duplicate logs that we don't use since filebeat will read the /var/log/haproxy.log and ignore journald. This also shows the poor optimisation of journald vs simple log files but this is an other story.

Anyway, this role removes this line from the service file for all those reasons.

haproxy documentation

Official documentation can be found at https://www.haproxy.org/download/2.8/doc/configuration.txt (change the version number for the latest if needed).

Important part that we look for often is the one that details the "Session state at disconnection", which is essential to debug connectivity issues. Search for "8.5. Session state at disconnection" in the doc to find it immediately.

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/hashicorpvault/readme.md

Hashicorp Vault role

Every vault command or API call mentionned below assume you have previously exported VAULT_ADDR and VAULT_TOKEN environnement variables:

export VAULT_ADDR="..."
export VAULT_TOKEN="..."

or logged in via another auth method like LDAP:

vault token lookup 1>/dev/null || vault login -method=ldap username="..."

Variable reference

Mandatory variables

Variable Description Example value
hashicorpvault_version fixed hasicorpvault apt version 1.11.2-1
hashicorpvault_cluster_name name of the cluster, must match ansible group name in case of a cluster secret-management-staging

Default simple variables

Variable Description Default value
hashicorpvault_tls_enable Enable TLS. If enabled, certificates will be pulled from the url specified withhashicorpvault_tls_remote_cert. True
hashicorpvault_tls_remote_cert URL to pull the certificates from https://pub-auth-certificate.cosium.com
hashicorpvault_listen_address Specifies the address to bind to for listening 127.0.0.1
hashicorpvault_backup Enable backups. Local only if you don't define hashicorpvault_backup_sftp dict. True
hashicorpvault_backup_sftp Define this dict to enable remote backups. hashicorpvault_backup_sftp.server and hashicorpvault_backup_sftp.port Undefined

Deployment scenarios

non-HA with raft integrated storage backend

This is the simplest case. Launch this role, initialize, unseal Vault and you are good to go.

Note that the only way to guarantee consistent snapshots is to use raft snapshot, a backup solution will be implemented in a future PR

HA with raft storage backend

Install procedure

  1. all nodes must have their DNS set
  2. all nodes must have their certificates ready to be pulled from hashicorpvault_tls_remote_cert
  3. a reverse proxy acting as a load balancer in front of the cluster, you can use the haproxy role with a configuration like: ```yaml
  4. an inventory group, with a name equal to hashicorpvault_cluster_name with all nodes defined: properties [secret-management-staging] secret-management-staging-1 ansible_host=secret-management-staging-1.cosium.com secret-management-staging-2 ansible_host=secret-management-staging-2.cosium.com secret-management-staging-3 ansible_host=secret-management-staging-3.cosium.com
  5. Launch the role on all nodes to install and start Vault
  6. Initialize one node with vault operator init and unseal it with vault operator unseal. The unseal keys are valid for the whole cluster. The node will be the leader
  7. Unseal the other nodes with the unseal keys of the leader. When an uninitialized Vault server starts up it will attempt to join each potential leader that is defined, retrying until successful.

Full operations example and useful commands

root@secret-management-staging-1:~ # vault operator raft list-peers  
Node                           Address            State       Voter  
----                           -------            -----       -----  
secret-management-staging-1    10.12.1.8:8201     follower    true  
secret-management-staging-3    10.12.1.10:8201    follower    true  
secret-management-staging-2    10.12.1.9:8201     leader      true

To get a complete insight of the cluster status, use the API (endpoint was introduced in version 1.10, not installed at the time of testing so the output is a sample from the documentation):

root@secret-management-staging-1:~ # curl -s --header "X-Vault-Token: $VAULT_TOKEN" --request GET $VAULT_ADDR/v1/sys/ha-status
{
  "Nodes": [
    {
      "hostname": "node1",
      "api_address": "http://10.0.0.2:8200",
      "cluster_address": "https://10.0.0.2:8201",
      "active_node": true,
      "last_echo": null
    },
    {
      "hostname": "node2",
      "api_address": "http://10.0.0.3:8200",
      "cluster_address": "https://10.0.0.3:8201",
      "active_node": false,
      "last_echo": "2021-11-29T10:29:09.202235-05:00"
    },
    {
      "hostname": "node3",
      "api_address": "http://10.0.0.4:8200",
      "cluster_address": "https://10.0.0.4:8201",
      "active_node": false,
      "last_echo": "2021-11-29T10:29:07.402548-05:00"
    }
  ]
}

Upgrade procedure

non-HA installation

  1. Increment hashicorpvault_version to the desired version
  2. Run the role
  3. Unseal the vault

HA installation

First step is to increment hashicorpvault_version variable to the desired version for the group, then:

On each standy node

  1. Run the role on the standy node (use ansible-playbook option -l, --limit)
  2. Unseal the standby node
  3. Verify vault status shows correct Version, and HA Mode is standby
  4. Review the node's logs to ensure successful startup and unseal

At this point all standby nodes will be updated and ready to take over. The update will not be complete until one of the updated standby nodes takes over active duty. To do this:

On the active node

  1. Run the role on the remaining (active) node (use ansible-playbook option -l, --limit)
  2. Unseal the node
  3. Verify vault status shows correct Version and HA Mode is standby
  4. Review the node's logs to ensure successful startup and unseal

Internal update tasks will happen after one of the updated standby nodes takes over active duty.

Backup and restore procedure

Snapshot

The leader's raft storage is the source of truth for the cluster, so you must snapshot the leader's storage, always. 1. Connect yourself to a cluster node 2. Check that the current node is the leader using the API: bash root@secret-management-staging-1:~ # curl -s --header "X-Vault-Token: $VAULT_TOKEN" --request GET $VAULT_ADDR/v1/sys/leader | jq .is_self true or with bash root@secret-management-staging-1:~ # vault operator raft list-peers Node Address State Voter ---- ------- ----- ----- secret-management-staging-1 10.12.1.8:8201 leader true secret-management-staging-3 10.12.1.10:8201 follower true secret-management-staging-2 10.12.1.9:8201 follower true 3. Perform the snapshot from the leader with: bash root@secret-management-staging-1:~ # vault operator raft snapshot save /tmp/test.snap or from anywhere using the API, ensuring to query the leader bash root@secret-management-staging-2:~ # export LEADER_ADDR="https://secret-management-staging-1.cosium.com:8200" root@secret-management-staging-2:~ # curl -s --header "X-Vault-Token: $VAULT_TOKEN" --request GET $LEADER_ADDR/v1/sys/storage/raft/snapshot > test.snap It is pointless to compress the snapshot (with e.g. zstd) as the data is encrypted.

Restore

From a snapshot of the same cluster

Copy your vault raft snapshot file onto the leader node and run the below command, replacing the filename with that of your snapshot file.

vault operator raft snapshot restore test.snap

or from anywhere with:

export LEADER_ADDR="https://secret-management-staging-1.cosium.com:8200"
curl -s --header "X-Vault-Token: $VAULT_TOKEN" --data-binary @test.snap --request POST $LEADER_ADDR/v1/sys/storage/raft/snapshot

From a snapshot of a different cluster onto a new cluster

This procedure assumes keyholders are available with access to the unseal keys for each, that you have access to tokens with sufficient privileges for the origin cluster.

  1. Install the new vault cluster with the same version as the source cluster.
  2. Connect to each node but one and stop vault: bash systemctl stop vault.service
  3. You will need to initialise and unseal one node and log in with the new root token that was generated during its initialisation. Note that these will be temporary - the original/source unseal keys will be needed following restore.
  4. Restore the snapshot on the node you just unsealed. Note, the -force option is required here since the keys will not be consistent with the snapshot data as you will be restoring a snapshot from a different cluster: bash vault operator raft snapshot restore -force test.snap or with: bash curl -s --header "X-Vault-Token: $VAULT_TOKEN" --data-binary @test.snap --request POST $VAULT_ADDR/v1/sys/storage/raft/snapshot-force
  5. Unseal each node with the keys of the source cluster

From a snapshot of a different cluster onto an existing cluster

This procedure assumes keyholders are available with access to the unseal keys for each, that you have access to tokens with sufficient privileges for both clusters. This procedure is useful when bringing a staging cluster up with data from a prod cluster, to test an upgrade for example.

  1. Ensure source and destination cluster are on the same vault version
  2. Connect to each node, stop vault and remove everything under /opt/vault/data/raft with: bash systemctl stop vault.service rm -rf /opt/vault/data/raft/*
  3. You will need to initialise and unseal one node and log in with the new root token that was generated during its initialisation. Note that these will be temporary - the original/source unseal keys will be needed following restore.
  4. Restore the snapshot on the node you just unsealed. Note, the -force option is required here since the keys will not be consistent with the snapshot data as you will be restoring a snapshot from a different cluster: bash vault operator raft snapshot restore -force test.snap or with: bash curl -s --header "X-Vault-Token: $VAULT_TOKEN" --data-binary @test.snap --request POST $VAULT_ADDR/v1/sys/storage/raft/snapshot-force
  5. Unseal each node with the keys of the source cluster

Automated backups

This role will enable automated backups of the raft storage if hashicorpvault_backup is set to true. For automated backups to be effective, manual steps are neccessary: 1. Create a "snapshot" policy: bash vault policy write snapshot snapshot_policy.hcl with snapshot_policy.hcl being: hcl # file: snapshot_policy.hcl path "/sys/storage/raft/snapshot" { capabilities = ["read"] } 2. Then enable approle auth method, create a snapshot role with the policy "snapshot" and generate a secret for this role: bash vault auth enable approle vault write auth/approle/role/snapshot token_policies="snapshot" vault read auth/approle/role/snapshot/role-id vault write -f auth/approle/role/snapshot/secret-id 3. Copy your secret and role ids and permanently set them as environement variables in /root/.bash_profile as VAULT_ROLE_ID and VAULT_SECRET_ID for each node: bash # file: /root/.bash_profile export VAULT_ROLE_ID="..." export VAULT_SECRET_ID="..." To learn more about AppRole auth method and why it was chosen, see the Vault docs

Logging

By default, Hashicorp Vault does not enable logging. It can only be enabled via CLI or API once Vault is started and unsealed. Execute the following command to enable logging on the leader node:

vault audit enable syslog tag="vault" local="true"

Explanation: - Vault will log requests to /var/log/auth.log - tag="vault" enables easier parsing with e.g. elasticearch - local="true" means only the leader node will log requests, instead of replicating logs across the cluster. This avoid duplicates. If a raft election occurs, the new leader node will start logging.

Outage recovery

Just in case, here are some useful link in case of cluster outage (lost quorum...): * https://learn.hashicorp.com/tutorials/vault/raft-lost-quorum?in=vault/raft * https://www.vaultproject.io/docs/concepts/integrated-storage#outage-recovery

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/incus-client/readme.md

incus-client

Variable reference

Mandatory variables

| Variable | Description | Example value | | -------- | ----------- | ------------- | ------ | | incus_repository | name of the zabbly incus repo to use | lts-6.0 |

Token documentation

incus config trust add [client_name]

Create a token restricted to a project:

incus config trust add [client_name] --projects [project_name]

Copy the token, you will need it bellow.

incus remote add srv-384 srv-384.cosium.com

Then paste the token there.

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/incus/readme.md

incus role

Variable reference

Mandatory variables

| Variable | Description | Example value | | -------- | ----------- | ------------- | ------ | | incus_repository | name of the zabbly incus repo to use | lts-6.0 |

Optional variables

Variable Description Default value Example value
incus_version inucs specific version to pin, only useful in a cluster configuration ; a minor upgrade can block the cluster. Use --extra-vars "incus_update_now=true" to upgrade cluster members.
incus_trust_list list of servers name authrorized to have their certificate added in incus trust config None {{ backup_server_list + [ 'srv-379' ] }}
incus_zfs_backend create a zfs dataset for incus true false
incus_zfs_root_dataset the zfs dataset to create for incus nvme/incus tank/incus
incus_standard_profiles list of all default profiles Look in the defaults/main.yml file for the standard configuration see defaults/main.yml
incus_subuid_list grand access to specific uid for incus None ['5001']
incus_subgid_list grand access to specific gid for incus None ['5000']
incus_cluster_name Set this variable if you want the host to be part of an incus cluster. Must be defined in a group_vars and have the same name that this group_vars None th3_core
incus_cluster_main_name ansible_hostname of the incus cluster main server None srv-203
incus_cluster_init_member_config member_config list of the admin init preseed file. The list of the keys needed is cluster specific but the value is not necessarily the same on each member.
It can be obtained with the command incus query /1.0/cluster
None incus_cluster_init_member_config: |
entity: storage-pool
name: default
key: driver
value: zfs
incus_cluster_scheduler Per member optional cluster configuration to restrict automatic placement of instances https://linuxcontainers.org/incus/docs/main/explanation/clustering/#clustering-instance-placement None group
incus_ip the ip on which incus listen, without CIDR None 10.24.10.10
incus_bgp_asn Private AS number used by the incus bgp daemon. If not set incus bgp daemon will not be activated None 65024

incus_cluster tips

The easiest way to set incus_cluster_name incus_cluster_main_name and incus_ip if you are willing to use OVN on this cluster is by respectivly them to the corresponding vars in ovn: incus_cluster_name: {{ ovn_cluster_name }} incus_cluster_main_name: {{ ovn_cluster_main_name }} incus_ip: {{ ovn_ip }}

incus_subuid_list and incus_subgid_list: mount directory from host to container with the host uid/gid

Sometime, you need to give access to a directory to a container without remapping its uid/gid.

To do that, you must modify the system to grand access to specific uid/gid for incus and then modify the container to handle this specific case.

To grand access to specific uid/gid for incus set incus_subuid_list and incus_subgid_list on the host.

Then for the incus container, you must add the following setting:

echo -en "uid 5001 5001\ngid 5000 5000" | incus config set container_name raw.idmap -

A container restart is necessary to apply the change, it cannot be done live.

Then add the directory to the container storage, for instance:

devices:
  01OPTI01370:
    path: /srv/vaults/01OPTI01370
    source: /srv/vaults/01OPTI01370
    type: disk

You will then be able to access the directory inside the container with the same uid/gid as the host.

Misc

Incus logs

Log incus daemon:

/var/log/incus/incusd.log

Log container incus:

/var/log/incus/CONTAINER_NAME

Detection of unconfigured incus

The incus_yaml_unconfigured variable is defined in defaults/main.yml, it contains the unconfigured state of a incus daemon just after installation, you should not have to change this, the variable exists to handle future incus version that may have a different default configuration.

The incus_standalone_init_yaml variable is also defined in defaults/main.yml, it contains the initial configuration that must override the default above, you only need to change this if your default storage pool doesn't use zfs.

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/kibana/readme.md

This role is very basic and install kibana from the elastic repository.

Mandatory configuration

The only needed variable is the version of the repository, which also determine the version of kibana:

elastic_major_version: "7.x"

Optional configuration

kibana_extra_config:
  "key1": "value1"
  "xpack.reporting.csv.maxSizeByte": "1tb"

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/minio/readme.md

minio role

Install a single minio instance with: * a single directory as volume ("/srv/minio") * HAproxy as reverse-proxy

Server management

There are two ways to connect to the server: * the webui available on port 443 at minio_fqdn * install the cli tool minio client on your PC.

In both case you will need thte admin username is minioadmin and its password is in hashicorp vault minio_root_password.

Admin user

The admin username is minioadmin and the password is hashicorp vault minio_root_password.

Update

WARNING: This role automatically restart the minio systemd service after installing/updating the package. Therefore you should NOT use this role as it is to update a cluster, as cluster nodes have to be restarted together using the command mc admin service restart.

To update it, please pass --extra-vars "{ 'minio_update_now': true }" as parameter

Variable reference

Mandatory variables

Variable Description Example value
minio_auth_type minio authentification type ldap or local

Optional variables

Variable Description Default value
minio_haproxy install a HAproxy with a TLS cert and enable the webui true
minio_fqdn minio fqdn (only necessary when minio_haproxy is enable center-storage-prod-global-1.int.cosium.center
minio_version minio version latest
minio_buckets list of minio buckets to create none
minio_users list of minio users to create when using local minio_auth_type none
minio_bucket_policies list of dictionnaries of per bucket policies none
minio_anonymous_policies list of dictionnaries of anonymous policies none
minio_global_policies list of dictionnaries of global policies none

Complexe variables examples

minio_bucket_policies:
  - bucket: center-http-product-pictures-demo-1 # Name of the bucket to apply the policy to
    permissions: read-write                     # permissions given by this policy; supported values are `read-write` and `read-only`
    users:                                      # List of users whom you want the policy to apply to
      - center-http-product-pictures-demo-1
    groups:
      - devop                                   # List of groups whom you want the policy to apply to. Local groups

If it does not exist already a policy matching the bucket name and the permission will be created by the role. The policy will be named: {{ bucket }}_{{ permissions }}

minio_global_policies:
  - policy: center-http-product-pictures-demo-1  # Name of the policy
    users:                                       # List of users whom you want the policy to apply to
      - adm-martin
      - jean
    groups:                                      # List of groups whom you want the policy to apply to
      - "cn=minio-admin,ou=system,ou=groups,dc=cosium,dc=com"

The policy must already exist in minio. By default, the next five policies already exist in minio: * consoleAdmin * diagnostics * readonly * readwrite * writeonly

minio_anonymous_policies:
  - path: "myvault/dir1"    # bucket name or folder/file path in a bucket
    permission: "download"  # Allowed policies are: private, public, download, upload.

By default all minio paths have anonymous access set to private. To reset a policy you can either set the permission to private or in you ansible config or run the following config on the minio server mcli anonymous set private minio_on_localhost/{{ path }}

AUTH_TYPE

Minio does not support using multiple auth time at the same type, therefore Minio needs to be restarted at each auth_type configuration change. This even includes ldap parameters modifications.

Apply change via restart

By default, this role doesn't restart the minio service to avoid a disruption. You can override this by setting this variable:

minio_restart_on_auth_type_change: true

You can also add it on the command line via

--extra-vars '{ "minio_restart_on_auth_type_change" : true }'

LOCAL

This role handle the creation of local users account but not of local groups. If needed we should be able to add it pretty easily by copiyng the tasks used to create local users.

LDAP

Users and groups have to be created in the LDAP prior to the role execution. User password must be added in Hashicorp vault hosts_var of the ansible_hostname. The password key must be match the username and be prefixed by minio_ and suffixed by ldappass App user account must be created in ou=minio,ou=bot,ou=people,dc=cosium,dc=com Full DN of LDAP objects must be provided to minio. If this auth_type is used, the ldap group minio-admin will always be added to minio with consoleAdmin rights.

Monitoring zabbix

Current configuration on zabbix server only gathers metrics for single-node deployment and it has only been tested with a single drive. In case of cluster deployment create the items and discover rules needed for cluster monitoring. If deploying a single node with multiple drives, check that the latency item prototype creates one item for each drive/api couple.

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/minio_client/readme.md

Minio client role

This role will install minio client latest version from the official minio website.

Difference between mcli and mc

Discussion on GitHub : https://github.com/minio/minio/discussions/16808

They are the same thing. Some users like to rename mc to mcli locally if they use 'Midnight Commander' (mc) tool in their machines.
On Debian based systems mc in PATH does conflict with the Debian package mc.
Having both /usr/bin/mc vs /usr/local/bin/mc in the PATH is calling for trouble.
Hence for Debian systems the mc package is shipping /usr/local/bin/mcli
https://dl.min.io/client/mc/release/linux-amd64/mc.deb
FYI mcli is close but separated to mmcli from the modemmanager package.

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/netbox/readme.md

NetBox role

Description

This role installs NetBox 4.0.3 or greater. The following links were used to build this role :

Mandatory variables

Variable Description Type Sample value
netbox_version netbox version to use https://github.com/netbox-community/netbox/releases string (github tag) v4.0.3
netbox_superuser_email superuser email email noc@cosium.com
netbox_fqdn servername for httpd fqdn ipam-2.cosium.com

Optional variables

Variable Default Description
netbox_changelog_days_retention 0 Number of days of changelog to keep in database, 0 = unlimited.

Configuration

The configuration must be given as key: value pairs like the following:

netbox_config:
  ALLOWED_HOSTS:
    - "{{ ansible_hostname }}"
    - localhost
    - 127.0.0.1
  TIME_ZONE: "Europe/Paris"
  SECRET_KEY: "{{ netbox_secret_key }}"

The default provided configuration is sufficient for a working install.

Additionnal packages

Other Python packages can be installed using local_requirements.txt, this is useful to install packages such as NAPALM or plugins:

netbox_local_requirements:
  - django-auth-ldap
  - napalm

Custom scripts

NetBox can be extended with custom scripts/reports. Documentation to create such scripts is located here: * https://docs.netbox.dev/en/stable/customization/reports/ * https://docs.netbox.dev/en/stable/customization/custom-scripts/

To install a custom script, you need to define the following list:

netbox_custom_scripts:
  - name: add_device_type_components.py
  - name: missing_device_type_components.py
    dest: reports

The script must exist in the files directory of this role.

dest is optional as most of the scripts go to /opt/netbox/netbox/scripts/

LDAP configuration

The following variable are required for LDAP configuration (Queries use python functions LDAPSearch() and LDAPGroupQuery() if placeholders, arguments or conditions must be passed):

netbox_ldap_user_search: LDAPSearch("dc=cosium,dc=com", ldap.SCOPE_SUBTREE, "(uid=%(user)s)")
netbox_ldap_group_search: LDAPSearch("ou=divisions,ou=groups,dc=cosium,dc=com", ldap.SCOPE_SUBTREE, "(objectClass=posixGroup)")
netbox_ldap_require_group: LDAPGroupQuery("cn=Infrastructure,ou=divisions,ou=groups,dc=cosium,dc=com")|LDAPGroupQuery("cn=sysop,ou=system,ou=groups,dc=cosium,dc=com")|LDAPGroupQuery("cn=outsourcing,ou=divisions,ou=groups,dc=cosium,dc=com")
netbox_ldap_group_assignation:
  is_active: (LDAPGroupQuery("cn=sysop,ou=system,ou=groups,dc=cosium,dc=com")|LDAPGroupQuery("cn=outsourcing,ou=divisions,ou=groups,dc=cosium,dc=com"))
  is_staff: (LDAPGroupQuery("cn=sysop,ou=system,ou=groups,dc=cosium,dc=com")|LDAPGroupQuery("cn=outsourcing,ou=divisions,ou=groups,dc=cosium,dc=com"))
  is_superuser: "\"cn=sysop,ou=system,ou=groups,dc=cosium,dc=com\""

Update

To perform an update, change the variable netbox_version to the new version, then run this role.

Always review the release notes

NetBox can generally be upgraded directly to any newer release with no interim steps, with the one exception being incrementing major versions. This can be done only from the most recent minor release of the major version.

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/nodejs/readme.md

Description

This role will install nodejs from the official nodejs Debian/Ubuntu repository.

Required variables

Those variables have no default value by design and thus must be specified:

Variable Description Sample value
nodejs_version The nodejs version, it will be pinned so that it will override the default system version in case it is bellow 12

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/openssh-server/readme.md

Optional variables

Functional variables:

Name Description Example value
sshd_Port_list list of ports to listen to, for security reason, it is advised to use a privileged port (eg < 1024) to avoid an unprivileged process to take over the sshd port, the default is 22 [ 122, 1022 ]
sshd_ListenAddress_list list of network addresses to listen to, the default is to listen to all addresses (IPv4 and IPv6) [ '1.2.3.4', '5.6.7.8' ]
sshd_sssd_ldap use sssd to retreive user pubkey from ldap. Require sssd roles, set to false if sssd is not installed or not in ldap mode True

Access control variables:

Name Description Default value
sshd_AllowGroups_list list of groups that are allowed to connect using ssh, this is the new parameter that must be used [ 'root', 'op', 'sysop' ] for containers and [ 'root', 'op', 'sysop', 'localadm' ] for VM and physical machines

Security

This role have been created so that it passes several security audit tests. As a result, it define a set of secure parameters for: - Ciphers - MACs - KexAlgorithms (this changes between versions) - TCPKeepAlive - ClientAliveCountMax - ClientAliveInterval

To easily change the Ciphers, MACs and KexAlgorithms if a vulnerabilty is found, those are defined in the defaults/main.yml file. Never change them via a local variable.

You can see the supported ciphers, macs, kex, etc via ssh -Q query_option, use man ssh for usage.

Handling of revoked keys

As an additional security measure, this role handle the RevokedKeys option. This can come in handy if a key is compromised and you want to be sure that it will never work. You can also enfore key rotation this way.

To use this feature, define a list of keys via this variable:

sshd_RevokedKeys_list:
  - key1
  - key2

Allow some groups to only uses sftp

To allow some groups to connect to the host only via sftp, you must set this variable to true:

sshd_sftp_enabled: True

This will change the sftp subsystem from /usr/lib/openssh/sftp-server to internal-sftp, which is necessary to achieve the required configuration.

SFTP: Define accesses

The chroot directory must be only writable by root, this is mandatory else the connection will be refused. This is for security purpose to avoid privilege escalation.

Define the variable sshd_sftp_group_access with a list of groups and the directory for their chroot:

sshd_sftp_group_access:
  - name: "somegroup"
    ChrootDirectory: "/some/path"
  - name: "someothergroup"
    ChrootDirectory: "/some/other/path"

This will create those blocks in the /etc/ssh/sshd_config:

# BEGIN sftp configuration for group somegroup
Match group somegroup
    ForceCommand internal-sftp
    ChrootDirectory /some/path
    PermitTunnel no
    AllowAgentForwarding no
    AllowTcpForwarding no
    X11Forwarding no
    PermitTTY no
# END sftp configuration for group somegroup
# BEGIN sftp configuration for group someothergroup
Match group somegroup
    ForceCommand internal-sftp
    ChrootDirectory /some/other/path
    PermitTunnel no
    AllowAgentForwarding no
    AllowTcpForwarding no
    X11Forwarding no
    PermitTTY no
# END sftp configuration for group someothergroup

Creating a ~/.ssh/authorized_keys file will work correctly with this system and correctly allow the more secure login with public/private key pair.

You still need to allow the groups that will use sftp to connect to the server via the sshd_AllowGroups_list variable.

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/openvas/readme.md

Openvas role

This role will deploy a GVM (Greenbone Vulnerability Management) docker image with a persistent volume. The docker image is hosted on docker hub. The docker container uses the host's mta (exim4) to relay mail alerts.

Prerequisites

Mandatory variables

variable description
openvas_domain_name openvas fqdn
openvas_admin_password password for the local superadmin user

Optional variables

variable default description
openvas_feed_refresh_hour 6 The container will restart everyday at specified hour to refresh all feeds (Vulnerabilities, NVTs...)
openvas_version latest Specific version (Docker Hub tag)

iptables

Docker internal rules

Docker sets its own iptables rules when starting. This has no impact for custom iptables rules on boot, docker.service starts after filtering.service. However, if you restart filtering.service, you must restart docker.service

Custom rule for mta

You need to set a custom iptables rule if you want openvas container to be able to send emails:

firewall_iptables_config: |
  ...
  -A INPUT -i docker0 -p tcp -m tcp --dport 25 -j ACCEPT
  ...

Links

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/openvpn/readme.md

OpenVPN server role

Mandatory parameters

Config

openvpn_server: "10.185.16.0 255.255.255.0"
openvpn_push:
  - "route 10.185.15.0 255.255.255.0"
  - "dhcp-option DNS 10.12.1.2"

Certificates

You need to define the certificates that will be used by the server, specificaly you need those variables: 1. openvpn_tls_ca containing the CA that signed all certificates 2. openvpn_tls_cert containing the server's certificate 3. openvpn_tls_key containing the server's private key, this variable must be kept in a vault!

To define them, just use this syntax:

openvpn_tls_ca: |
  -----BEGIN CERTIFICATE-----
  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  ...
  yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
  -----END CERTIFICATE-----

By default, they will be saved to the folder /etc/openvpn/ssl, you can change this folder by setting the variable openvpn_ssl_root to whatever you want, you can also change the location of any individual file by changing the following variables, bellow are the defaults for reference:

openvpn_ssl_root: /etc/openvpn/ssl
openvpn_ca: "{{ openvpn_ssl_root }}/ca.crt"
openvpn_crl: "{{ openvpn_ssl_root }}/crl.pem"
openvpn_cert: "{{ openvpn_ssl_root }}/{{ ansible_hostname }}.crt"
openvpn_key: "{{ openvpn_ssl_root }}/{{ ansible_hostname }}.key"
openvpn_dh: "{{ openvpn_ssl_root }}/dh2048.pem"

Please note that the openvpn_dh parameter is automatically generated by this role if it doesn't exists.

Optional parameters

OpenVPN version

By default, this role will install the openvpn package from your distribution repository.

You can override this by setting the variable openvpn_version which is by default undefined. This will activate the official OpenVPN repository. The process is described here: https://community.openvpn.net/openvpn/wiki/OpenvpnSoftwareRepos .

The possible values are available at the previous link, currently they are stable, testing, release/2.3, release/2.4 and release/2.5. Most of the time, you would want to stick to stable, read carefully the official wiki if you want to change that because for example sticking to version 2.5 means OpenVPN 2.5 releases, including alphas/betas/RCs.

openvpn_version: "stable"

default config

Bellow are the configuration options, with their default parameters that you can change if needed:

openvpn_port: 443
openvpn_proto: tcp6
openvpn_max_clients: 10
openvpn_client2client: False
openvpn_ccd: False

Scripts when a user connect or disconnect itself

To activate the scripts connect.sh and disconnect.sh when a user connect itself and disconnect itself, you will need to set the following variables:

openvpn_client_scripts: True
openvpn_script_dbsrv: srv-xxx
openvpn_script_dbport: 5432
openvpn_script_dbuser: user
openvpn_script_db: openvpn
openvpn_script_dbpassword: pass

This will also install the geoip-bin package for the /usr/bin/geoiplookup and the /usr/bin/geoiplookup6 commands and will also download the latest databases from https://dev.maxmind.com/geoip/legacy/geolite/ .

additional check script at connect time

An additonal script can be added before the validation of the user's password. Currently the script validate-username-common_name.sh checks that the certificate and the username are the same, you can activate it with this variable:

openvpn_auth_user_pass_verify: "validate-username-common_name.sh"

Force comp-lzo on version >= 2.5

On previous OpenVPN versions, the comp-lzo parameter was always active.

Since version 2.5, it is deprecated and should not be used anymore but the problem is when you need to support old configurations already in the wild. For this particular case, you can force the support of comp-lzo using this parameter even on OpenVPN 2.5+:

openvpn_force_insecure_compression: True

LDAP auth

First, it needs to be activated with this variable:

openvpn_ldap_auth: True

You then need to define an LDAP server URL:

openvpn_ldap_URL: "ldap://ldap2.cosium.com"

For the rest, the following variables are set, you can change them if needed:

# location of the CA for the LDAP secure connection, this is not the same as the OpenVPN CA
openvpn_ldap_TLSCACertFile: "/usr/local/share/ca-certificates/CosiumRootCA.crt"
# Base DN to find users
openvpn_ldap_BaseDN: "ou=people,dc=cosium,dc=com"
# Search filter for users
openvpn_ldap_SearchFilter: "(&(uid=%u)(CosStatus=active)(RemoteAccess=OpenVPN:*))"

Please look at the auth-ldap.conf template for more informations.

Settings not handled by this role

This role does not yet handle all OpenVPN settings, specifically: - when the ccd option is activated, a file must exist in the folder /etc/openvpn/topology-subnet for every users else they will not be allowed to connect - when easy-rsa is used on the server as the certificate authority, all certificates and privates keys are on the openvpn server which is not secure, those files are not handled by this role

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/ovn/readme.md

OVN role

This is the description of the role OVN.

Variable reference

Mandatory variables

Variable Description Type of variable Example value
ovn_cluster_name name of the incus cluster. Must be defined in a group_vars and have the same name that this group_var str th3_core
ovn_cluster_main_name ansible_hostname of the central DB main server str srv-203
ovn_ip the ip on which ovn daemons listen on, without CIDR str 10.24.10.10
ovn_central_servers list of servers (server name must match their ansible inventory name) hosting the ovn db list[str] ["srv-382", "srv-383"]
ovn_ic_db_servers list of servers (server name must match their ansible inventory name) hosting the ovn ic db list[str] ["srv-382", "srv-383"]

Optional variables

Variable Description Type of variable Default value Example value
ovn_host is this host an ovn host bool true false
ovn_ic_name name of the ovn ic this cluster is a part of str None incus_ic_cluster
ovn_ic_cluster_main_name ansible_hostname of the OVN IC DB main server str None srv-383
ovn_ic is this host an ovn ic host bool true false
ovn_ssl enable SSL connection; has to be set at the cluster level bool false true

Handlers

In this role handlers order is very important, do not change it without reasons.

Ansible doc reminder: Handlers are executed in the order they are defined in the handlers section (https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_handlers.html#notifying-handlers)

CLI tools

ovn-nbctl OVN northbound DB management utility ovn-sbctl OVN southbound DB management utility This cli tools manage only the DB content to manage the DB cluster you have to use ovs-appctl. By exemple for OVN SB DB:

ovs-appctl -t /var/run/ovn/ovnsb_db.ctl list-commands

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/pg-wal-pull/readme.md

Prerequisites

The postgresql servers must have a replication slot dedicated to each server that will save the WAL files.

Configuration

You must define at least one upstream server like this:

pg_wal_pull_upstream:
  - PG_HOST: "center-db-cluster-1-node-1"
    PG_VERSION: 14
    PG_USERNAME: "pitr-pa7"
    PG_PASSWORD: "{{ global_center_pitr_password }}"
    PG_SLOT: "pitr_pa7"
    PG_PORT: 5432               # optional, default is 5432
    WAL_DIR: "/srv/wal/somewhere"           # optional local receive directory, default is /srv/wal/PG_HOST
    WAL_RETENTION_IN_DAYS: 14           # optional, default is 14 days

The WAL_RETENTION_IN_DAYS define how much time the WAL will be kept, it must be similar to the retention of the last file system snapshot of the actual PGDATA of the postgresql cluster for the PITR to work for this long.

Optional variables

Variable Description Type of variable Sample value
pg_wal_pull_service_user systemd user string nobody
pg_wal_pull_service_group systemd group string nogroup

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/pgbadger/readme.md

pgbadger

By default, this role just installs the pgbadger binary via the official postgresql Debian repository.

You can also automate an incremental report by setting this variable to true:

pgbadger_auto_run: true

You can expose the logs and reports via HTTP by setting this variable to true:

pgbadger_web_access: true

If you set pgbadger_web_access to true, you can also add custom HTTPD configurations in multiline format by setting this variable:

pgbadger_httpd_raw_config: |
  <Location />
      IndexIgnore *.log pgbadger_auto_report
      IndexOptions +FancyIndexing
      AuthBasicProvider       ldap
      AuthType                Basic
      AuthName                "Cosium authentication"
      AuthLDAPURL             "ldaps://ldapx.cosium.com ldap.cosium.com/dc=cosium,dc=com?uid?sub?(&(objectClass=CosAccount)(CosStatus=active))"
      AuthLDAPBindDN          "uid={{ ansible_hostname }},ou=servers,dc=cosium,dc=com"
      AuthLDAPBindPassword    "{{ ldappass }}"
      AuthLDAPGroupAttribute          memberUid
      AuthLDAPGroupAttributeIsDN      off
      Require ldap-group cn=sysop,ou=system,ou=groups,dc=cosium,dc=com
      Require ldap-group cn=Infrastructure,ou=divisions,ou=groups,dc=cosium,dc=com
      Require ldap-group cn=prodaccess,ou=system,ou=groups,dc=cosium,dc=com
  </Location>

If set to true, this role will look for the following variables as default for the input directory (where the csv logs are):

pgbadger_auto_analyze_directory_in: "{{ pg_log_directory | default(patroni_pg_log_directory, true) | default('/var/log/postgresql') }}"

The variable pgbadger_auto_analyze_directory_in is set using the command psql -Atc SHOW log_directory directly on the local database.

For the output directory :

pgbadger_auto_analyze_directory_out: "{{ pgbadger_auto_analyze_directory_in }}/pgbadger_auto_report"

Optional variables for automatic mode

Variable Description Type of variable Default value
pgbadger_reports_retention_weeks The number of weeks to retain the generated reports integer 4
pgbadger_auto_hour_range The cron expression used to run the crontab for the hour' part |string|9-19`
pgbadger_web_access Whether to install httpd on the host to expose the logs via HTTP boolean false
pgbadger_httpd_raw_config Allows adding custom HTTPD configurations in multiline format. Requires pgbadger_web_access. string ``

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/pgbouncer/readme.md

pgbouncer role

define admin password

The admin user is "postgres" and the admin password is automatically generated and stored in hashicorp vault.

You can also change the admin user from postgres to something else by changing this variable:

pgbouncer_admin_users: postgres
pgbouncer_stats_users: stats
pgbouncer_stats_users_pwd: secret

define databases

Use the following variable to define a list of databases:

pgbouncer_databases:
  - dbname_from_pgbouncer1 = host=pg_host1 port=pg_port1 dbname=pg_dbname1
  - dbname_from_pgbouncer2 = host=pg_host2 port=pg_port2 dbname=pg_dbname2
  - TEST1 = host=srv-xxx user=dbuser password=dbpass
  - FOO = host=srv-yyy port=5433 user=dbuser password=dbpass
  ...

Look at the official documentation for more syntax details: https://pgbouncer.github.io/config.html#section-databases

define listening address and port

Bellow are the default values:

pgbouncer_listen_addr: "127.0.0.1,::1"

You can specify multiple addresses like this:

pgbouncer_listen_addr: "10.185.14.1,10.12.35.11"

auth settings

pgbouncer_auth_type: "scram-sha-256"

connection settings

pgbouncer_pool_mode: session
pgbouncer_max_client_conn: 100
pgbouncer_default_pool_size: 20

define users in userlist.txt

Define the users like this, if "username" is not defined, it will use the key as username

pgbouncer_userlist:
  user1:
    username: user1
    password: pass1
  user2:
    password: pass2 # the username will be user2

pg_hba.conf style config

To enable pg_hba.conf style config, define this variable like this:

pgbouncer_hba_config:
  key1:
    type: host # if undefined, will use "host"
    database: db1 # if undefined, will use "key1"
    user: user1 # if undefined, will use "key1"
    address: 1.2.3.4 # if undefined, will use "127.0.0.1"
    method: scram-sha-256 # if undefined, will use "scram-sha-256"
    description: something # optional
  key2:
    type: host
    database: db2
    user: user2
    address: 5.6.7.8
    method: scram-sha-256
    description: something
  some_db_name:

Optional additional parameters

You can add any additional parameters by using a dictionary like that:

pgbouncer_additional_config:
  - { 'name' : 'param1' , 'value' : 'value1' }
  - { 'name' : 'param2' , 'value' : 'value2' }

This will add 2 lines at the end of the pgbouncer.ini like that:

param1 = value1
param2 = value2

A typical parameter that we often want is this one:

pgbouncer_additional_config:
  - { 'name' : 'ignore_startup_parameters' , 'value' : 'extra_float_digits' }

This will add the following line:

ignore_startup_parameters = extra_float_digits

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/postgres-explain-visualizer/readme.md

postgres-explain-visualizer role

This role installs pev2 (PostgreSQL Explain Visualizer) alongside a flask app to store and share EXPLAIN ANALYSE results.

Gunicorn is also installed to serve the flask app and make it production ready.

Variable reference

Mandatory variables

Variable Description Example value
pev_fqdn The host's fqdn explain.cosium.com

Upgrade

Launch this role with -e pev_update_now=true or -e global_update_now=true

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/postgres/readme.md

Postgresql role

Mandatory parameter

You need to define the postgresql version that you want to install:

pg_version: 17

Important note about ZFS

This role does some optimization if it determines that the filesystem containing the cluster is ZFS: - For postgres:

full_page_writes = off
wal_compression = off
wal_recycle = off
wal_init_zero = off
logbias: throughput
recordsize: 16K

Important about the speed optimization that comes from synchronous_commit = off

By default, this role will set the postgres parameter synchronous_commit = off.

This means that postgresql will tell the system that a commit is done before it is persisted to disk, speeding a great deal the write operations. The commit happens at worst 600ms after that point, and thus allow the grouping of many commit operations in one sync.

This also means that in case of a crash, you can lose up to 600ms worth of commits. If this is unacceptable, use this variable to change the behavior:

pg_synchronous_commit: "on"

This will force a sync after every commit, which is the default postgresql behavior.

Optional parameters

Default encoding

By default, the encoding is set to en_US.UTF-8, you can change it by setting this variable:

pg_default_encoding: "en_US.UTF-8"

Change port and cluster name

Previously those parameters were mandatory, we now define those as the default, which you can change:

pg_port: 5432
pg_cluster_name: main

Listen to a different IP address than localhost

By default, this role makes postgres only listen to localhost with this variable:

pg_listen_addresses: localhost

If you need remote access, either enter a list of addresses to listen to:

pg_listen_addresses: "localhost,a.b.c.d"

Or make postgresql listen on all addresses (limit this to internal servers only):

pg_listen_addresses: "*"

Deactivate ssl

Set this variable to `false to deactivate ssl with the snakeoil certificate:

pg_ssl: False

Main config

The following variables can be defined to override the default from postgres, the ansible variable are the same as the postgres variables, only idfference is the suffix "pg_" in front: - pg_autovacuum_freeze_max_age - pg_autovacuum_max_workers - pg_autovacuum_vacuum_scale_factor - pg_autovacuum_work_mem - pg_autovacuum_vacuum_cost_delay - pg_autovacuum_vacuum_cost_limit - pg_checkpoint_timeout - pg_effective_cache_size - pg_huge_pages - pg_maintenance_work_mem - pg_max_connections - pg_shared_buffers - pg_timezone - pg_work_mem - pg_max_wal_size - pg_min_wal_size - pg_idle_in_transaction_session_timeout (pg 9.6+ required) - pg_max_parallel_workers_per_gather (pg 9.6+ required) - pg_max_worker_processes (pg 9.6+ required)

Note that the default pg_shared_buffers is set to 128MB in this role, which should be the default since postgres 9.3 (up to postgres 12) but is strangely set to 8MB on Debian.

Special note about the fsync parameter

The fsync parameter is special because if set to off, postgres runs in insecure mode that will generate database corruption in case of postgres or OS crash. So this parameter should always remains untouched to the default and safe value of on.

But it can be very interesting to deactivate sync BEFORE putting the cluster into production, for example to load a database dump more quickly on a new cluster.

The best way to not forget this parameter is to not commit it to git and use an extra-vars to temporary change it instead:

ansible-playbook someplaybook --limit somehost --extra-vars "{ 'pg_fsync' : false }"

If you really know what you are doing, you can instead change the default variable which is:

pg_fsync: True

Set it to False to deactivate fsync but don't forget to remove this setting before putting the cluster in production.

When you switch fsync back to on, you must ensure that all data have been written to the system, follow instructions on the official documentation for the fsync parameter to do the right thing: https://www.postgresql.org/docs/current/runtime-config-wal.html

SSD config

A default ssd config can be activated by setting the following variable to true:

pg_ssd: True

The config that will be added is:

seq_page_cost = 1.0
random_page_cost = {{ pg_random_page_cost }}
effective_io_concurrency = '{{ pg_effective_io_concurrency }}'

You can adjust the pg_random_page_cost and pg_effective_io_concurrency if you want, the default are:

pg_random_page_cost: 1.2
pg_effective_io_concurrency: 20

Logging

By default no logging is active, you can activate it by setting pg_logging: True:

pg_logging: True

You can also change the log directory, bellow is the default:

pg_log_directory: "/var/log/postgresql"

Currently this will activate a basic logging configuration which logs everything, you can look at the template to see exactly what it does.

The default suffix for log files is:

pg_log_filename_suffix: '%a_%H'

This will keep 1 week worth of logs (%a is the day of the week: "Mon", "Tue", etc). You can change this value if needed, for example if you want to only keep 1 day worth of logs:

pg_log_filename_suffix: '%H'

The default parameter is to log everything (value = 0), you can change that by setting a value in milliseconds on this variable, if you do so, only query that takes longer than that will be logged, this has a positive performance impact:

pg_log_min_duration_statement: '0'

Archive mode and replication as master

You can activate either the replication or archive+replication.

To activate only the replication, which allow the creation of a replica and streaming replication, use this variable:

pg_replication: True

You should also create some physical replication slots with this variable:

pg_replication_slot_list:
  - some_slot
  - an_other_slot

If you need to archive the WAL, you need to prepare in advance a server where you will send the WAL files. Set up an account on the remote server and copy the postgres ssh pubkey from the origin server to the archive one. Make sure that the ssh connection is working without any prompt, else the archive command will fail.

You then need to set pg_archive_command:

pg_archive_command: 'chmod 640 %p && rsync -e "ssh -o StrictHostKeyChecking=yes -o BatchMode=yes" -a %p {{ ansible_hostname }}@srv-227.cosium.com:/srv/pg/center/pitr/{{ ansible_hostname }}/{{ pg_port }}/wal/%f'

The pg_archive_command example above is a typical example. You need to set the ssh option so that the rsync command will fail immediately if for any reason the authentication via pubkey doesn't work, else it may get stuck with a password prompt.

Keep in mind that setting the archive mode will also activate the replication mode because it is needed to have correct WAL files.

Replication as slave

To create a replication slot on the slave you must use this variable:

pg_replication_slot_list_replica:
  - some_slot
  - an_other_slot

If you want to make sure some replication slots are ABSENT, you can use this list:

pg_replication_slot_to_remove:
  - some_slot
  - an_other_slot

Disable backup service

This script was created to put the postgresql in backup mode to ensure coherency in the filesystem layer during snapshot. But this was a misunderstanding and this is in fact not useful at all with a ZFS backed database. It's still there for now and can be activated by setting this variable but may be removed in the future:

pg_backup_service: True

user handling

The password encryption use scram-sha-256 by default if md5 is needed set the following "pg_md5" var to true.

It's important to set the method of authentifcation in pg_hba to md5 after this.

Define any number of user to create them like this (attrib are the rights of the user), look at: * https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_user_module.html * https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_membership_module.html * https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_privs_module.html

for all possible values, all values are optional:

pg_users:
  - name: alfred
    password: ALFRED
    attrib: LOGIN,CREATEDB
  - name: boris
    password: BORIS
    attrib: LOGIN
  - name: clair
    password: CLAIR
    attrib: LOGIN
    db: somedb
    conn_limit: 10
    groups: somegroup
    priv: somepriv
  role-that-will-be-used-as-a-group:
    attrib: NOLOGIN

The password can be generated automatically by setting it to "auto":

pg_users:
  - name: "matrix_synapse"
    password: "auto"

You can find the password in hashicorpvault in this way: postgres_user_{{ user.name }}_password

database handling

Define databases that you want to create like this:

pg_databases:
  - name: alpha
    owner: alfred
  - name: beta
    owner: boris
  - name: gamma
    owner: clair
    conn_limit: 50 # optional, the default is 80
    extension_list: [ 'fuzzystrmatch' ] # optional, remember that this will be added to the default extensions from the pg_extensions list if defined

This will create each database with the correct owner and make sure it stays like that on successive ansible runs.

shared librairies handling

Define shared librairies that you want to to preload like this: It requires postgres to restart; however, it will fail if the library is not yet installed.

pg_shared_preload_libraries:
  - timescaledb

pg_hba.conf

pg_hba_config:
  - user: foo
    type: host
    database: all
    address: 10.12.0.0/16
    method: "scram-sha-256"
  - user: bar
    type: hostssl
    database: mydb
    address: 10.12.1.1/32
    method: "scram-sha-256"

With the previous values, the result in the pg_hba.conf file will look like this:

host all foo 10.12.0.0/16 scram-sha-256 # description
hostssl mydb bar 10.12.1.1/32 scram-sha-256 # hello world
local all all scram-sha-256

Which you can change by setting this variable:

pg_local_auth_method: "peer" # you can use any value accepted by postgres, see https://www.postgresql.org/docs/current/auth-pg-hba-conf.html

Extensions

You can add any number of extension to the template1 database. This database is used to create all other databases by default, so any database created will have the same extensions.

To define the extensions you need, simply create this list:

pg_extensions:
  - pg_trgm
  - btree_gist

You can also define extensions per database, see database handling. Per database is useful because it can add extension to an existing database while pg_extensions only apply to databases created latter.

setting up a replica

To set up a replica, you must first make sure that all the pg_ variables from the master are used as well for the future replica (set them up in a group_vars or make a symlink between the master and the replica).

Then install a new standalone server without specifying a pg_replication_role variable.

After that, you need to connect yourself to the future replica server and: 1. stop postgresql 2. delete the postgres data directory 3. initiate the slave with pg_basebackup, the command will look like pg_basebackup --write-recovery-conf --checkpoint=fast --label="IT-XXXXXX" --progress --slot=replication_slot_name --host=primary_fqdn --username=replication_username --pgdata=/var/lib/postgresql/11/main (look at the man page for options)

At this point, you need to define the following variables (you can define them at the same level as the other pg_ variables, they will be ignored by the master):

postgres_primary_conninfo_host: "master fqdn"
postgres_primary_conninfo_user: "the replication user"
postgres_primary_conninfo_password: "the replication user password"
postgres_primary_slot_name: "the replication slot name"

You can also change the default for the following variable if needed:

postgres_primary_conninfo_port: 5432
postgres_primary_conninfo_sslmode: "require"

If you have a WAL repository, you can also define a restore_command:

pg_restore_command: 'rsync -e "ssh -o StrictHostKeyChecking=yes -o BatchMode=yes" -a login@wal_repo_fqdn:/path_to_wall_repo/%f %p'

You can now change the pg_replication_role only for the replica:

pg_replication_role: "replica"

Then rerun the role. This will create the recovery.conf or the standby.signal file depending on the postgresql version.

postgresql connection reaper

This role includes a script for Zabbix that is intended to be called as a remote command to purge the majority of active connections when the number of active connection is 2 times the amount of threads.

The usage of this script is controlled by Zabbix's Actions.

Don't forget that if you want to use it, you need to add the following variable to enable remote command execution by zabbix:

zabbix_remote_command: True

restart_required extra location

Sometimes, you need to have restart_required in a second location (different than pg_configuration_file_restart_required), you can use pg_configuration_file_restart_required_extra_location for this.

pg_upgrade

In this example, we will upgrade a server running pg 14 to pg 17, adjust the versions for your use case:

  1. apt update
  2. manually download the latest postgresql version: apt install postgresql-17
  3. if a new cluster has been created, stop it pg_ctlcluster stop 17 main, then remove the directories /var/lib/postgresql/17 and /etc/postgresql/17
  4. if no new cluster has been created, create a new one using pg_createcluster 17 main
  5. remove the directory /var/lib/postgresql/17/main and as the postgresql user, run /usr/lib/postgresql/17/bin/initdb /var/lib/postgresql/17/main
  6. check pg_lsclusters, you should have the current cluster running and the new one down
  7. Stop the current cluster
  8. perform a ZFS or Incus/LXD snapshot if necessary
  9. switch to the postgres user
  10. run this command: adjust the job count depending on the available memory and cpu count: /usr/lib/postgresql/17/bin/pg_upgrade --old-bindir=/usr/lib/postgresql/14/bin --new-bindir=/usr/lib/postgresql/17/bin --old-datadir=/var/lib/postgresql/14/main --new-datadir=/var/lib/postgresql/17/main --jobs=2 --link --verbose
  11. adjust the ansible variable for the new cluster version: pg_version: 17
  12. run the postgres role
  13. look at the sh scripts in the folder where you did the upgrade, you may have some post-upgrade bash script created by pg_upgrade, look at them and run them accordingly
  14. remove the old cluster: rm -r /var/lib/postgresql/14 /etc/postgresql/14

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/postgres_client/readme.md

Postgresql client role

This role will install postgresql client commands such as psql, pg_dump, pg_restore from the official postgresql repository.

The version of the tools installed is always the latest available, via the package postgresql-client from the official repository unless you explicitely define the list postgres_client_versions e.g.:

postgres_client_versions:
  - 15
  - 17

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/redis/readme.md

Redis

Variable reference

Optional variables

Variable Description Type of variable Default value Other value
redis_config Override redis default settings located in /etc/redis/redis.conf dict See Example
redis_default_user_password Define redis superuser default password string auto (password is auto-generated and stored in Hashicorp vault) nopass (redis keyword to deactive password);
redis_acls Define ACLs doc list None

Example

redis_config:
  bind: "127.0.0.1 ::1"
  port: "0"
  unixsocket: "/var/run/redis/redis-server.sock"
  unixsocketperm: "770" # the unix socket mode is `0770`, and the owner and group is `redis`, so if you want to allow a process to access the socket, you may add its user to the redis group
  protected-mode: "no"
  save: '""' # snapshot to disk are disabled since we usually don't need persistence

redis_acls:
  - name: app1
    password: nopass # If the special keyword `auto` is provided the password will be generated and stored in Hashicorp Vault
    right: "~* &* +@all"

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/rsyncd/readme.md

Important

This role install an rsync daemon, rsync is not a secure protocol. All data are transmitted in clear and the login and password are encoded using 128 bit MD4, which is a weak encryption.

As a result, rsync should never be used over the internet (except for anonymous rsync of course).

If you need a secure rsync, use it over ssh.

Configuration

Define shared directories

You need to define a dictionary with the following informations:

rsyncd_shares:
  rsync_share_identifier:
    comment: "something clever" # this is optional
    path: "/the/shared/path"
    read_only: "true" # optional, the default is "true"
    auth_users: [ 'user1', 'user2' ]
    hosts_allow: [ '1.2.3.4', '5.6.7.8' ] # this is optional, the default value is '10.0.0.0/8'

Define the authentication informations

You need to define the login and their associated passwords in a list of dictionaries like that: rsyncd_secrets: - { 'login' : 'login1', 'pass' : 'pass1' } - { 'login' : 'login2', 'pass' : 'pass2' }

Connection

Anyone can list the available shares with this command:

rsync -t rsync://hostname

This will return the list of all the shares and their descriptions.

You can then test a sync with a command like that (this will ask for your password):

rsync -avn rsync://user1@rsync_share_identifier /tmp/.

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/rsyslog/readme.md

Optional variables

Those variables have a default value that you can change if needed.

Variable Description Default value Example
rsyslog_syslog_exception list of filter to exclude from /var/log/syslog and /var/log/messages None [ 'local7.none' ]
rsyslog_additional_log list of additional logs to configure None see bellow

Example of rsyslog_additional_log, this is a dictionnary:

rsyslog_additional_log:
  - rule: "local7.*"
    file: "/var/log/samba/audit.log"

This will be translated to:

local7.*        /var/log/samba/audit.log

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/sonarqube/readme.md

(!) This role is tailored only for Cosium. It includes hard-coded LDAP parameters as well as the sonarqube-community-branch-plugin-1.8.1.jar plugin.

Required variables

Variable Description Sample value
pg_version The postgres server version 14
sonarqube_url url for the web interface sonarqube.cosium.dev
sonarqube_version The sonarqube version 9.9.1.69595
sonarqube_postgres_password The sonarqube postgres database password, must be stored in hashicorp vault foo

Optional variables

Variable Description Default value Sample value
sonarqube_update_sonarqube_now Set this value to true to upgrade sonarqube to a newer version false true
sonarqube_download_url The url allowing to download the Sonarqube distribution archive. https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-{{ sonarqube_version }}.zip https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-{{ sonarqube_version }}.zip
sonarqube_java_heap_size Set the xmx of the 3 sonarqube engines (web, ce and es) None 2048m
sonarqube_ce_jmx_config JMX parameters appended to the ce javaOpts. For now to disable it how have to set this param as an empty string See defaults/main.yml
sonarqube_web_jmx_config JMX parameters appended to the web javaAdditionalOpts. For now to disable it how have to set this param as an empty string See defaults/main.yml
sonarqube_jmx_user_list Sonarqube JMX monitoring users.
- name: monitoring
password: '{{ lookup(''hashi_vault'', ''secret=cosium-kv/data/group_vars/all'')[''zabbix_jmx_monitoring_password' '] }}'
right: readonly
sonarqube_cosium_community_branch_plugin_version Set this value to install a version of the sonarqube cosium community branch plugin version from nexus None 1.14.0.1
sonarqube_cosium_sonar_plugin_version Set this value to install a version of the sonarqube cosium private plugin version from nexus None 1.9
sonarqube_community_branch_plugin_version Set this value to install a version of the sonarqube community branch plugin version from public repo None 1.14.0.1
sonarqube_redaalaoui_sonar_java_no_var_plugin_version Set this value to install a version of the sonarqube sonar-java-no-var-plugin plugin version from public repo None 1.9

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/sqlpage/readme.md

SQLpage

This role installs N instances of SQLpage with their corresponding services.

Variable reference

Mandatory variables

Variable Description Type of variable Example value
sqlpage_project_list list of projects and their configurations list see below

Optional variables

Variable Description Type of variable Default value Other value
sqlpage_version version of sqlpage string latest v0.28.0

Example

The mode variable is used to set the site either in production or in developement mode (default is production). In production mode, error messages are hidden on the web interface, but can be found in the systemd logs, and pages are cached.

Additionally, you can set the debug variable to true to get more detailed logs (trace) and see exactly what SQLPage is doing

The environment_list variable is used to define custom environment variables that you can use in sqlpage, follow the documentation: https://sql-page.com/functions.sql?function=environment_variable#function

sqlpage_project_list:
  - name: central
    port: 8081
    dbuser: centralro
    dbpass: "{{ lookup('hashi_vault', 'secret=cosium-kv/data/inventories/center/group_vars/central')['centralro_dbpassword'] }}"
    dbhost: "central-db.cosium.com"
    dbname: central
  - name: alexandria
    debug: true
    port: 8082
    dbuser: "alexandria-worker"
    dbpass: "{{ lookup('hashi_vault', 'secret=cosium-kv/data/services/alexandria')['database_user_alexandria-worker_password'] }}"
    dbhost: "alexandria-db.cosium.com"
    dbname: alexandria
    mode: "development"
    environment_list:
      - SFTP_SERVER_HOSTNAME=sftp4.cosium.net

Update

To update sqlpage, add this parameter: --extra-vars '{ "sqlpage_update_now" : true }'.

Other information

You need a reverse proxy in front to forward to the corresponding ports.

Also, if you want to have to deploy a git repository to an SQLpage website, you'll need to use the role git_generic_deploy_files, for instance:

git_generic_deploy_files_list:
  - repository_url: "ssh://{{ lookup('ansible.builtin.config', 'DEFAULT_REMOTE_USER').split('-')[1] }}@gerrit.cosium.com:29418/sqlpage-central"
    branch: master
    deploy_directory: "/srv/central"

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/ssh-keygen-and-store/readme.md

This role handles the ssh keys of any number of system users.

Usage

By default, only the root user is handled, you can modify the list of users with this variable:

ssh_keygen_user_list:
  - root

This role will look at hashicorp vault and on the server to see if ssh keys are present for the defined users.

What this role does

There are 4 possibilities for each user: 1. the key doesn't exists anywhere: the key will be generated on the server and stored on hashicorp vault 2. the key is only present on the server: the key will be send to hashicorp vault 3. the key is only present on hashicorp vault: the key will be send to the server 4. the key is present on both sides: this role will check that the key is the same everywhere and fail if it is not the case

Important limitation

(!) Due to the limitation of ansible, this role will take an exponential amount of time for each new user.

This is due to the usage of the with_nested loop function with up to 3 dictionaries. This is currently the only way I found to match indexes of dictionaries together.

This basically mean that if the number of user is too large, this role will take so much time that it will never complete. The exact number is unknown (depends on computer power of hashicorp vault, the admin workstation, etc).

For now, avoid more than 3 users.

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/vaultwarden/readme.md

Mandatory variables

Variable Description Type of variable Sample value
pg_version major postgres version int 14
vaultwarden_domain servername string password-management.cosium.com

Optional variables

Variable Description Type of variable Sample value
vaultwarden_version version of vaultwarden core string 1.25.0
vaultwarden_web_vault_version version of vaultwarden web-vault string v2022.05.0
vaultwarden_ldap_version version of vaultwarden ldap string v0.6.2
vaultwarden_rocket_address bind ip of vaultwarden core string 0.0.0.0
vaultwarden_websocket_address bind ip for websocket bool True
vaultwarden_ldap enable vaultwarden ldap bool True
vaultwarden_org_name name shown in the invitation emails string Password Management Platform
vaultwarden_signups_domain_whitelist controls if new users from a list of comma-separated domains can register string cosium.com
vaultwarden_push_installation_id push relay token id string see documentation
vaultwarden_push_installation_key push relay token key string see documentation
vaultwarden_yubico_id enable yubico TOTP string see documentation
vaultwarden_smtp_config config an email server to send invitation and other informations list see documentation

SMTP Example:

You can also override the SMTP configuration, here is the default configuration:

vaultwarden_smtp_config:
  SMTP_HOST: 127.0.0.1
  SMTP_FROM: "{{ ansible_hostname }}@infra.cosium.net"
  SMTP_PORT: 25
  SMTP_SECURITY: "off"

Push relay example

The "Push Relay" feature enables live auto-synchronization on mobile applications. Official Bitwarden Doc: https://bitwarden.com/help/configure-push-relay/

To activate it, generate a token (in EU region) on the Bitwarden website: https://bitwarden.com/host/ You will then need to define these variables, for example, by registering the key in hashicorpvault:

vaultwarden_push_installation_id: "f9f8a455-3eef-4395-a29d-b03b01010637"
vaultwarden_push_installation_key: "{{ lookup('hashi_vault', 'secret=cosium-kv/data/' + host_vars_location + '/' + ansible_hostname)['vaultwarden_push_installation_key'] }}"

Enable Yubico

You need at least a yubico key to activate this feature. 1. First, generate an OTP code by following this documentation. 2. Once you have your OTP code, you can generate an API key to use the service. 3. You'll then need to set the vaultwarden_yubico_id variable to ansible and add the secret key to hashicropvault under the name vaultwarden_yubico_secret_key. 4. Run ansible

Improve compilation time

You can speed up the compilation of Vaultwarden for an installation or update by increasing its resources.

CPU RAM Compilation time
1 4GB 287.19s
4 4GB 249.40s
32 40GB 146.71s
128 40GB 113.26s

Update

To update vaultwarden, add this parameter: --extra-vars '{ "vaultwarden_update_now" : true }'. To update vaultwarden web-vault, add this parameter: --extra-vars '{ "vaultwarden_web_vault_update_now" : true }'. To update vaultwarden ldap, add this parameter: --extra-vars '{ "vaultwarden_ldap_update_now" : true }'.

This role will also update if this parameter is present: --extra-vars "global_update_now=true" , true is case sensitive since it's evaluated as a string in this case.

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/zabbix_agent/readme.md

zabbix_agent role

This role will automatically install the Zabbix Agent on Linux or Windows.

Variable reference

Optional variables

Variable Description Type of variable Default value Other value
zabbix_agent_2 install zabbix-agent2 or if false install zabbix-agent v1 bool false value 1, value 2
zabbix_psk enable encryption, see bellow for more information string none 95e7ebed7c8a2a6c658
zabbix_server zabbix server dns string none, see group_vars zabbix.neox.sh
zabbix_ListenIP zabbix_agent listen IP for incoming connection from the server string none 10.78.0.34
zabbix_UnsafeUserParameters enable special characters into user parameter bool none true
zabbix_hostname zabbix hostname (for exemple windows have a limitation of 15 characters) string none izy-iwi-catalog
zabbix_agent_sudo_logging to debug what zabbix user is running via sudo bool false true
zabbix_add_host_on_zabbix_server Add host to Zabbix (with Ansible groups) bool false true
zabbix_agent_monitor_by when zabbix_add_host_on_zabbix_server, you can tell who is monitoring the zabbix agent string proxy zabbix_server

Examples

Enable encryption

By default, no encryption is enabled.

Source: https://www.zabbix.com/documentation/3.0/manual/encryption/using_pre_shared_keys

To enable encryption, you first need to generate a psk, the documentation doesn't provide any guideline about a safe size for the PSK, so we'll use the biggest size possible:

openssl rand -hex 120

Important: in OpenSSL version < 1.1.1, the PSK could be longer than 128 hexadecimal digits (up to 512), but after OpenSSL 1.1.1, the maximum PSK length is now 128 hexadecimal digits. If a PSK is exceeding the new OpenSSL limit, the host will not be monitored anymore, see https://www.zabbix.com/documentation/3.0/manual/encryption/troubleshooting/psk_problems for more information Set this psk in the vault of your host:

zabbix_psk: "040ae522e533a2e5e9ba46930e82b82695e7ebed7c8a2a6c658702de8c87dabed6ea7f7acaf7e62d564ed631fb49ebd84415675f6daf90b50d9940fa9f49843f06073998e5e8d1c7a5a55c1b34777cd650d2b9b5d88076ced3318c8fb607d36c6a8b5387eca0e5190a1119daf66d6262803f30e05caea5b45ac5bc5e10be849d06d857f1cbeb890503b4107a5120595de7f5b530139d123b1f54483263d1edf8455a6fe8f54c469a5a67f7ba6a9de5fc40815b6941fab0d4dd68250f201954e4fcd6d0051bd238cfed8889d72d936f140024e5bfa2c9ca2c4be4932d857b467935f0764be5a2f254bc9db658675e0eea422cc7f0302ae2b07557d5db6a189ebd"

You then need to configure the Zabbix frontend to use the PSK, you need to go to the "Encryption" table and select PSK for both the "Connections to host" and the "Connections from host". The "PSK identity" is generated by ansible and is simply "PSK {{ ansible_hostname }}", and the "PSK" is of course the generated one.

When both the client and the server are configured, you may have to wait ~1 minute before it actually works because of the configuration cache on the server, maybe longer if you use a proxy.

You can also test the connection on the Zabbix server, to do that you must copy the psk to a file and then use a command like this:

zabbix_get --tls-connect psk --tls-psk-identity "PSK screen3" --tls-psk-file /etc/zabbix/tls-key-file/screen3.psk -s screen3 -k agent.hostname

Windows Agent Binary is not compiled with TLS Support. Enabling TLS in configure cases the zabbix service not to start. Tracker: https://support.zabbix.com/browse/ZBXNEXT-3047

Update

The update works only on windows.

To perform an update, add this parameter: --extra-vars "zabbix_agent_win_update_now=true" , true is case sensitive since it's evaluated as a string in this case.

This role will also update if this parameter is present: --extra-vars "global_update_now=true" , true is case sensitive since it's evaluated as a string in this case.

The update will be skipped if you already have the latest version of the executable.

Common problems

Zabbix agent cannot start on Windows

Sometimes, zabbix agent fails to start on Windows. You can try to rebuild the performance counters isuuing the following commands as an administrator:

cd c:\windows\system32
lodctr /R
cd c:\windows\sysWOW64
lodctr /R

WINMGMT.EXE /RESYNCPERF

Get-Service -Name "Zabbix Agent" | Restart-Service -Force -Verbose

https://learn.microsoft.com/en-au/troubleshoot/windows-server/performance/manually-rebuild-performance-counters#rebuild-all-performance-counters-including-extensible-and-third-party-counters

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/zabbix_frontend/readme.md

zabbix frontend role

This role installs zabbix php frontend.

Mandatory variable

Variable Description Type of variable Example value
zabbix_frontend_version self-explanatory string 7.4

Optional variables

Variable Description Type of variable Default value Example value
zabbix_frontend_servername hostname for the frontend string {{ ansible_host }} zabbix.example.org
zabbix_frontend_ZBX_SERVER_NAME display name in the interface string Zabbix My Zabbix service
zabbix_frontend_ZBX_SERVER zabbix server host string localhost zabbix-server.example.org
zabbix_frontend_DBHost host of the database string localhost zabbix-database.example.org
zabbix_frontend_DBPORT port of the database int 5432 6432
zabbix_frontend_DBPassword password for the database string {{ lookup('hashi_vault', 'secret=cosium-kv/data/' + host_vars_location + '/' + ansible_hostname)['postgres_user_zabbix_password'] }}
# Informations

## Default login credentials
The default login credentials during the first installation are:

Username: Admin password: zabbix


# Disable LDAP authentification
If zabbix can no longer reach any LDAP, the authentication will fail each time. If you try to authenticate with a local account, it won't work because zabbix is configured to connect to LDAP accounts.
You will need to disable LDAP authentication from the database:

update config set authentication_type=0;





<div class='page-break'></div>

<div class='doc-header'>
<h2>📄 readme.md</h2>
<div class='doc-path'>Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/zabbix_java_gateway/readme.md</div>
</div>

# zabbix java gateway role

This role is very simple and installs zabbix java gateway.

## mandatory variable

You need to define the version to install:

zabbix_version: 7.4


## optional variable

You can override the variable StartPollers like this:

zabbix_java_gateway_start_pollers: 20





<div class='page-break'></div>

<div class='doc-header'>
<h2>📄 readme.md</h2>
<div class='doc-path'>Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/zabbix_proxy/readme.md</div>
</div>

# Mandatory variable

Define the zabbix proxy version, the postgresql database version and the zabbix user database password:

zabbix_version: 7.4 pg_version: 17

If you are on Debian, you will also need to activate the `non-free` repository for the `snmp-mibs-downloader` package. To do this, define this variable and re-run the "common" role:

debian_apt_sources_list_additional_component: [ 'non-free' ]

# Zabbix proxy mode
By default, this role makes the zabbix proxy in active mode. This means that the proxy will connect itself to the server on the port 10051. If this is not possible and the server must connect itself to the proxy, the proxy need to be in passive mode instead.

To activate passive mode, set this variable to "passive" (the default is "active"):

zabbix_proxy_ProxyMode: "passive"

In passive mode, the server will connect itself to the proxy on port 10051.

In active mode, you can also modify the port used by the proxy to connect to the server via this variable:

zabbix_proxy_ServerPort: "10051"

# Encryption between zabbix proxy and zabbix server
The connection between the Zabbix Proxy and the Zabbix Server is now always encrypted.

The `zabbix_proxy_psk` is now generated automatically with an hex password of 128 characters. You'll find the generated password in hashicorp vault.

(!) You need to configure the Zabbix frontend to use the PSK, you need to go to the "Encryption" tab and select PSK in either "Connections to proxy" (for a passive proxy) or "Connections from proxy" (for an active proxy) . The "PSK identity" is generated by ansible and is simply "PSK {{ ansible_hostname }}", and the "PSK" is of course the generated one.

# Any other configuration parameters
You can define any additional configuration settings using this dictonnary:

zabbix_proxy_addional_config: ProxyOfflineBuffer: 2 StartPollersUnreachable: 5 CacheSize: 50M JavaGateway: localhost StartJavaPollers: 20


You can override StartPingers:

zabbix_proxy_StartPingers: 10





<div class='page-break'></div>

<div class='doc-header'>
<h2>📄 readme.md</h2>
<div class='doc-path'>Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/zabbix_server/readme.md</div>
</div>

<!-- TOC -->
* [zabbix server role](#zabbix-server-role)
  * [Mandatory variable](#mandatory-variable)
  * [Optional variables](#optional-variables)
<!-- TOC -->

# zabbix server role

Important: if the database location is not `localhost`, you will have to install postgresql on the correct host before running this role. You will need the following variables in the database host:

pg_users: - name: zabbix password: auto attrib: LOGIN

pg_databases: - name: zabbix owner: zabbix conn_limit: 100 extension_list: - name: timescaledb version: 2.19.3

pg_shared_preload_libraries: - timescaledb

The version of timescaledb in particular is very important: the version is marked for hold to avoid any update. It must be specified with the complete version (X.Y.Z).

## Mandatory variable
| Variable                 | Description | Type of variable | Example value |
|--------------------------|-------------|------------------|---------------|
| zabbix_version    | self-explanatory                                                             | string           | `7.4`       |
| zabbix_server_DBHost     | where is the database, use `localhost` for local, which has special settings | string           | `localhost`       |

## Optional variables
| Variable                   | Description | Type of variable | Default value | Example valur |
|----------------------------|-------------|------------------|---------------|---------------|
| zabbix_server_DBPassword   | database password | string | `{{ lookup('hashi_vault', 'secret=cosium-kv/data/' + host_vars_location + '/' + ansible_hostname)['postgres_user_zabbix_password'] }}` | |
| zabbix_server_alertscripts | list of alertscript to add, current scripts that can be activated: jira, matrix, msteam | list | `undefined` | `[ "jira", "matrix" ]` |
You can define any additional configuration settings using this dictonnary:

zabbix_server_addional_config: StartPollers: 300 StartIPMIPollers: 10 AlertScriptsPath: "/etc/zabbix/alertscripts"

This role overrides the default values about the communication between a zabbix server and a *passive* zabbix proxy. By default, the server update the configuration on *passive* proxies only every hours, which is not convenient. It also query the proxy every single seconds. This role changes those value to 15 minutes and 5 seconds, respectively. You can modify those value by changing those variables:

zabbix_server_ProxyConfigFrequency: "900" zabbix_server_ProxyDataFrequency: "5"

Those settings have no effect on *active* proxies.




<div class='page-break'></div>

<div class='doc-header'>
<h2>📄 readme.md</h2>
<div class='doc-path'>Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/zabbix_template_assignment/readme.md</div>
</div>

# zabbix_template_assignment role

This role allows you to assign an Ansible host to Zabbix.
It first calls a meta role that allows you to store user parameters and scripts and monitor systemd units.

<!-- TOC -->
* [zabbix_template_assignment role](#zabbix_template_assignment-role)
  * [Variable reference](#variable-reference)
    * [Optional variables](#optional-variables)
  * [Example](#example)
<!-- TOC -->

## Variable reference

### Optional variables

| Variable                                | Description                     | Type of variable | Default value | Other value |
|-----------------------------------------|---------------------------------|------------------|---------------|-------------|
| zabbix_template_assignment              | assign template to zabbix host  | `bool`           | `false`       | `true`      |
| zabbix_template_assignment_list         | list of templates               | `dict`           | none          | see bellow  |
| zabbix_template_assignment_script_list  | list of scripts                 | `dict`           | none          | see bellow  |
| zabbix_template_assignment_systemd_list | list of monitoring systemd unit | `list`           | none          | see bellow  |

## Example

In most cases (if the file is not a template) you can call the role via the meta of another role:
```yaml
dependencies:
  - role: zabbix_template_assignment
    zabbix_template_assignment_list:
      - zabbix_name: OpenZFS # mandatory if variable is defined, use to link the Ansible host to this template on Zabbix.
        user_parameter: openzfs # optional, if defined, it will fetch the file from the role that called it (in our case `roles/warp/[files||templates]/zabbix_openzfs.conf[||.j2]`)
    zabbix_template_assignment_script_list:
      - zabbix_name: warp # mandatory if variable is defined, use to link the Ansible host to this template on Zabbix.
        file: warp.sh # optional, if defined, it will fetch the file from the role that called it (in our case `roles/warp/[files||templates]/zabbix_warp.sh`)
    zabbix_template_assignment_systemd_list:
      - soketie.service # mandatory if variable is defined

In some cases, for example when defining a variable dynamically in a role, you'll need to add this step to the end of your role to call that role. Here's an example:

- name: "[zabbix_agent] manage userparameter"
  block:
  - name: "set fact zabbix_template_assignment_list"
    set_fact:
      zabbix_template_assignment_list:
        - name: OpenZFS
          user_parameter: openzfs
      zabbix_template_assignment_script_list:
        - zabbix_name: OpenZFS
          file: zfs_script.sh
      zabbix_template_assignment_systemd_list:
        - zfs.service

  - name: "import role zabbix_template_assignment"
    import_role:
      name: zabbix_template_assignment

  - name: "unset facts"
    set_fact:
      zabbix_template_assignment_list: []
      zabbix_template_assignment_script_list: []
      zabbix_template_assignment_systemd_list: []
  tags:
    - zfs
    - zabbix
    - zabbix_template_assignment

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/zabbix_template_payloads/readme.md

zabbix_template_payloads role

This role allows you to store user parameters and scripts and monitor systemd units.

Be careful: if you call this role directly, it will only install the user parameters, scripts, and the systemd unit without linking directly to Zabbix. It is better to refer to the zabbix_template_assignment role.

Variable reference

Optional variables

Variable Description Type of variable Default value Other value
zabbix_template_payloads_list list of templates dict none see bellow
zabbix_template_payloads_script_list list of scripts dict none see bellow
zabbix_template_payloads_systemd_list list of monitoring systemd unit list none see bellow

Example

In most cases (if the file is not a template) you can call the role via the meta of another role:

dependencies:
  - role: zabbix_template_payloads
    zabbix_template_payloads_list:
      - zabbix_name: OpenZFS
        user_parameter: openzfs
    zabbix_template_payloads_script_list:
      - zabbix_name: warp
        file: warp.sh
    zabbix_template_payloads_systemd_list:
      - soketie.service

In some cases, for example when defining a variable dynamically in a role, you'll need to add this step to the end of your role to call that role. Here's an example:

- name: "[zabbix_agent] manage userparameter"
  block:
  - name: "set fact zabbix_template_payloads_list"
    set_fact:
      zabbix_template_payloads_list:
        - name: OpenZFS
          user_parameter: openzfs
      zabbix_template_payloads_script_list:
        - zabbix_name: warp
          file: warp.sh
      zabbix_template_payloads_systemd_list:
        - soketie.service

  - name: "import role zabbix_template_payloads"
    import_role:
      name: zabbix_template_payloads

  - name: "unset facts"
    set_fact:
      zabbix_template_payloads_list: []
      zabbix_template_payloads_script_list: []
      zabbix_template_payloads_systemd_list: []
  tags:
    - zfs
    - zabbix
    - zabbix_template_payloads

Why create a role for this?

📄 readme.md

Chemin: 04_INFRA_DEPLOIEMENT/Ansible/roles/zfs/readme.md

zpool and dataset creation

zpool

This role can automatically create any number of zpool, to do so, you must specify at least their names and geometry with the zfs_zpools dictionary , for example:

zfs_zpools:
  - name: "nvme"
    geometry: "mirror nvme0n1 nvme1n1"

This will create a zpool named nvme in mirror mode with the 2 drives nvme0n1 and nvme1n1. This will also set the following default option for the zpool creation:

-O compression=lz4 -O atime=off -O xattr=sa -O mountpoint=none -O acltype=posixacl

If you want different options, you can set them by adding the keyword options, for example:

zfs_zpools:
  - name: "nvme"
    geometry: "mirror nvme0n1 nvme1n1"
    options: "-O compression=lz4 -O atime=off -O xattr=sa -O mountpoint=none -O acltype=posixacl"

After the zpool has been created, this role will export it and import it back with the -d /dev/disk/by-id option to use the device id for future imports.

dataset

This role can also create any number of dataset with any zfs properties. The syntax is:

zfs_dataset_list:
  - name: "tank/something"
    properties:
      mountpoint: "/media/something"
      recordsize: "1M"
  - name: "tank/something_else"

The previous example will simply result in the following zfs commands:

zfs create tank/something -o mountpoint=/media/something -o recordsize=1M
zfs create tank/something_else

ARC settings

Size

You can adjust the maximum size of the ARC, which is the maximum amount of memory that ZFS can use at any given time.

The default is 1/8 of the total memory. You can adjust this setting by changing the variable max_arc_size, since ansible uses the variable ansible_memtotal_mb for the host memory, you have to adjust the variable like this to get the amount of RAM that you want for ZoL:

# 1/2 of RAM
max_arc_size: "{{ ansible_memtotal_mb * 524288 }}"
# 40% of RAM
max_arc_size: "{{ ansible_memtotal_mb * 419430 }}"
# 1/3 of RAM
max_arc_size: "{{ ansible_memtotal_mb * 349525 }}"
# 1/4 of RAM
max_arc_size: "{{ ansible_memtotal_mb * 262144 }}"
# 1/5 of RAM
max_arc_size: "{{ ansible_memtotal_mb * 209715 }}"
# 1/6 of RAM
max_arc_size: "{{ ansible_memtotal_mb * 174763 }}"
# 1/7 of RAM
max_arc_size: "{{ ansible_memtotal_mb * 149797 }}"
# 1/8 of RAM
max_arc_size: "{{ ansible_memtotal_mb * 131072 }}"
# 1/16 of RAM
max_arc_size: "{{ ansible_memtotal_mb * 65536 }}"
# 1/32 of RAM
max_arc_size: "{{ ansible_memtotal_mb * 32768 }}"
# 1/64 of RAM
max_arc_size: "{{ ansible_memtotal_mb * 16384 }}"

This is the same thing as max_arc_size: {{ ansible_memtotal_mb * 1024 * 1024 / [RATIO] }}, for example:

{{ ansible_memtotal_mb * 1024 * 1024 / 4 }} = {{ ansible_memtotal_mb * 262144 }}

meta and dnode percent limit

By default, zfs set the the zfs_arc_dnode_limit_percent to 10% and the zfs_arc_meta_limit_percent to 75%.

From experience, most of the time it doesn't make any sense to limit ZFS for either values, so they are both set to 95% of the maximum memory in this role.

You can adjust both parameters with those values if needed:

zfs_arc_meta_limit_percent: 95
zfs_arc_dnode_limit_percent: 95

ZFS tunnable

Currently, you can set the "zfs_txg_timeout" module option with this value:

zfs_txg_timeout: n

Where n is a number, in second (the default is 5).

Automatic scrub deactivation

On Ubuntu, a crontab exists to run a scrub the second Sunday of every month at midnight. This disrupt the normal server usage.

By default this role deactivate this scrub, you can let it active by setting this variable:

zfs_auto_scrub: True

📄 ARCHITECTURE_INFRA.md

Chemin: 04_INFRA_DEPLOIEMENT/Architecture_Serveurs/ARCHITECTURE_INFRA.md

Architecture Infrastructure Talas

Topologie des serveurs, réseau, stockage et services. Infrastructure 100% self-hosted — aucune dépendance cloud. Source : [[12_DOCUMENTATION/ANALYSE_PROJET_MARS_2026]] §5 Dernière mise à jour : 27 mars 2026.


Vue d'ensemble

                    Internet (fibre Orange 1 Gbps + 5G backup)
                              |
                     [WireGuard VPN]
                              |
              ┌───────────────┴───────────────┐
              |                               |
         R720 #1 (PRODUCTION)           R720 #2 (DATA + BACKUP)
         ────────────────────           ─────────────────────────
         HAProxy (reverse proxy         MinIO (stockage audio/fichiers)
           + TLS + Coraza WAF)          PostgreSQL replica (HDD 15K)
         Veza Backend (Go) x2           Elasticsearch
         Veza Stream Server (Rust) x2   ClamAV (antivirus)
         Veza Frontend (React) x2       Prometheus + Grafana
         PostgreSQL primary (SSD)       Alertmanager
         Redis (SSD)                    Zabbix
         RabbitMQ                       Backups PITR
         Hyperswitch (paiements)        Kibana
              |                               |
              └──────── 10 GbE ───────────────┘
                  (réplication PG, accès MinIO,
                   transferts de backup)

Flux réseau entrant :

Internet → Fibre Orange → WireGuard/port forward → HAProxy (TLS + WAF) → services

Diagramme Mermaid (pour rendu web / Logseq)

graph TB
    Internet["🌐 Internet<br/>Fibre Orange 1 Gbps + 5G backup"]
    WG["WireGuard VPN"]
    Internet --> WG

    subgraph R720_1["R720 #1 — PRODUCTION"]
        HAProxy["HAProxy<br/>TLS + Coraza WAF"]
        Backend["Veza Backend Go x2"]
        Stream["Veza Stream Rust x2"]
        Frontend["Veza Frontend React x2"]
        PG1["PostgreSQL primary<br/>⚡ SSD"]
        Redis["Redis<br/>⚡ SSD"]
        RMQ["RabbitMQ"]
        HS["Hyperswitch"]

        HAProxy --> Backend
        HAProxy --> Stream
        HAProxy --> Frontend
        Backend --> PG1
        Backend --> Redis
        Backend --> RMQ
        Stream --> RMQ
    end

    subgraph R720_2["R720 #2 — DATA + BACKUP"]
        MinIO["MinIO S3"]
        PG2["PostgreSQL replica<br/>HDD 15K"]
        ES["Elasticsearch"]
        ClamAV["ClamAV"]
        Prom["Prometheus + Grafana"]
        Alert["Alertmanager"]
        Zabbix["Zabbix"]
        PITR["Backups PITR<br/>HDD 1.8 To"]
        Kibana["Kibana"]
    end

    WG --> HAProxy
    R720_1 <-->|"10 GbE<br/>réplication PG, MinIO, backups"| R720_2
    PG1 -->|"réplication"| PG2
    Backend -->|"stockage fichiers"| MinIO
    Backend -->|"scan uploads"| ClamAV
    Backend -->|"recherche"| ES

Pas de Cloudflare, pas de Tailscale, pas de tiers. Cohérent avec les valeurs Talas (indépendance, transparence, contrôle total).


Matériel

Serveurs : 2x Dell PowerEdge R720

Spécification Par serveur Total
CPU 2x Intel Xeon E5-2670 @ 2.60 GHz (8C/16T) 32 cœurs / 64 threads
RAM 16x 24 Go DDR3 1600 MHz = 384 Go 768 Go
Baies disques 16 baies 2.5" 32 baies
Réseau Carte PCIe 10 GbE Liaison 10 GbE inter-serveurs

Architecture Sandy Bridge-EP (2012). Performant mais consommation élevée (~400W par serveur en charge).

Stockage

Type Capacités disponibles Performance Usage
SSD (réserve) Jusqu'à 1 To (anciens) Excellent en IOPS aléatoires PostgreSQL primary, Redis
HDD 15K RPM 2.5" 146 Go, 300 Go, 600 Go, 900 Go, 1.8 To Meilleur HDD pour I/O séquentielles Système, replicas, stockage

~100 disques d'occasion disponibles. Taux de panne estimé : 10-15%/an → ZFS mirror obligatoire, SMART monitoring (smartctl -a) systématique.

Réseau

Composant Débit Usage
Fibre Orange 1 Gbps descendant Trafic Internet
5G backup Variable Failover
10 GbE inter-serveurs 10 Gbps Réplication PG, MinIO, backups
LAN 1-2.5 Gbps Équipements locaux

R720 #1 — Production

Services applicatifs et bases de données primaires.

Service Rôle Stockage
HAProxy Reverse proxy, terminaison TLS (Let's Encrypt), Coraza WAF HDD (logs)
Veza Backend (Go) x2 API REST, 500+ endpoints, blue-green deployment
Veza Stream Server (Rust) x2 Streaming HLS adaptatif, WebSocket, transcoding
Veza Frontend (React) x2 SPA servie par Nginx
PostgreSQL primary Base de données principale, 60+ tables SSD (IOPS critiques)
Redis Sessions, cache HTTP, rate limiting, CSRF tokens SSD (persistance rapide)
RabbitMQ Message broker (événements track.uploaded, etc.) HDD
Hyperswitch Orchestrateur de paiements HDD

Blue-green deployment : deux instances de chaque service applicatif. HAProxy bascule entre les deux lors des mises à jour (zéro downtime).


R720 #2 — Data + Backup

Stockage, réplication, monitoring et sauvegardes.

Service Rôle Stockage
MinIO Stockage objet S3-compatible (audio, avatars, exports) HDD 1.8 To (pool ZFS mirror)
PostgreSQL replica Réplique en lecture de la base primaire HDD 15K 600-900 Go
Elasticsearch Recherche full-text (pistes, users, playlists) HDD 15K 600-900 Go
ClamAV Scan antivirus des fichiers uploadés HDD
Prometheus Collecte de métriques (scrape /metrics) HDD
Grafana Dashboards de monitoring HDD
Alertmanager Routage d'alertes HDD
Zabbix Monitoring d'infrastructure (alertes → Matrix, Jira) HDD
Kibana Visualisation des logs Elasticsearch HDD
Backups PITR Archives WAL PostgreSQL, snapshots ZFS HDD 1.8 To

Allocation stockage

Type de disque Serveur Usage Justification
SSD (priorité) R720 #1 PostgreSQL primary + WAL IOPS aléatoires critiques pour les requêtes
SSD R720 #1 Redis (RDB + AOF) Persistance rapide, accès aléatoire
HDD 15K (146-300 Go) R720 #1 Système, logs, swap I/O séquentielles, pas critique
HDD 15K (600-900 Go) R720 #2 PostgreSQL replica, Elasticsearch Bonnes IOPS pour du HDD, lectures séquentielles
HDD (1.8 To) R720 #2 MinIO (pool ZFS mirror) Volume > performance, stockage audio
HDD (1.8 To) R720 #2 Backups PITR, snapshots ZFS Volume, écritures séquentielles

Stockage ZFS — Mirror vdevs

Choix retenu : pools en mirror (paires de 2 disques), pas RAIDZ2.

Critère Mirror (retenu) RAIDZ2 (alternative)
Tolérance panne 1 disque par paire 2 disques par vdev
Performance lecture Excellente (striped mirrors) Bonne
Performance écriture Bonne Moyenne (calcul parité)
Perte capacité 50% ~33%
Temps de resilver Rapide (1 disque à copier) Lent (tout le vdev)
Adapté aux disques d'occasion Oui (resilver rapide = moins de stress) Risque (resilver long)

Avec ~100 disques d'occasion et un taux de panne de 10-15%/an, le mirror est clairement supérieur : le resilver rapide limite la fenêtre de vulnérabilité.


Sécurité réseau

Couche d'accès

Composant Rôle
WireGuard VPN d'accès aux serveurs. Exposition sécurisée des services sur Internet.
HAProxy Point d'entrée unique. Terminaison TLS. Routage vers les services.
Coraza WAF Filtrage applicatif (OWASP CRS). Protection contre SQLi, XSS, path traversal.
Let's Encrypt Certificats TLS automatiques via certbot.

Couche d'administration

Composant Rôle
JumpServer Bastion SSH/RDP. Interface web, audit vidéo, RBAC, MFA. Point d'accès unique pour l'administration.
Hashicorp Vault Gestion des secrets (clés SSH, tokens, mots de passe).

Monitoring et logs

Composant Rôle
ELK Stack Filebeat → Elasticsearch → Kibana. Centralisation et analyse des logs.
Zabbix Monitoring infrastructure (CPU, RAM, disques, réseau). Alertes multi-canal.
Prometheus + Grafana Métriques applicatives (endpoints /metrics des services Veza).
Alertmanager Routage d'alertes Prometheus vers les canaux configurés.

Automatisation

Ansible (46+ rôles)

Rôles regroupés par fonction :

Catégorie Rôles
Base système docker, crontab, rsyslog, ssh-keygen-and-store
Bases de données postgres_client, pg-wal-pull
Reverse proxy haproxy (+ Coraza WAF)
Stockage minio, zfs
Monitoring zabbix_server, filebeat, elasticsearch, prometheus
Sécurité jumpserver, vault
Communication element-web (Matrix)
CI/CD gerrit, git_generic_deploy_files
Conteneurs incus, docker

Conteneurisation


Coûts d'exploitation

Poste Calcul Coût mensuel
Électricité serveurs 2x R720 ~400W chacun = 800W
Équipement réseau Switch, routeur ~50W
Total puissance ~850W en continu
Consommation mensuelle 850W × 24h × 30j = 612 kWh
Électricité 612 kWh × 0.22 EUR/kWh ~135 EUR
Internet fibre Orange + 5G ~40-50 EUR
Nom de domaine ~12 EUR/an ~1 EUR
TOTAL ~180 EUR/mois

Comparaison cloud équivalent

Poste cloud Coût estimé
2 serveurs dédiés 384 Go RAM (Hetzner) 400-600 EUR/mois
Managed PostgreSQL + Redis + Elasticsearch (AWS) 500-800 EUR/mois
S3 + monitoring + CI 100-200 EUR/mois
Total cloud 800-1500+ EUR/mois

Économie self-hosted : 620-1320 EUR/mois, soit 7 500-15 800 EUR/an.


Voir aussi

📄 README.md

Chemin: 04_INFRA_DEPLOIEMENT/Architecture_Serveurs/README.md

Architecture des serveurs Talas

Ce dossier décrit la topologie technique de l’infrastructure du projet Talas : machines, rôles, réseaux, données, sécurité.

Objectifs :

Contenu recommandé :

Important : cette documentation doit être à jour et exportable pour audit ou partage technique.

📄 PROCEDURES_DEPLOIEMENT.md

Chemin: 04_INFRA_DEPLOIEMENT/CI_CD/PROCEDURES_DEPLOIEMENT.md

Procédures de Déploiement Veza

Du poste développeur à la production sur les R720. Prérequis : lire [[04_INFRA_DEPLOIEMENT/Architecture_Serveurs/ARCHITECTURE_INFRA]] pour comprendre la topologie. Source : code dans /home/senke/git/talas/veza/, Ansible dans 04_INFRA_DEPLOIEMENT/Ansible/ Dernière mise à jour : 27 mars 2026.


1. Environnements

Environnement Serveur APP_ENV Description
Développement Poste local development Docker Compose pour l'infra, services en hot reload
Staging R720 #2 (conteneur dédié) staging Réplique de prod avec données de test
Production R720 #1 production Blue-green via HAProxy, monitoring actif

Différences clés

Aspect Dev Staging Prod
CORS Wildcard * Domaines staging Domaines stricts
CSRF (Redis) Optionnel Obligatoire Obligatoire
Swagger / pprof Activé Activé Désactivé
Logs Texte, DEBUG JSON, INFO JSON, WARN+
ClamAV Optionnel Recommandé Obligatoire
Rate limiting Souple Modéré Strict (DDoS : 1000/s global, 100/s par IP)

2. Setup développeur

Prérequis

Outil Version minimum Vérification
Go 1.24+ go version
Rust + Cargo Stable rustc --version
Node.js 20+ node --version
Docker + Compose 24+ docker --version
Make make --version
Git git --version

Installation

# 1. Cloner le monorepo
git clone <url-gitea>/talas/veza.git
cd veza

# 2. Copier et configurer l'environnement
cp .env.example .env
# Éditer .env : ajuster les ports si conflit

# 3. Lancer l'infrastructure (PostgreSQL, Redis, RabbitMQ, MinIO, ES, ClamAV)
docker-compose up -d

# 4. Appliquer les migrations
cd veza-backend-api
go run ./cmd/migrate_tool/main.go up
cd ..

# 5. Lancer les services
make dev          # Stack complète
# OU individuellement :
make dev-web              # Frontend seul (port 5173)
make dev-backend-api      # Backend Go (port 18080)
make dev-stream-server    # Stream Rust (port 18082)

Commandes Makefile courantes

make dev              # Stack complète avec hot reload
make dev-full         # Tous les services locaux
make infra            # Infrastructure Docker seule
make build            # Build production de tous les conteneurs
make test             # Tous les tests
make test-backend     # Tests Go
make test-frontend    # Tests Vitest
make test-e2e         # Tests Playwright end-to-end
make migrate-up       # Migrations DB
make migrate-down     # Rollback dernière migration

Frontend avec mocks (sans backend)

npm run dev:mocks     # Active MSW (Mock Service Worker)

3. Pipeline CI/CD

Quality gates (avant merge)

Outil Langage Seuil
golangci-lint Go Zéro erreur
cargo clippy Rust Zéro warning
ESLint + tsc --noEmit TypeScript Zéro erreur
npm audit Node.js Pas de vulnérabilité critique
govulncheck Go Pas de vulnérabilité connue
Trivy Docker Pas de CVE critique dans les images
Tests Go Go Couverture ≥ 60%
Playwright E2E 17 suites passent

Workflow type

Commit → Push → CI (lint + tests + security scan)
         ↓
     Review (PR)
         ↓
     Merge → staging auto-deploy
         ↓
     Validation manuelle
         ↓
     Tag release → production deploy

CI/CD prévu sur Woodpecker CI (self-hosted, compatible Gitea/Forgejo).


4. Déploiement staging

# Sur R720 #2 (via JumpServer)

# 1. Pull des images
docker-compose -f docker-compose.staging.yml pull

# 2. Migrations
docker-compose -f docker-compose.staging.yml run --rm backend \
  go run ./cmd/migrate_tool/main.go up

# 3. Redémarrer les services
docker-compose -f docker-compose.staging.yml up -d

# 4. Vérifier la santé
curl -s https://staging.veza.fr/api/v1/healthz
curl -s https://staging.veza.fr/api/v1/readyz

5. Déploiement production (blue-green)

Le déploiement production utilise un schéma blue-green via HAProxy. Deux jeux de conteneurs coexistent ; HAProxy bascule entre les deux.

Procédure

# Sur R720 #1 (via JumpServer)

# 1. Identifier le slot actif (blue ou green)
# Vérifier la configuration HAProxy pour savoir quel backend est actif

# 2. Construire et démarrer le slot inactif
docker-compose -f docker-compose.prod.yml build
docker-compose -f docker-compose.prod.yml up -d veza-backend-green veza-stream-green veza-frontend-green

# 3. Appliquer les migrations (si nécessaire)
# IMPORTANT : backup PG AVANT toute migration (voir §7)
docker-compose -f docker-compose.prod.yml run --rm backend-green \
  go run ./cmd/migrate_tool/main.go up

# 4. Vérifier la santé du slot inactif
curl -s http://localhost:18081/api/v1/healthz   # port du slot green
curl -s http://localhost:18081/api/v1/readyz

# 5. Basculer HAProxy vers le nouveau slot
# Éditer la configuration HAProxy pour pointer vers green
sudo systemctl reload haproxy

# 6. Vérifier la production
curl -s https://veza.fr/api/v1/healthz
curl -s https://veza.fr/api/v1/health/deep

# 7. Si OK : arrêter l'ancien slot (blue)
docker-compose -f docker-compose.prod.yml stop veza-backend-blue veza-stream-blue veza-frontend-blue

# 8. Si KO : rollback immédiat
# Repointer HAProxy vers l'ancien slot (blue)
sudo systemctl reload haproxy

Checklist pré-déploiement


6. Migrations base de données

Principes

Commandes

# Appliquer toutes les migrations en attente
go run ./cmd/migrate_tool/main.go up

# Rollback de la dernière migration
go run ./cmd/migrate_tool/main.go down

# Vérifier l'état des migrations
go run ./cmd/migrate_tool/main.go status

Procédure migration en production

  1. Backup : pg_dump -Fc veza > veza_pre_migration_$(date +%Y%m%d).dump
  2. Snapshot ZFS : zfs snapshot pool/pg@pre_migration_$(date +%Y%m%d)
  3. Appliquer la migration sur le slot inactif
  4. Vérifier : tester les endpoints critiques
  5. Si échec : restaurer depuis le backup ou le snapshot ZFS

7. Backup et restauration

PostgreSQL — PITR

Composant Description
WAL archiving Les Write-Ahead Logs sont archivés en continu vers R720 #2
Base backup pg_basebackup hebdomadaire (dimanche 03:00)
Rétention 7 jours de WAL + 4 base backups (1 mois)
Outil Ansible Rôle pg-wal-pull pour la réplication WAL

Restauration PITR

# 1. Arrêter PostgreSQL
sudo systemctl stop postgresql

# 2. Restaurer le base backup
pg_restore -d veza veza_backup.dump

# 3. Configurer le recovery target
echo "recovery_target_time = '2026-03-27 14:30:00'" >> recovery.conf

# 4. Démarrer PostgreSQL en mode recovery
sudo systemctl start postgresql
# PG rejoue les WAL jusqu'au point cible

Snapshots ZFS

# Snapshot manuel avant opération risquée
zfs snapshot pool/data@before_upgrade

# Liste des snapshots
zfs list -t snapshot

# Rollback vers un snapshot
zfs rollback pool/data@before_upgrade

MinIO (stockage objet)


8. Maintenance courante

Quotidien (automatisé)

Tâche Outil Fréquence
Health checks Prometheus + Alertmanager Toutes les 30s
Rotation des logs logrotate Quotidien
Scan SMART disques smartmontools + Zabbix Quotidien
Archivage WAL pg_wal_archive Continu

Hebdomadaire

Tâche Action
Base backup PostgreSQL pg_basebackup (dimanche 03:00)
Vérification espace disque Alertes Zabbix si > 80%
Mise à jour ClamAV signatures freshclam (automatique)
Revue des alertes Zabbix/Grafana Inspection manuelle

Mensuel

Tâche Action
Renouvellement certificats TLS Automatique (certbot + HAProxy)
Rotation des snapshots ZFS Supprimer snapshots > 1 mois
Mise à jour sécurité OS dnf upgrade --security
Test de restauration backup Restaurer un dump sur staging, vérifier

9. Troubleshooting rapide

Symptôme Diagnostic Action
502 Bad Gateway Service backend down docker-compose logs backend → redémarrer
Latence élevée PostgreSQL surchargé pg_stat_activity, vérifier les requêtes longues
Espace disque plein Logs ou WAL non archivés du -sh /var/log/*, rotation, nettoyage WAL
Uploads échouent ClamAV down ou MinIO inaccessible Vérifier les deux services, logs
429 Too Many Requests Rate limiting Normal si DDoS. Sinon ajuster les seuils

Voir aussi

📄 README.md

Chemin: 04_INFRA_DEPLOIEMENT/CI_CD/README.md

Intégration & Déploiement Continu (CI/CD)

Ce dossier contient les pipelines CI/CD (build, test, déploiement automatique) de Talas.

Objectifs :

Contenu recommandé :

Drone CI est conseillé si tu veux du 100 % open source, GitHub Actions si tu veux une intégration rapide.

📄 README.md

Chemin: 04_INFRA_DEPLOIEMENT/Docker_Incus/README.md

Conteneurisation — Docker & Incus

Ce dossier contient les fichiers de conteneurisation pour les services Talas.

Stratégie de conteneurisation

Talas utilise deux technologies complémentaires selon le cas d'usage :

Technologie Usage Pourquoi
Docker Services applicatifs (bases de données, queues, outils) Images standardisées, écosystème riche, docker-compose
Incus Machines complètes nécessitant un OS complet Isolation système, ZFS backing natif, meilleur pour les workloads persistants

Services Docker déployés

Développement (docker-compose.yml)

Service Image Port exposé Usage
postgres PostgreSQL 16 15432 Base de données principale
redis Redis 7 16379 Sessions, cache, rate limiting
rabbitmq RabbitMQ 3 15672 / 25672 Message broker (événements async)
clamav ClamAV 1.4 13310 Scan antivirus des uploads
minio MinIO 19000 Stockage objet S3-compatible
elasticsearch Elasticsearch 19200 Recherche full-text

Production (docker-compose.prod.yml)

Mêmes services avec en plus : - Volumes persistants (données sur pools ZFS) - Limites de ressources CPU/RAM par conteneur - Health checks sur tous les services - Restart policy : unless-stopped - Isolation réseau (réseaux Docker dédiés) - Logging centralisé vers Filebeat

Images applicatives

Service Dockerfile dev Dockerfile prod Base prod
Backend Go veza-backend-api/Dockerfile Dockerfile.production scratch (~15 Mo)
Stream Rust veza-stream-server/Dockerfile Dockerfile.production debian:bookworm-slim (~100 Mo)
Frontend React apps/web/Dockerfile Dockerfile.production nginx:latest (~30 Mo)

Incus

Incus (fork de LXD) est utilisé pour les workloads nécessitant un OS complet :

Configuration : - Pool de stockage ZFS backing (zfs create pool/incus) - Profils par type de workload - Gestion des permissions via groupe incus-admin - subuid/subgid configurés pour l'isolation

Commandes courantes :

incus launch images:debian/12 mon-conteneur     # Créer
incus list                                        # Lister
incus exec mon-conteneur -- bash                  # Shell
incus project create prod                         # Projet
incus project switch prod                         # Changer

Installation documentée dans 04_INFRA_DEPLOIEMENT/Notes_Operations/install_incus.txt.

Stockage et persistance

Type de données Stratégie Backing
PostgreSQL (WAL + data) Volume Docker sur SSD ZFS mirror
Redis (RDB + AOF) Volume Docker sur SSD ZFS mirror
MinIO (audio, fichiers) Volume Docker sur HDD ZFS mirror pool (1.8 To)
Elasticsearch (indices) Volume Docker sur HDD 15K ZFS mirror
Backups PITR Volume dédié sur HDD ZFS snapshots

Rôles Ansible associés

Rôle Description
docker Installation et configuration Docker
minio Configuration MinIO S3

Contenu de ce dossier

Voir aussi

📄 README.md

Chemin: 04_INFRA_DEPLOIEMENT/Monitoring_Logs/README.md

Monitoring & Logs — Supervision technique

Ce dossier regroupe les outils de supervision système, applicative, réseau et la collecte/visualisation des logs.

Stack déployée

Talas utilise deux systèmes de monitoring complémentaires :

Monitoring d'infrastructure — Zabbix

Composant Rôle Serveur
Zabbix Server Collecte, alertes, corrélation R720 #2
Zabbix Agent Métriques système (CPU, RAM, disques, réseau) R720 #1 + #2

Alertes multi-canal : - Matrix / Element (notifications temps réel) - Jira (tickets incidents) - MS Teams (si nécessaire)

Monitoring disques : SMART via smartmontools — critique pour les ~100 disques d'occasion.

Monitoring applicatif — Prometheus + Grafana

Composant Rôle Serveur
Prometheus Scrape des endpoints /metrics des services Veza R720 #2
Grafana Dashboards de visualisation R720 #2
Alertmanager Routage des alertes Prometheus R720 #2

Endpoints scrapés : - Backend Go : /metrics (port 18080) - Stream Server Rust : /metrics (port 18082) - PostgreSQL : via postgres_exporter - Redis : via redis_exporter - HAProxy : stats intégrées

Logs centralisés — ELK Stack

Composant Rôle Serveur
Filebeat Agent de collecte de logs R720 #1 (sources)
Elasticsearch Indexation et recherche des logs R720 #2
Kibana Interface de visualisation et requêtes R720 #2

Logs collectés : - Logs Coraza WAF (parsing OWASP CRS via ingest pipeline grok) - Logs HAProxy (accès, erreurs) - Logs applicatifs Veza (backend Go, stream Rust) - Logs système (syslog via rsyslog)

Error tracking — Sentry (optionnel)

Rôles Ansible associés

Rôle Description
zabbix_server Installation et configuration Zabbix + intégrations alertes
filebeat Installation Filebeat + modules Apache/HAProxy/Kibana
rsyslog Centralisation syslog

Contenu de ce dossier

Voir aussi

📄 debug_no_ssh_vpn.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/debug_no_ssh_vpn.md

nmilovanovic@fedora:~/git/cosium/IT/ansible$ nmap -Pn -p 22 pad-rp-1.p.neox-it.cloud Starting Nmap 7.92 ( https://nmap.org ) at 2025-05-06 17:14 CEST Nmap scan report for pad-rp-1.p.neox-it.cloud (10.24.104.2) Host is up.

PORT STATE SERVICE 22/tcp filtered ssh

Nmap done: 1 IP address (1 host up) scanned in 2.06 seconds nmilovanovic@fedora:~/git/cosium/IT/ansible$ ssh -vvv root@pad-rp-1.p.neox-it.cloud OpenSSH_9.6p1, OpenSSL 3.2.2 4 Jun 2024 debug1: Reading configuration data /home/nmilovanovic/.ssh/config debug1: Reading configuration data /etc/ssh/ssh_config debug3: /etc/ssh/ssh_config line 55: Including file /etc/ssh/ssh_config.d/50-redhat.conf depth 0 debug1: Reading configuration data /etc/ssh/ssh_config.d/50-redhat.conf debug2: checking match for 'final all' host pad-rp-1.p.neox-it.cloud originally pad-rp-1.p.neox-it.cloud debug3: /etc/ssh/ssh_config.d/50-redhat.conf line 3: not matched 'final' debug2: match not found debug3: /etc/ssh/ssh_config.d/50-redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1 (parse only) debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config debug3: gss kex names ok: [gss-curve25519-sha256-,gss-nistp256-sha256-,gss-group14-sha256-,gss-group16-sha512-,gss-gex-sha1-,gss-group14-sha1-,gss-group1-sha1-] debug3: kex names ok: [curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1] debug1: configuration requests final Match pass debug1: re-parsing configuration debug1: Reading configuration data /home/nmilovanovic/.ssh/config debug1: Reading configuration data /etc/ssh/ssh_config debug3: /etc/ssh/ssh_config line 55: Including file /etc/ssh/ssh_config.d/50-redhat.conf depth 0 debug1: Reading configuration data /etc/ssh/ssh_config.d/50-redhat.conf debug2: checking match for 'final all' host pad-rp-1.p.neox-it.cloud originally pad-rp-1.p.neox-it.cloud debug3: /etc/ssh/ssh_config.d/50-redhat.conf line 3: matched 'final' debug2: match found debug3: /etc/ssh/ssh_config.d/50-redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1 debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config debug3: gss kex names ok: [gss-curve25519-sha256-,gss-nistp256-sha256-,gss-group14-sha256-,gss-group16-sha512-,gss-gex-sha1-,gss-group14-sha1-,gss-group1-sha1-] debug3: kex names ok: [curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1] debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/nmilovanovic/.ssh/known_hosts' debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/nmilovanovic/.ssh/known_hosts2' debug2: resolving "pad-rp-1.p.neox-it.cloud" port 22 debug3: resolve_host: lookup pad-rp-1.p.neox-it.cloud:22 debug3: channel_clear_timeouts: clearing debug3: ssh_connect_direct: entering debug1: Connecting to pad-rp-1.p.neox-it.cloud [10.24.104.2] port 22. debug3: set_sock_tos: set socket 3 IP_TOS 0x48 debug1: connect to address 10.24.104.2 port 22: Connection timed out ssh: connect to host pad-rp-1.p.neox-it.cloud port 22: Connection timed out

📄 README.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/README.md

JumpServer Docs

Python3

开始

git clone --depth=1 https://github.com/jumpserver/docs
cd docs
pip install -r requirements/requirements.txt

运行

mkdocs serve

编译

mkdocs build

帮助

mkdocs --help

📄 contributor.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/about_us/contributor.md

贡献者名单

!!! tip "感谢为 JumpServer 做出的贡献的所有朋友,世界因你们而不同"

!!! tip "" - 老广 <广宏伟> JumpServer 创始人 - halcyon <王墉> DevOps 资深开发者,JumpServer 第二号开发者 - jiaxiangkong <陈尚委> JumpServer 测试运营 - liuz <刘正> 全栈工程师,编写了 Web Terminal 大部分代码 - yumaojun03 <喻茂峻> DevOps 资深开发者,擅长 Python、Go 以及 PaaS 平台开发 - kelianchun <柯连春> DevOps 资深开发者,修复了很多 Bugs - 小彧 <李磊> Django 资深开发者,为用户模块贡献了很多代码,在 JumpServer 艰难时期给予了帮助 - sofia <周小侠> 资深前端工程师,前端代码贡献者 - q4speed <莫鹍> 架构师,Guacamle 集成贡献者,为支持 Windows 做出了重大贡献 - liqiang-fit2cloud <张立强> 版本测试,给资产树设计贡献了很多建议 - wojiushixiaobai <吴育煌> 完善文档,测试 Bug,热心帮助过很多朋友 - Qiuser <邱景玻> 测试 bug,热心帮助过很多朋友 - 小白 <白江杰> 1.0 至今 JumpServer 核心开发者 - LeeEirc <李智> 高级研发工程师,擅长 Go 平台开发,KoKo 组件开发者 - Orange <马真爽> 核心开发者,负责 JumpServer 前端工作 - 八千流 <蒋育敏> 核心测试(辅助开发)负责 JumpServer 的测试

📄 architecture.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/architecture.md

系统架构

1 应用架构

!!! tip "" - JumpServer 采用分层架构,分别是负载层、接入层、核心层、数据层、存储层。 - JumpServer 应用架构图如下: architecture_01

2 组件说明

!!! tip "" - Core 组件是 JumpServer 的核心组件,其他组件依赖此组件启动。 - Koko 是服务于类 Unix 资产平台的组件,通过 SSH、Telnet 协议提供字符型连接。 - Lion 是服务于 Windows 资产平台的组件,用于 Web 端访问 Windows 资产。 - XRDP 是服务于 RDP 协议组件,该组件主要功能是通过 JumpServer Client 方式访问 windows 2000、XP 等系统的资产。 - Razor 是服务于 RDP 协议组件,JumpServer Client 默认使用 Razor 组件访问 Windows 资产。 - Magnus 是服务于数据库的组件,用于通过客户端代理访问数据库资产。 - Kael 是服务于 GPT 资产平台的组件,用于纳管 ChatGPT 资产。 - Chen 是服务于数据库的组件,用于通过 Web GUI 方式访问数据库资产。 - Celery 是处理异步任务的组件,用于执行 JumpServer 相关的自动化任务。 - Video 是专门处理 Razor 组件和 Lion 组件产生录像的格式转换工作,将产生的会话录像转化为 MP4 格式。 - Panda 是基于国产操作系统的应用发布机,用于调度 Virtualapp 应用。

3 逻辑架构

!!! tip "详见 源码部署"

📄 best_practices.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/best_practices.md

最佳实践

!!! tip "" - JumpServer 用户权限体系的使用实践{:target="_blank"} - JumpServer 主备部署的录像同步{:target="_blank"} - JumpServer 超长时间录像播放异常的临时解决方案{:target="_blank"} - JumpServer 对接 Syslog 日志系统{:target="_blank"} - JumpServer 如何增强用户登录的安全性{:target="_blank"} - JumpServer 自定义用户角色权限{:target="_blank"} - JumpServer 常用的 MFA 工具{:target="_blank"} - 通过开源软件 XRDP 实现堡垒机远程 Linux(Ubuntu) 桌面{:target="_blank"} - 如何解决不同区域资产连接查询缓慢问题?{:target="_blank"} - Razor 组件证书不可信任导致资产无法连接{:target="_blank"} - VSCode 连接 JumpServer 资产{:target="_blank"} - 会话共享 && 多用户协同操作{:target="_blank"} - 同一个系统用户对不同的资产不同的密码{:target="_blank"}

📄 change_log.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/change_log.md

更新日志

v3.10.11

2024年6月20日 !!! info "新增功能 🌱" - feat: 支持纳管 Dameng 数据库 - feat: 支持命令存储 Elasticsearch version 8 数据库 - feat: 支持批量测试资产可连接性

!!! summary "功能优化 🚀" - perf: 优化禁用 SSH Client 的设置后,所有通过 ssh、sftp 和 telnet 协议进行的会话连接将不再显示客户端的连接方式 - perf: 优化支持配置大文件上传的临时目录(FILE_UPLOAD_TEMP_DIR) - perf: 优化仪表盘加载速度 - perf: 优化使用随机策略获取标签匹配的远程应用发布机 - perf: 优化移除 django-rest-swagger 依赖库(感谢@Moraxyc) - perf: 优化当所有应用发布机不可用时,资产连接弹窗中禁用远程应用连接按钮 - perf: 优化用户操作日志资源显示没有翻译的问题 - perf: 优化账号列表不显示 params 属性字段 - perf: 优化资产硬件信息显示为 - 的问题 - perf: 优化录像上传到转码服务后及时删除录像(Lion) - perf: 优化账号权限导致部分模式的表和视图无法查询的问题(Chen) - perf: 优化升级 Spring Boot 版本到 3.3.0 ,解决低版本存在漏洞的问题(Chen) - perf: 优化用户登录后的重置密码页面对密码进行加密传输

!!! success "问题修复 🐛" - fix: 修复克隆资产时没有同时克隆账号的问题 - fix: 修复用户登录报错刷新浏览器后依旧报错的问题(登录超时,请重新登录) - fix: 修复系统任务手动执行时报错的问题 - fix: 修复 Windows 资产同步删除账号失败的问题 - fix: 修复所有用户都可查看 Celery 任务执行日志的问题(只有管理员、审计员、运行用户可查看) - fix: 修复用户授权树搜索不生效的问题 - fix: 修复 v2 升级 v3 版本时超过 10000 数量的授权账号没有同步成功的问题 - fix: 修复 OAuth2 认证方式可以跳过 仅允许存在用户登录 的限制策略 - fix: 修复 LDAP 定时同步任务消息通知不到所有人的问题 - fix: 修复资源选择组件动态搜索无资源后不再显示资源的问题 - fix: 修复 Crontab 组件设置分钟不生效的问题 - fix: 修复使用 SFTP 工具连接资产时经常断开的问题(KoKo) - fix: 修复工单页面待我审批默认显示打开的工单【企业版】 - fix: 修复账号备份、云同步定时任务不执行的问题【企业版】 - fix: 修复 Oracle 数据库探活导致内存不释放的问题(Magnus)【企业版】 - fix: 修复金山云同步校验失败的问题【企业版】

v3.10.10

2024年5月16日 !!! summary "功能优化 🚀"
- perf: 优化支持云同步任务完成后自动删除云端已释放的资产【企业版】 - perf: 优化当资产总数 > 5000 时延迟 20s 刷新用户授权树(之前 > 2000) - perf: 优化 Web 资产详情自动代填的信息显示 - perf: 优化资产树节点支持拖拽操作 - perf: 优化创建、更新用户时的 MFA 选项根据系统设置全局状态配合显示 - perf: 优化 Luna 页面资产连接按钮不可点击时提示原因 - perf: 优化连接 Windows 资产全屏显示不完整的问题(Lion) - perf: 优化 Panda 组件支持使用自签名证书连接 Core 服务(Panda)【企业版】 - perf: 优化账号密钥使用长度为 8192 位的密钥时列表加载慢的问题

!!! success "问题修复 🐛" - fix: 修复 v2 升级 v3 版本时系统用户 su_from 没有同步的问题 - fix: 修复 v2 升级 v3 版本时授权中手动登录系统用户会显示为空字符串的问题 - fix: 修复 SESSION_EXPIRE_AT_BROWSER_CLOSE 配置开启后用户重置 MFA 失败的问题 - fix: 修复 Chrome 远程应用加载多个插件失败的问题 - fix: 修复社区版本使用过程中偶尔会出现资源创建按钮不可点击的问题 - fix: 修复 MySQL 数据库 Kill Session 失败的问题(Magnus)【企业版】 - fix: 修复 SQL Server 数据库使用微软客户端连接失败的问题(Magnus)【企业版】 - fix: 修复 ChatAI 显示异常问题(Kael)(All-in-One) - fix: 修复云同步任务针对火山引擎云服务商只能同步一页的问题【企业版】 - fix: 修复批量传输下载的文件名为 undefined 的问题 - fix: 修复 LDAP 服务端修改用户 OU 组织结构后无法登录的问题 - fix: 修复导出 CSV 文件属性值前缀为 0 时不显示的问题 - fix: 修复 LDAP 定时同步任务不执行的问题 - fix: 修复华为交换机执行命令报错的问题 - fix: 修复用户会话过期提示 500 的问题 - fix: 修复创建 es 命令存储后返回页面不正确的问题 - fix: 修复快捷命令使用 mysql 模块不支持在 MariaDB 数据库上执行命令的问题

v3.10.9

2024年4月23日 !!! summary "功能优化 🚀"
- perf: 优化连接 Kubernetes 资产账号没有 Namespace 权限时提示并允许直接连接 Cluster - perf: 优化用户频繁发送短信的提示信息 - perf: 优化 Web GUI 方式连接远程应用时使用平台中的 rdp 协议高级选项参数建立连接(Lion) - perf: 优化 Web 资产详情代填信息显示不准确的问题 - perf: 优化支持使用 MySQL 模块对 MariaDB 数据库执行快捷命令 - perf: 优化更新资产时当前页面打开的问题(选中节点后创建/更新资产在新窗口打开,直接更新在当前窗口打开)

!!! success "问题修复 🐛" - fix: 修复 Ansible 任务运行使用 NFS 挂载目录时执行失败的问题(使用 TCP 通信)(Receptor) - fix: 修复仪表盘页面会话用户、资产排名数量不准确的问题 - fix: 修复快捷命令中账号选择列表的排序问题 - fix: 修复命令记录取消 output 字段长度限制 - fix: 修复自定义平台的华为交换机执行命令失败的问题,华为交换机平台的名称中必须含 华为 或 huawei(不区分大小写) 关键字 - fix: 修复当内置 Linux 平台 id 不为 1 时,创建网关报错的问题(issue) - fix: 修复 gunicorn.log 系统日志文件中频繁出现 Profile API(/api/v1/users/profile/)请求的问题 - fix: 修复用户首次登录时卡住的问题(SYSTEM 组织的用户)【企业版】

v3.10.8

2024年4月18日 !!! info "新增功能 🌱" - feat: 新增支持 Ansible 任务在沙箱中运行,运行环境为 jms_receptor 容器,以提高任务运行的安全性,避免可能导致敏感信息泄漏的情况 - feat: 新增支持中文繁体语言(感谢 @elf168 贡献) - feat: 新增支持通过 Telnet 方式测试资产可连接性 - feat: 新增支持管理员一键卸载已安装的远程应用 - feat: 新增支持用户手动停止正在执行的快捷命令任务 - feat: 新增支持开启/关闭系统任务执行(定时任务) - feat: 新增支持用户对 HUAWEI 交换机资产执行快捷命令 - feat: 新增支持 Linux、Windows、远程应用等资产使用客户端方式连接时的 Token 复用功能 - feat: 新增支持一键导出批量命令执行的日志信息 - feat: 新增支持在用户详情授权的资产列表中查看某个资产授权的账号 - feat: 新增支持用户配置资产连接默认打开方式(当前窗口/新窗口) - feat: 新增支持管理员监控用户使用本地客户端方式连接的 Windows 会话和远程应用会话(Razor)【企业版】 - feat: 新增支持账号改密任务执行记录进行批量重试【企业版】 - feat: 新增支持账号收集任务导出收集的账号信息数据【企业版】 - feat: 新增支持管理员使用 Markdown 格式配置页脚内容,例如备案信息等【企业版】 - feat: 新增支持管理员同时配置并启用飞书和 Lark(飞书国际版)认证服务【企业版】 - feat: 新增支持火山引擎云服务(云同步资产)【企业版】 - feat: 新增支持测试云账号时选择地域(云同步账号)【企业版】 - feat: JumpServer Client Windows 客户端添加数字签名证书 - feat: JumpServer Client 支持 XFTP 应用 - feat: Installer 安装部署工具支持部分配置项的快捷配置操作(如:配置 NTP 同步、初始化配置文件、配置服务端口等)

!!! summary "功能优化 🚀"
- perf: 优化 MongoDB 数据库资产支持配置 authSource 认证数据库 - perf: 优化资产、网域、网关之间的操作体验 - perf: 优化创建网域时资产为非必填项,允许管理员先创建网域后创建资产 - perf: 优化导出资源的 excel、csv 文件时默认打开不运行 Excel 指令 - perf: 优化支持发布机仅初始化配置 - perf: 优化资产授权规则导出文件时没有授权资产和用户的问题 - perf: 优化 Linux 类型的资产可选择使用低版本(5.x、6.x)或高版本的 SSH 协议(可在新建 Linux 平台的 ssh 协议中进行选择) - perf: 优化支持用户配置资产连接默认方式(当前窗口、新窗口) - perf: 优化 Windows 会话的录像播放器显示问题 - perf: 优化资产授权规则账号数量统计不准确的问题(包含指定账号的情况) - perf: 优化资产授权列表显示出授权的有效期字段信息 - perf: 优化 LDAP 用户认证支持配置 user_dn 缓存时间,解决用户量较多时用户认证较慢的问题 - perf: 优化命令记录列表点击转到后进行颜色标识,刷新页面后恢复默认颜色 - perf: 优化 Ansible 使用 ansible_winrm 模块执行任务的超时时间(120s) - perf: 优化工作台我的资产页面根据资产可连接性排序不生效的问题 - perf: 优化资产修改激活状态没有记录操作日志的问题 - perf: 优化所有资源列表的默认排序规则(一般资源默认按照 name 排序,任务执行记录默认按照 date_started 降序排序) - perf: 优化使用分页方式定时清理会话记录,解决数据库连接超时问题 - perf: 优化支持配置文件导出资源时的最大数量(MAX_LIMIT_PER_PAGE -> config.txt) - perf: 优化用户个人设置操作记录翻译文案 - perf: 优化校验第三方登录用户的邮箱格式,如果不正确则使用默认邮箱格式 - perf: 优化提高短信发送任务的优先级 - perf: 优化用户执行的 Celery 任务日志查看权限(只有当前用户可查看) - perf: 优化资产会话支持显示和导出时长(duration)字段 - perf: 优化审计台仪表盘命令记录总数为数据库和 Elasticsearch 命令存储服务的总和 - perf: 优化 LDAP 系统设置测试用户登录时不需要管理员提前手动测试 LDAP 服务的可连接性 - perf: 优化移动端创建资产授权时用户字段设置遮挡的问题 - perf: 优化连接远程应用会话新增 Alt + Tab 快捷键支持(Lion) - perf: 优化 S3 录像存储自定义域名地址时可能会上传失败的问题(KoKo、Lion、Razor) - perf: 优化取消客户端方式连接数据库命令记录长度限制长度(Magnus) - perf: 优化 SFTP 会话的文件重命名操作使用文件上传权限进行控制(KoKo) - perf: 优化控制台页面的组织选择问题【企业版】 - perf: 优化支持在全局组织中显示用户所属的组织及角色【企业版】 - perf: 优化账号收集任务可单独添加资产【企业版】 - perf: 优化界面设置页面主题中 Logo 图片预览的背景颜色【企业版】 - perf: 修复工单系统搜索过滤申请人失败的问题【企业版】 - perf: 优化账号改密任务执行记录可查看当前执行中的密码信息【企业版】 - perf: 优化取消系统设置中 Chat-AI 功能参数的长度限制【企业版】 - perf: 优化关闭阿里专有云的证书校验(云同步资产)【企业版】

!!! success "问题修复 🐛" - fix: 修复页面中的长文本输入框存在跨站脚本攻击(Cross-Site Scripting,XSS)的安全漏洞(感谢 西卡德高安全团队 发现并上报到 JumpServer 安全团队) - fix: 修复用户登录页面自动登录不能勾选的问题 - fix: 修复克隆 Web 资产时标签选择器信息丢失的问题 - fix: 修复 Celery 异步任务经常卡住不执行的问题(由于 Redis Lock 竞争导致) - fix: 修复忘记密码短信验证码过期的问题 - fix: 修复用户会话偶尔会过期,需要重新登录的问题 - fix: 修复用户使用 SSO 方式认证时没有执行用户登录规则校验的问题 - fix: 修复管理员手动下线用户失败的问题 - fix: 修复用户列表过滤用户组织角色不生效的问题 - fix: 修复用户收藏夹文件中的资产会丢失的问题 - fix: 修复用户登录资产时手动输入的 username 没有进行登录资产 ACL 控制的问题【企业版】 - fix: 修复 FTP 审计文件没有正常清理的问题 - fix: 修复客户端方式连接 Redis 数据库 Value 值较大导致操作失败的问题(Magnus) - fix: 修复使用 WinSCP 工具连接资产下载文件时报错的问题(KoKo) - fix: 修复 Luna 页面用户会话过期提醒时,点击确定无法返回登录页面的问题 - fix: 修复 Kael 组件不启用时 Luna 页面 Websocket 报错的问题 - fix: 修复 Web 方式连接 Kubernetes 资产和远程应用时,Luna 页面没有浮窗图标的问题(Lion) - fix: 修复点击管理页面 Logo 图标时显示卡住的问题 - fix: 修复创建账号时没有默认资产的问题 - fix: 修复会话详情中文件传输列表过滤失败的问题 - fix: 修复录像存储服务配置无效导致录像下载失败的问题 - fix: 修复测试 RDP 协议资产可连接性时使用的 python 解释器路径不对的问题 - fix: 修复自定义短信测试结果总是显示成功的问题 - fix: 修复关闭作业中心配置后用户批量上传文件报错的问题 - fix: 修复 Tcpdump 系统工具捕获的 IP 为空时解析不到的问题 - fix: 修复 celery-beat 定时任务调度服务开启在 Redis SSL 的情况下启动失败的问题 - fix: 修复用户执行快捷命令时,当资产不存在指定账号的情况下,账号策略选择仅特权用户执行不生效的问题 - fix: 修复全局组织中组织角色用户数量不准确的问题【企业版】 - fix: 修复工单二级审批通过后一级审批管理员看不到工单的问题【企业版】 - fix: 修复资产登录 ACL 规则属性为标签时规则不生效的问题【企业版】 - fix: 修复 OAuth2 未激活用户登录认证时会出现重复跳转登录的问题【企业版】 - fix: 修复资产登录规则中设置的节点或资产资源被删除后,用户连接资产会报错的问题【企业版】 - fix: 修复云同步任务中有多个策略时部分策略不生效的问题【企业版】

v3.10.7

2024年3月27日 !!! success "问题修复 🐛" - fix: 修复 Celery 定时任务偶尔不执行的问题 - fix: 修复 JumpServer 作业管理中 Ansible Playbook 文件存在 JinJa2 模版代码注入导致的 Celery 容器远程执行的漏洞 - fix: 修复 JumpServer 作业管理中 Ansible Playbook 文件存在参数验证缺陷导致的 Celery 容器远程执行的漏洞 - fix: 修复 Oracle 数据库使用 Service name 连接报错的问题(Chen)【企业版】

v3.10.6

2024年3月19日 !!! success "问题修复 🐛" - fix: 修复使用 Token 连接资产特殊情况下报错的问题(当设置的登录资产规则中资源对象被删除时) - fix: 修复作业中心 Playbook 文件存在用户权限隔离不生效的问题 - fix: 修复作业中心 Job、JobExecution 资源存在用户权限隔离不生效的问题

v3.10.5

2024年3月5日 !!! success "问题修复 🐛" - fix: 修复集群环境下连接 Oracle 数据库可能导致服务停止的问题(Magnus)【企业版】 - fix: 修复控制台仪表盘中会话用户、会话资产排序数量均为 1 的问题 - fix: 修复特殊情况下组件上传录像文件到 Ceph 存储时会失败的问题(KoKo、Lion) - fix: 修复连接远程应用会话时没有右侧浮窗图标的问题(Lion) - fix: 修复资源搜索结果刷新页面后失效的问题 - fix: 修复自动任务跳转执行列表显示结果不准确的问题

!!! summary "功能优化 🚀" - perf: 优化组件会话使用 rz 命令下载文件时大小限制为 500M 以内(KoKo)

v3.10.4

2024年2月29日 !!! info "新增功能 🌱" - feat: 支持配置申请资产工单的资产可选范围【企业版】 - feat: 支持使用 win_shell 模块执行快捷命令 - feat: 支持使用 winrm 协议上传文件 - feat: 支持批量测试资产账号可连接性 - feat: 支持批量更新资产账号信息 - feat: 支持设置用户改密日志记录保留天数 - feat: 支持查看资产会话详细活动日志 - feat: 支持用户手机号国际区号选择 - feat: 支持 MFA 软件下载二维码图片自定义上传 - feat: 支持账号模版的文件导入、导出功能 - feat: 支持免密审批申请资产工单【企业版】 - feat: 支持通过标签选择资产(账号改密、账号推送任务)【企业版】

!!! summary "功能优化 🚀" - perf: 优化OAuth2 用户认证获取 Token 信息支持 POST_DATA 和 POST_JSON 两种方式【企业版】 - perf: 优化用户会话过期时间根据用户空闲时间进行计算 - perf: 优化系统任务列表查询操作提升响应速度 - perf: 优化标签搜索过滤功能,支持使用属性选择的资源进行过滤 - perf: 优化账号改密任务增加执行结果汇总信息【企业版】 - perf: 优化使用新的钉钉登录接口进行用户认证【企业版】 - perf: 优化资产授权用户信息不显示组件用户 - perf: 优化自动化任务默认按优先级排序 - perf: 优化账号收集任务支持对资产名称模糊搜索【企业版】 - perf: 优化作业审计日志添加任务类型信息显示 - perf: 优化定时任务运行周期时间限制不小于 10 分钟 - perf: 优化会话详情中增加文件传输审计日志记录 - perf: 优化创建资产授权规则时选择资产弹窗页面点击遮罩不关闭弹窗 - perf: 优化创建账号模版支持上传密钥文件 - perf: 优化操作日志支持通过资源类型进行搜索 - perf: 优化 Web 终端页面资产连接方式排列显示问题 - perf: 优化 Web 终端页面统一智能问答和会话悬浮按钮显示 - perf: 优化用户 SSH 连接资产后退出,命令行返回会延迟 2s 的问题(KoKo) - perf: 优化用户 SSH 登录失败后强制重置用户 Session(KoKo) - perf: 优化连接 Windows 资产时用户名支持以 # 作为分隔符(Razor)【企业版】

!!! success "问题修复 🐛" - fix: 修复账号改密密钥为 None 时报错的问题【企业版】 - fix: 修复下载的 RDP 文件中地址字段为空的问题 - fix: 修复收集 Windows 系统账号失败的问题【企业版】 - fix: 修复 Oracle 数据库用户为 sysdba 类型时,账号改密、账号推送、账号测试任务会执行失败的问题【企业版】 - fix: 修复工单审批时间记录不准确问题【企业版】 - fix: 修复资产过期提示消息发送失败的问题 - fix: 修复控制台仪表盘会话用户、会话资产排序不准确的问题 - fix: 修复用户登录后仪表盘显示 403 无权限的问题 - fix: 修复用户登录资产后没有发送登录提醒消息的问题【企业版】 - fix: 修复登录页面提示 <登录超时,请重新登录> 的问题 - fix: 修复 LDAP 用户导入偶尔超时的问题 - fix: 修复 Core、Celery 组件状态偶尔离线的问题 - fix: 修复命令上传由于 input 长度限制导致上传失败的问题 - fix: 修复 SAML2 用户认证偶现 502 报错的问题(感谢 @mjwtc0722 贡献) - fix: 修复 Web 资产的选择器与资产平台不一致的问题 - fix: 修复资产详情中推送账号的参数没有使用平台参数的问题【企业版】 - fix: 修复 Web 终端页面多个 Tab 超出页面宽度时显示不全的问题 - fix: 修复账号备份选择 SFTP 存储有多个时可能导致任务异常的问题 - fix: 修复 MySQL 资产连接输入中文乱码的问题(KoKo) - fix: 修复 ClickHouse 数据库校验密码失败的问题(KoKo) - fix: 修复通过网关连接 AWS Redis 数据库失败的问题(KoKo) - fix: 修复日志中出现大量 ERROR 日志信息的问题(Magnus)【企业版】 - fix: 修复 AWS Oracle 连接耗时太长导致无限等待的问题(Chen)【企业版】 - fix: 修复录像上传 S3 失败的问题(Lion)

v3.10.3

2024年1月25日 !!! success "问题修复 🐛" - fix: 修复 Redis 密码包含特殊字符时 jms_celery 容器启动失败的问题 - fix: 修复资产授权列表用户、用户组等资源数量计算不准确的问题 - fix: 修复 Web CLI 连接 MySQL 数据库时无法输入中文的问题 - fix: 修复校验未活跃用户任务执行报错的问题

v3.10.2

2024年1月18日 !!! info "新增功能 🌱" - feat: 资产账号密码历史记录支持设置保留数量 - feat: 邮件服务支持使用 Exchange 协议 - feat: 支持配置 RADIUS_ATTRIBUTES 属性(配置文件,查看参数列表) - feat: LDAP 定时同步用户完成后支持发送消息通知功能 - feat: 支持 SQL Server 数据库连接支持命令审计(Magnus)【企业版】

!!! summary "功能优化 🚀" - perf: 优化用户授权资产树加载速度 - perf: 优化支持 Redis 密码使用特殊字符(配置文件) - perf: 优化同步 LDAP 用户时,用户组只移除 LDAP 同步过来的用户组(以 AD 开头的用户组名称) - perf: 优化资产标签绑定逻辑,解决主机等列表不显示绑定标签的问题 - perf: 优化使用 Nginx 处理静态资源,解决会话录像在线播放不能倍速播放的问题(mp4 格式) - perf: 优化标签导入和搜索问题 - perf: 优化 Web GUI 方式连接数据库时去掉超时时间限制(Chen)

!!! success "问题修复 🐛" - fix: 修复 UNION 的类型 character varying 和 uuid 不匹配的问题(感谢 @zhoufaming 贡献) - fix: 修复手机号加密导致忘记密码判断总是失败问题 - fix: 修复用户登录成功日志不显示的问题 - fix: 修复账号备份和改密结果文件只导出一条记录的问题【企业版】 - fix: 修复账号改密更新日期没有同步更新的问题【企业版】 - fix: 修复导入自定义远程应用报错的问题 - fix: 修复资源列表按字段排序失效的问题 - fix: 修复组织管理员用户没有权限监控会话及查看录像问题【企业版】 - fix: 修复配置文件开启 HTTPS_PORT,升级后会被注释掉导致访问失败的问题

v3.10.1

2023年12月29日 !!! summary "功能优化 🚀"
- perf: 优化对批量文件上传执行结果进行汇总显示 - perf: 优化资产列表支持通过 Address 字段进行排序 - perf: 优化用户登录提醒和资产登录提醒文案,支持显示用户名信息 - perf: 优化上传远程应用的时间限制(默认 1h) - perf: 优化资产详情删除账号时增加确认弹窗 - perf: 优化手动登录的用户连接远程应用时可以下载 RDP 文件 - perf: 优化 cmdOutputParser reset 之前获取 PS1(KoKo)(感谢 @triptao) - perf: 优化批量更新资产标签不能使用的问题

!!! success "问题修复 🐛" - fix: 修复用户管理员 SESSION_COOKIE_AGE 会话时间后,用户打开 Luna 页面不会过期的问题 - fix: 修复我的资产页面标签列不显示的问题 - fix: 修复 Swagger API 页面打开报错的问题 - fix: 修复连接远程应用时标签匹配失败的问题 - fix: 修复 TiDB 作为后端数据库时服务启动失败的问题 - fix: 修复账号收集任务只收集了一个资产账号信息的问题 - fix: 修复资产账号不存在时同步删除任务执行报错的问题 - fix: 修复克隆网关资产平台显示错误的问题 - fix: 修复 Luna 页面使用快捷键切换会话窗口后会话无法操作的问题 - fix: 修复 Luna 页面连接 Windows 会话时的 Keyboard Layout 键盘映射问题(Lion) - fix: 修复 Luna 页面同时分屏连接多个会话时第一个会话会重复执行两次命令的问题 - fix: 修复 Luna 页面拖动会话窗口后关闭操作没有对应的问题 - fix: 修复云同步更新资产时无协议导致更新失败的问题【企业版】 - fix: 修复账号备份密码中包含特殊字符时备份失败的问题(如:\x)【企业版】

v3.10.0

2023年12月21日 !!! info "新增功能 🌱" - feat: 新增支持全局标签管理 - feat: 新增 Chat AI 小助手功能(ChatGPT) - feat: 新增支持同步删除远程服务器中的账号信息(账号收集) - feat: 新增虚拟应用功能,支持 Linux 系统作为远程应用发布机(Panda 组件)【企业版】 - feat: 新增 SQL Server 数据库支持通过本地客户端连接(Magnus)【企业版】 - feat: 新增批量文件发送功能 - feat: 新增 Slack 用户认证和消息通知功能【企业版】 - feat: 新增公司备案信息配置功能【企业版】 - feat: 新增用户详情支持查看用户资产会话信息 - feat: 新增资产详情支持查看历史命令执行记录 - feat: 新增 Spanish、Spanish (Latin American) keyboard Layout 选项(Luna) - feat: 新增支持深信服云平台、阿里云专有云、ZStack 等云服务商【企业版】 - feat: 新增 Luna 页面会话 Tab 的快捷键切换功能(Option + Left/Right) - feat: 新增 JumpServer Client 支持苹果系统签名认证

!!! summary "功能优化 🚀"
- perf: 优化任务延迟执行判断逻辑 - perf: 优化 LDAP 认证配置相关操作使用 Websocket 协议发送请求 - perf: 优化用户访问需要跳转 URL 时进行安全性检测 - perf: 优化工单处理提示消息页面【企业版】 - perf: 优化作业中心支持对配置网域的数据库批量执行命令 - perf: 优化所有 ViewSet 中 QuerySet 的 count 计算逻辑 - perf: 优化账号改密、账号推送任务中账号密码字段均支持除 {{ 开头、}} 结尾以外的任何特殊字符 - perf: 优化服务端点 Host 支持配置 IPv6 地址 - perf: 优化远程应用连接账号选择,不随机 js_ 开头的账号 - perf: 优化资产列表支持通过创建日期进行排序 - perf: 优化系统任务支持显示执行周期、下次执行开始时间等信息 - perf: 优化不支持录像的会话,在错误信息字段中显示原因 - perf: 优化获取客户端访问 IP 信息仅从 X-FORWARDED-FOR 中获取 - perf: 优化 RDP Client 会话连接时的高级选项支持 session bpp:i 参数设置(默认 32) - perf: 优化自动禁用用户默认排除 admin 用户 - perf: 优化通过资产授权使用模版添加的账号,同步给账号绑定源账号模版 - perf: 优化用户组添加全部用户时需要二次确认 - perf: 优化快捷命令发送到会话,支持选择发送范围(当前会话、所有会话)(Luna) - perf: 优化 Web GUI 方式连接 MySQL 数据库时支持禁用自动补全,提高数据库加载速度(Chen) - perf: 优化 SSH 终端连接资产后退出显示之前搜索的结果(KoKo) - perf: 优化兼容 MobaXterm 软件打开软连接目录的问题(KoKo) - perf: 优化执行 SQL 和 导出 SQL 查询结果的命令记录区分(Chen) - perf: 优化批量执行 MySQL 命令的工单审批逻辑(Chen)【企业版】

!!! success "问题修复 🐛" - fix: 修复自动禁用非活跃用户判断逻辑 - fix: 修复 Redis 服务开始 SSL 后 Websocket 连接失败的问题 - fix: 修复 MySQL 数据库资产开启、再关闭 SSL 后,测试可连接性失败的问题 - fix: 修复远程应用账号标记、释放逻辑,解决首次连接远程应用可能出现没有可用账号的问题 - fix: 修复登录第三方不存在的用户时,改密日志会增加的问题 - fix: 修复配置 Logo 后移动端不显示的问题【企业版】 - fix: 修复 arm 版离线包缺少 freerdp2-dev 依赖的问题 - fix: 修复华为云同步资产只同步 20 个的问题【企业版】 - fix: 修复华为云同步 CN_NORTH_1 区域不可用的问题【企业版】 - fix: 修复远程应用不能更新的问题 - fix: 修复资产选择节点组件点击取消不能关闭弹窗问题 - fix: 修复 Web SFTP 连接资产时刷新页面显示一些不存在的文件的问题(KoKo) - fix: 修复连接 MySQL 资产后可以执行系统命令的问题(KoKo) - fix: 修复双击数据表无法查询数据的问题(Chen) - fix: 修复使用 Oracle 10 的用户无法连接 Oracle 12 版本数据库的问题(Magnus)【企业版】

v3.9.3

2023年11月28日 !!! summary "功能优化 🚀" - perf: 优化 API 分页获取资源数量的查询逻辑,减少查询次数 - perf: 优化系统设置中界面设置的图片上传限制【企业版】 - perf: 优化 SFTP 对象存储禁止设置为默认存储 - perf: 优化 Luna 页面登录检查逻辑,避免多次请求 API

v3.9.2

2023年11月21日 !!! summary "功能优化 🚀" - perf: 优化 Delay run 运行逻辑,解决异步任务偶尔没有执行的问题

!!! success "问题修复 🐛"
- fix: 修复 MySQL 数据库资产开启 SSL 后再关闭,测试可连接性失败的问题 - fix: 修复 Redis 后端服务数据库由于 WebSocket 链接未断开导致连接数持续增长的问题

v3.9.1

2023年11月17日 !!! summary "功能优化 🚀" - perf: 优化 Luna 页面版本号格式 - perf: 优化快捷命令执行日志中显示 Debug 信息的问题 - perf: 优化禁用长时间未登录用户的逻辑

v3.9.0

2023年11月16日 !!! info "新增功能 🌱" - feat: 新增资产授权规则支持对协议进行授权 - feat: 新增资产授权规则支持对会话分享动作进行授权 - feat: 新增远程应用发布机支持使用同名账号进行连接 - feat: 新增用户 API Key 支持配置 IP 白名单 - feat: 新增账号备份支持配置 SFTP 存储方式 - feat: 新增多资源选择策略的属性匹配支持 同时包含 和 任意包含 两种模式 - feat: 新增 Windows 资产连接支持开启和关闭智能调整窗口大小 - feat: 新增工作台支持系统工具(管理员可配置用户角色开启,默认关闭)【企业版】 - feat: 新增语言切换功能(控制台、工作台、审计台) - feat: 新增账号收集任务支持资产账号信息变动的消息通知【企业版】 - feat: 新增 SSH 方式登录成功后支持查看系统公告信息(KoKo) - feat: 新增系统公告设置支持 Markdown View 预览模式 - feat: 新增资产连接高级选项 GB2312 和 IOS-8859-1 编码格式 - feat: 新增作业中心历史执行日志的保留天数配置项 - feat: 新增账号推送、账号改密历史执行中支持对单个资产账号进行重试【企业版】 - feat: 新增控制数据库连接时的复制、粘贴动作(Web GUI)(Chen)

!!! summary "功能优化 🚀" - perf: 优化 Dockerfile 构建逻辑 - perf: 优化用户连接资产无协议时的提示信息 - perf: 优化配置项 DOMAINS 的端口处理逻辑 - perf: 优化 OAuth2.0 认证方式中获取 Access Token 的 Content 类型 - perf: 优化生成 RSA Key 的默认长度为 2048 字符 - perf: 优化用户登录日志和在线用户的 IP 地址获取逻辑 - perf: 优化在线用户新增活跃属性标识 - perf: 优化在线用户扫描机制(Scan) - perf: 优化命令存储为本地数据库时命令列表支持资产模糊搜索 - perf: 优化发布机选择策略 - perf: 优化资产账号密码中支持使用特殊字符 ' 和 " - perf: 优化发布机终端名称不包含空白字符 - perf: 优化仪表盘查询 FTP Log 日志的 SQL 语句,减少查询次数 - perf: 优化远程应用名称不能包含 () 字符 - perf: 优化作业中心资产树父节点选中时点击展开子节点默认也是选中状态 - perf: 优化保存快捷命令时命令为空不能保存 - perf: 优化用户最后执行的命令未记录的问题(Magnus) - perf: 优化 API Key 认证记录用户时间逻辑,避免次数太多导致数据库被锁定

!!! success "问题修复 🐛"
- fix: 修复云同步任务中的策略不能被清空的问题【企业版】 - fix: 修复账号改密密码规则提交不生效的问题【企业版】
- fix: 修复获取全部资产数据库列表时报错的问题【企业版】 - fix: 修复账号改密测试切换自账号可连接性失败的问题【企业版】 - fix: 修复 DB2 资产平台已经存在的问题 - fix: 修复组件可能启动失败的问题 - fix: 修复包含 Apps 资产节点时可能导致数据库迁移失败的问题 - fix: 修复资产连接信息超长导致 JumpServer 客户端拉起无响应的问题 - fix: 修复发布机名称包含特殊字符时导致部署失败的问题 - fix: 修复 Elasticsearch(6 版本)查询不到命令记录的问题 - fix: 修复禁用用户 MFA 页面显示错误的问题 - fix: 修复使用切换自的交换机账号登录时卡住的问题 - fix: 修复账号改密记录无法搜索查询的问题【企业版】 - fix: 修复 MySQL 数据库测试可连接性失败的问题 - fix: 修复作业日志搜索用户报错的问题 - fix: 修复快捷命令找不到 mssql_module 路径的问题 - fix: 修复自动化任务中资产包含多个协议时端口获取不准确的问题 - fix: 修复账号改密时 root 账号密钥未修改成的问题【企业版】 - fix: 修复连接 Telnet 协议资产时客户端拉起无响应的问题 - fix: 修复快捷命令 Playbook 部分任务不可执行的问题 - fix: 修复快捷命令 SQLServer 资产执行失败的问题 - fix: 修复云同步策略设置的账号模版和实际账号未进行关联的问题【企业版】 - fix: 修复云同步策略为不等于时不生效的问题【企业版】 - fix: 修复新创建的云同步任务策略为空时报错的问题【企业版】 - fix: 修复云账号详情页面更新会报错的问题【企业版】 - fix: 修复云同步任务的优先级无法更新的问题【企业版】 - fix: 修复创建工单搜索资产后不显示的问题【企业版】 - fix: 修复创建工单账号字段搜索后点击下拉选项时会重复添加的问题【企业版】 - fix: 修复连接远程应用时 服务端点选择策略 未生效的问题 - fix: 修复 CentOS 系统的用户使用 sudo 方式切换登录会失败的问题(KoKo) - fix: 修复使用 SSH 密钥方式登录 KoKo 失败的问题(KoKo) - fix: 修复 MySQL 无默认数据库时无法通过 Web GUI 方式连接的问题(Chen) - fix: 修复 Oracle 使用 16 位密码无法使用本地客户端连接的问题(Magnus)【企业版】 - fix: 修复使用本地客户端方式连接数据库,其中记录命令的风险等级不准确的问题(Magnus) - fix: 修复 Windows 资产账号推送、账号改密使用 WinRM 方式会执行失败的问题【企业版】

v3.8.2

2023年11月13日 !!! summary "功能优化 🚀" - perf: 优化发布机选择策略

!!! success "问题修复 🐛" - fix: 修复 DB2 资产平台已经存在导致迁移失败的问题 - fix: 修复资产节点名称(Apps)重复导致升级失败的问题 - fix: 修复 Elasticsearch(6 版本)查询不到命令记录的问题 - fix: 修复 MySQL 未写默认数据库导致 Web GUI 方式连接失败的问题(Chen) - fix: 修复用户使用 SSH 密钥登录失败的问题(KoKo) - fix: 修复云账号页面更新报错的问题【企业版】 - fix: 修复创建工单搜索资产不显示的问题【企业版】 - fix: 修复创建工单账号字段搜索后点击下拉选项时重复添加的问题【企业版】

v3.8.1

2023年10月25日 !!! summary "功能优化 🚀" - perf: 优化在线用户信息统计方式 - perf: 优化默认激活账号列表页面 - perf: 优化 LDAP 用户列表导入全部用户失败后没有提示信息的问题 - perf: 优化远程应用名称不能包含 () 字符

!!! success "问题修复 🐛" - fix: 修复数据库资产不分页时接口报错的问题 - fix: 修复 DOMAINS 配置参数包含 :80 和 :443 时启动失败的问题 - fix: 修复改密任务权限位使用错误的问题【企业版】 - fix: 修复改密任务执行切换自账号的可连接性测试失败的问题【企业版】 - fix: 修复资产类型选择问题 - fix: 修复 Oracle 数据库使用 16 位密码无法连接的问题【企业版】

v3.8.0

2023年10月20日 !!! info "新增功能 🌱" - feat: 新增用户登录的通知功能 - feat: 新增用户登录资产的通知功能 - feat: 支持指定目录运行作业中心命令 - feat: 支持持久化保存用户主题配色(Web CLI)(KoKo) - feat: 支持纳管 DB2 类型的数据库【企业版】 - feat: 支持切换自账号的改密任务【企业版】 - feat: 支持自定义短信认证方式(文件方式)【企业版】 - feat: 支持数据库查询集的下载导出功能(Web GUI)(Chen)

!!! summary "功能优化 🚀" - perf: 优化 Magnus 组件使用 netcat 工具进行容器健康监测(Magnus) - perf: 优化定时记录键盘操作逻辑(Lion) - perf: 优化新增 Alt + Tab 快捷键(Lion) - perf: 优化 Redis 哨兵连接策略(KoKo) - perf: 优化 SSH 登录时增加对登录 IP 的校验(KoKo) - perf: 优化 Luna 页面同名账号和手动输入账号允许下载 RDP 文件【企业版】 - perf: 优化 Luna 页面快捷命令增加图标显示 - perf: 优化 Luna 页面没有账号选择时给出提示信息 - perf: 优化 Luna 页面用户会话过期后提示需要重新登录,不断开当前会话 - perf: 优化账号收集、账号改密、账号备份多次点击执行次数不能正常跳转到执行列表的问题【企业版】 - perf: 优化资产授权详情中已添加的资产不能重复添加 - perf: 优化列表搜索框可以使用退格键删除搜索条件 - perf: 优化命令组增加命令规则搜索字段 - perf: 优化 Windows 平台的默认账号测试和账号校验均使用 rdp 方式 - perf: 优化第三方用户扫码绑定后强制退出重新登录 - perf: 优化在线用户的过期时间获取逻辑(实时获取) - perf: 优化更新资产的平台时默认增加新的协议类型 - perf: 优化更新用户绑定 MFA 的二维码图片 - perf: 优化 MySQL、MariaDB 的默认数据库字段不再必填 - perf: 优化用户 Passkey 认证方式只允许本地用户使用 - perf: 优化记录会话录像失败原因 - perf: 优化 OTP 校验窗口最小值可设置为 0 - perf: 优化账号模版信息同步更新到所关联的账号,包括名称、用户名、密钥和密钥类型等信息 - perf: 优化任务执行历史默认按照最后执行时间降序排序 - perf: 优化同步更新 LDAP 用户的用户组信息 - perf: 优化验证码校验逻辑,防止被暴力破解 - perf: 优化账号模版生成随机密码密钥的逻辑 - perf: 优化长期未登录用户自动禁用的检测逻辑 - perf: 优化管理员默认邮箱地址 admin@example.com - perf: 优化随机字符生成方法使用 secrets 库 - perf: 优化用户登录城市的校验逻辑,避免同城登录误判为异地的问题 - perf: 优化记录用户 API Key 的最后使用日期 - perf: 优化资产登录被访问控制策略拒绝后登录行为记录到操作日志【企业版】 - perf: 优化统一用户操作过程中需要二次确认用户身份的处理逻辑 - perf: 优化未登录用户审批工单时自动跳转到登录页面【企业版】

!!! success "问题修复 🐛" - fix: 修复账号改密密码策略提交不生效的问题【企业版】 - fix: 修复 Websocket 超时断开连接的问题(Chen) - fix: 修复 Web GUI 连接数据库查询 biginteger 字段值时精度丢失的问题(Chen) - fix: 修复执行 screen 和 tmux 命令后没有录像的问题(KoKo) - fix: 修复 Luna 页面拖拽会话 Tab 导致会话重新连接的问题 - fix: 修复命令过滤规则中点击命令组跳转到详情的问题 - fix: 修复连接令牌过期按钮被禁用的问题 - fix: 修复系统设置邮件设置后缀失败的问题 - fix: 修复云同步资产时设置账号模版导致同步失败的问题【企业版】 - fix: 修复界面设置权限位错误问题【企业版】 - fix: 修复云同步资产没有设置节点的问题【企业版】 - fix: 修复离线会话依然显示在线的问题 - fix: 修复第三方用户登录失败的问题 - fix: 修复更新资产标签时资产协议被清空的问题 - fix: 修复一些 RBAC 权限错误导致操作失败的问题 - fix: 修复组织管理员创建用户失败的问题【企业版】 - fix: 修复账号改密执行列表中模糊搜索报错的问题【企业版】 - fix: 修复通过账号模版添加资产切换自账号没有同步创建的问题 - fix: 修复克隆包含切换自的账号时,没有克隆切换自账号的问题 - fix: 修复更新用户手机号选择 +86 时保存不生效的问题 - fix: 修复节点资产数量方法计算不准确的问题 - fix: 修复资产名称中包含 / 字符执行 Ansible 任务失败的问题 - fix: 修复 DOMAINS 配置添加 80 和 443 端口后不生效的问题 - fix: 修复找回密码时手机号增加 + 号导致发送短信失败的问题 - fix: 修复验证码校验逻辑和报错信息 - fix: 修复资产授权账号选择不显示节点下资产账号的问题 - fix: 修复账号批量更新时报错的问题 - fix: 修复用户 username 包含中文导致登录失败问题 - fix: 修复 OpenID 用户被禁用后会循环登录跳转的问题 - fix: 修复 v2 升级 v3 时系统用户迁移导致创建账号 ID 字段冲突报错的问题(同时包含密码和密钥的系统用户)

v3.7.2

2023年10月10日 !!! summary "功能优化 🚀" - perf: 优化邮件发送的邮箱信息过滤 - perf: 优化创建资产授权时的提示所有资产下的账号名称信息 - perf: 优化更新依赖 jms-storage==0.0.52 - perf: 优化放开 grep 命令(KoKo) - perf: 优化完善 SSH MFA 认证机制(KoKo)

!!! success "问题修复 🐛" - fix: 修复批量更新账号失败的问题 - fix: 修复系统设置中邮件设置后缀不生效的问题 - fix: 修复获取 Web 终端远程应用连接选项失败的问题 - fix: 修复 MariaDB 数据库的连接信息提示(KoKo) - fix: 修复 Oracle 连接异常导致的服务停止问题(Magnus) - fix: 修复 jms_web 容器缺少依赖导致的远程应用发布机拉起应用失败的问题

v3.7.1

2023年9月26日 !!! summary "功能优化 🚀" - perf: 优化忘记密码验证码 1 min 内至多允许尝试三次,三次失败后立即失效 - perf: 优化连接 MongoDB 数据库时禁用执行某些系统指令(Web CLI)(KoKo) - perf: 优化连接 Windows 资产右侧菜单会溢出显示滚动条的问题(Web GUI)(Lion)

!!! success "问题修复 🐛" - fix: 修复用户使用 Public Key 登录的问题 - fix: 修复远程应用 Web GUI 方式连接失败的问题 - fix: 修复忘记密码发送验证码失败的问题 - fix: 修复系统用户迁移时包含密码和密钥导致创建账号 ID 冲突报错的问题 - fix: 修复连接 MySQL 数据库 bigint unsigned 字段的精度显示问题(Web GUI)(Chen) - fix: 修复连接数据库资产 Websocket 会超时断开的问题(Web GUI)(Chen) - fix: 修复连接数据库资产部分图标不显示的问题(Web GUI)(Chen) - fix: 修复节点下资产数量计算不准确的问题 - fix: 修复账号模版未生成随机密码密钥的问题 - fix: 修复批量更新账号报错的问题 - fix: 修复云同步资产没有节点问题【企业版】

v3.7.0

2023年9月21日 !!! info "新增功能 🌱" - feat: 新增个人设置功能 - feat: 新增资产连接分屏显示功能 - feat: 新增 Passkey 用户认证方式 - feat: 新增网络设备的批量命令执行功能 - feat: 新增查看在线用户信息功能 - feat: 新增 MySQL 数据库支持 SSL 方式连接(Web GUI)(Chen) - feat: 新增管理员查看并解锁全局被限制登录的 IP 地址信息 - feat: 新增系统工具 Telnet、Ping 支持批量测试 - feat: 新增 Traceroute 系统工具 - feat: 新增公告内容支持 Markdown 语法 - feat: 新增Web 终端页面支持查看 RDP 协议账号的已连接数量 - feat: 新增Web 终端页面新增命令的选择、执行、保存功能 - feat: 新增数据库连接方式支持命令的选择、执行、保存功能(Web GUI)(Chen) - feat: 回归数据库 Web CLI / CLI 方式的连接

!!! summary "功能优化 🚀" - perf: 数据库命令复核支持显示 SQL 影响行数(Chen)【企业版】 - perf: 优化特殊处理 SFTP 下 root 账号连接的目录权限问题 - perf: 优化 SSH 终端连接时账号列表使用用户名进行排序 - perf: 优化文件上传重命名问题,支持在个人设置中配置策略 - perf: 优化 redis-cli 连接支持中文显示 - perf: 优化 es 操作 bulk 为 create,支持写入数据流(KoKo)【感谢 @BoringCat】 - perf: 优化资产授权列表中指定账号字段不计算在账号数量中 - perf: 优化账号模版中密码策略选择组件 - perf: 优化创建资产时自动设置指定节点 - perf: 优化创建用户时的默认角色设置 - perf: 优化 Windows 资产账号密钥类型为 SSH-Key 时隐藏自动推送选项 - perf: 优化 Crontab 组件,周日的值默认为 0 - perf: 优化系统设置中邮件设置提交后页面空白的问题 - perf: 优化会话列表用户、资产字段支持点击跳转 - perf: 优化资产授权中用户、资产被选择之后下拉菜单选项中还能继续选择问题 - perf: 优化登录页面移动端布局 - perf: 优化 Elasticsearch host 中不允许包含 # 字符 - perf: 优化删除用户时同步删除发布机中对应的账号信息 - perf: 优化 Chrome 远程应用代填逻辑,不最小化窗口 - perf: 优化平台 ID 字段权限为可读写,解决平台无法批量导入更新的问题 - perf: 优化平台支持通过 Category、Type 进行搜索过滤 - perf: 优化禁用长时间未登录用户的处理逻辑 - perf: 优化新增限制超级权限的配置项 - perf: 优化网络设备默认启用 Ansible 功能 - perf: 优化 JumpServer Client 工具支持 msi 安装包 - perf: 优化 Chrome 代填进度条最大超时时间 30s - perf: 优化日志相关表结构添加一些字段索引,提高查询速度 - perf: 优化 Magnus DB Port 的日志显示问题 - perf: 优化仪表盘数据不准确的问题 - perf: 优化查看、下载录像行为记录到操作日志中 - perf: 优化账号模版支持设置自动推送 - perf: 优化不允许管理员修改自己的角色 - perf: 优化网络设备支持配置 SFTP 协议 - perf: 优化 SQL Server 数据库添加驱动标识,解决不同版本的数据库连接失败的问题【企业版】 - perf: 优化发布机调度策略,避免多次调度到同一台发布机 - perf: 优化批量连接资产后保留原来的已选项 - perf: 优化域账号登录的域字符标识支持(domain\username、username@domain) 格式(Lion) - perf: 优化远程应用无法使用 vnc 协议的问题(Lion) - perf: 优化通过 Web GUI 连接 Windows 资产时的客户端名为 JumpServer-Lion(Lion) - perf: 优化 Postgre SQL 数据库动态加载驱动库(Chen) - perf: 优化日志循环打印问题(Kael)

!!! success "问题修复 🐛" - fix: 修复 Web GUI 连接数据库 long 类型精度丢失问题(Chen) - fix: 修复 Web GUI 连接数据库日期格式显示问题(Chen) - fix: 修复用户 SSH 公钥认证问题(KoKo) - fix: 修复思科交换机 telnet 连接时命令过滤拦截失败的问题(KoKo) - fix: 修复会话连接失败阻塞导致会话无法结束的问题(KoKo) - fix: 修复 redis-cli 命令报错的问题(KoKo) - fix: 修复 Luna 页面在 SYSTEM 组织下节点不能展开问题【企业版】 - fix: 修复 Luna 页面不记住密码导致无法登录的问题 - fix: 安全设置开启仅已存在用户登录,企业微信等扫描登录,如果用户不存在,还是会自动创建用户登录成功的问题【企业版】 - fix: 修复角色详情用户 Name 显示问题 - fix: 修复云同步所有资源都不执行同步策略的问题【企业版】 - fix: 修复信号未监听导致 License 没有及时更新的问题【企业版】 - fix: 修复依赖升级导致 Azure 云无法同步资产的问题【企业版】 - fix: 修复登录资产控制会全局生效的问题 - fix: 修复 SQL Server 数据库账号推送、改密失败的问题【企业版】 - fix: 修复工单回复报错的问题【企业版】 - fix: 修复 Private Storage Permission 访问权限问题 - fix: 修复工单审计员修改申请的资产后,原申请资产依然被授权的问题【企业版】 - fix: 修复账号推送定时任务不执行的问题 - fix: 修复 CAS 用户登录失败的问题 - fix: 修复用户绑定 MFA OTP 的二维码不显示的问题 - fix: 修复通过网域连接 k8s 时支持默认端口 443【感谢 @hoilc) 贡献】 - fix: 修复 KoKo 获取 SFTP 路径错误的问题【感谢 @hoilc 贡献】 - fix: 修复 SAML2 认证用户无法登录的问题 - fix: 修复创建会话分享不填写用户报错的问题 - fix: 修复资产树创建子节点后没有获取到的问题 - fix: 修复账号密钥校验不支持包含 { 和 % 字符 - fix: 修复主机名中包含 [ 字符导致 Ansible 任务执行错误的问题

v3.6.6

2023年9月26日 !!! summary "功能优化 🚀" - perf: 优化忘记密码验证码 1 min 内至多允许尝试三次,三次失败后立即失效 - perf: 优化连接 MongoDB 数据库时禁用执行某些系统指令(Web CLI)(KoKo)

!!! success "问题修复 🐛" - fix: 修复用户使用 Public Key 登录的问题 - fix: 修复系统用户迁移时包含密码和密钥导致创建账号 ID 冲突报错的问题 - fix: 修复节点下资产数量计算不准确的问题

v3.6.5

2023年9月22日 !!! success "问题修复 🐛" - fix: 修复作业中心 Playbook 文件创建问题 - fix: 修复 random 随机数生成逻辑 - fix: 修复用户登录公钥认证问题(KoKo)

v3.6.4

2023年9月11日 !!! info "漏洞修复 🧸" - fix: 修复 Private Storage Permission 访问权限漏洞

!!! summary "功能优化 🚀" - perf: 优化 Nginx 配置文件静态录像文件获取路径

!!! success "问题修复 🐛" - fix: 修复工单审计员修改审批资产,原申请资产没有被移除的问题【企业版】 - fix: 修复数据库 long 类型数据获取后精度丢失的问题(Chen) - fix: 修复日期时间格式问题(Chen) - fix: 修复使用客户端连接数据库可能触发异常导致服务停止的问题(Magnus)

v3.6.3

2023年9月4日 !!! summary "功能优化 🚀" - perf: 优化迁移 SFTP 协议的资产 - perf: 优化云同步资产 ID 的构造逻辑【企业版】 - perf: 优化云同步实例未获取到属性返回空值的问题【企业版】 - perf: 优化 Kael 组件日志循环打印的问题

!!! success "问题修复 🐛" - fix: 修复获取仪表盘数据都是 0 的问题 - fix: 修复连接 Redis 资产中文显示问题(KoKo) - fix: 修复 OTP 名称太长导致绑定二维码没有生成的问题 - fix: 修复新添加的发布机没有被调度的问题 - fix: 修复 SAML2、CAS 用户无法登录的问题【企业版】 - fix: 修复自动化动态列表组件添加内容会闪退的问题 - fix: 修复连接资产 SFTP 路径获取不对的问题(KoKo) - fix: 修复远程应用无法使用 VNC 协议的问题 - fix: 修复 PostgreSQL 数据库获取属性失败的问题(Chen)【企业版】 - fix: 修复云同步策略中删除动作和规则时提示 404 的问题【企业版】

v3.6.2

2023年8月24日 !!! summary "功能优化 🚀" - perf: 优化网络设备支持配置 SFTP 协议 - perf: 优化 Web GUI 登录 Windows 时支持输入域账号登录 (domain\username)

!!! success "问题修复 🐛" - fix: 修复资产名称包含 [ 和 ] 字符时执行 Ansible 任务报错的问题 - fix: 修复 Web Terminal 页面记住密码不勾选导致无法登录的问题(手动登录的账号) - fix: 修复 License 导入没有生效的问题【企业版】

v3.6.1

2023年8月18日 !!! success "问题修复 🐛" - fix: 修复安装、升级 v3.6.0 版本后访问页面 400、403 的问题(正常情况下,不再强制要求配置 DOMAINS 参数) - fix: 修复资产树子节点创建后没有加载的问题 - fix: 修复创建会话分享不填写用户报错的问题 - fix: 修复通过 Web CLI 连接 Redis 数据库失败的问题 - fix: 修复对于失效的会话无法终断的问题(资产连接失败导致连接阻塞)

v3.6.0

2023年8月17日 !!! info "新增功能 🌱" - feat: 支持批量连接资产(Web Terminal 页面) - feat: 账号密钥支持使用 HashiCorp Vault 第三方密钥存储系统【企业版】 - feat: 云同步支持配置多种同步策略【企业版】 - feat: 重构 Kael 组件,提高响应速度(使用 Go 语言) - feat: 重构 JumpServer Client 支持可视化配置和拉起原生客户端工具(升级版本后需要重新安装新版 Client 客户端) - feat: 在线会话页面,支持管理员执行会话暂停和恢复操作 - feat: 资产登录复核工单详情页面,支持审批人对当前会话执行暂停和恢复动作【企业版】 - feat: 对于使用 Web GUI 方式连接的数据库,支持对表名和列名进行自动补全 - feat: 对于 Web Terminal 页面的会话 Tab,支持手动拖拽排放位置 - feat: 新增虚拟账号列表,支持查看同名账号、手动输入、匿名账号的相关描述信息,支持设置同名账号的密码使用策略 - feat: 账号备份支持将密钥分段发送给不同的接受人【企业版】 - feat: 支持配置会话的最大连接时长,超过最大时长系统自动强制断开会话 - feat: 创建会话分享支持发送消息通知到被分享者 - feat: 对于 Oracle 数据库支持通过 Web GUI 方式使用 sysdba 进行连接【企业版】 - feat: 系统工具新增 Nmap 和 tcpdump 工具 - feat: 支持自动禁用长时间未登录的用户,在 系统设置 > 安全设置 中进行配置检测时长(默认 30 天) - feat: 作业中心支持对 MySQL、PostgreSQL、SQL Server 数据库进行批量命令执行 - feat: 对于 Web Terminal 页面,连接资产时提供 Guide 模式(显示资产连接密钥字符串) - feat: 支持对单个远程应用批量部署到多台应用发布机 - feat: 应用发布机支持通过网域网关进行连接【企业版】

!!! summary "功能优化 🚀" - perf: 优化工作台最近会话列表支持一键连接资产 - perf: 移除 Web CLI 方式连接 MySQL、PostgreSQL、SQLServer、MariaDB 等数据库,建议通过 Web GUI 方式进行连接 - perf: 优化资产协议,支持对 ssh 和 sftp 进行单独配置 - perf: 优化用户授权账号 API 返回账号 ID 字段 - perf: 优化用户 Suggestion API 使用 POST 方法请求 - perf: 优化应用发布机的创建,支持控制账号数量的是否自动创建 - perf: 优化应用连接的发布机账号选择策略,主机和应用都支持并发时使用私有账号,不支持并发时优先使用私有账号,其次使用公共账号 - perf: 优化工单管理支持批量审批功能【企业版】 - perf: 隐藏连接 Web 资产时的用户名、密码代填操作 - perf: 优化创建用户时,默认添加到 Default 组织的 Default 用户组 - perf: 优化通过 RDP File 连接 Windows 资产时支持多屏显示控制选项 - perf: 优化组件的操作行为不记录到操作日志列表中 - perf: 优化连接 Kubernetes 资产支持通过网域网关进行连接 - perf: 优化 Telnet 资产平台,支持自定义 Prompt 的提示信息 - perf: 优化资产测试可连接和账号改密,支持 sudo 和 su 切换用户(针对 Paramiko 方式) - perf: 优化 Web 资产平台支持开启和关闭安全模式,用于控制连接 Web 资产后是否允许打开新的窗口和访问不同域的地址 - perf: 优化 Web Terminal 页面左侧用户授权资产树的右击操作,支持展开/折叠其子节点和节点下的所有资产 - perf: 优化组织列表增加 Internal 字段标识【企业版】 - perf: 优化 SYSTEM 组织不允许被删除【企业版】 - perf: 优化账号改密的密码校验逻辑,解决改密成功后可能导致未保存密码的问题【企业版】 - perf: 优化组件监控页面 - perf: 优化账号 API 支持通过 comment 字段进行模糊搜索 - perf: 优化任务日志页面的时间显示问题 - perf: 优化系统设置的菜单布局 - perf: 优化飞书信息消息通知文案 【感谢 @BoringCat】 - perf: 升级 MySQL==8.0.34 和 MariaDB==11.0.3 版本号(Magnus) - perf: 优化组件注册名称,避免名称重复导致启动失败的问题 - perf: 优化远程应用上传时校验 License 版本【企业版】 - perf: 优化账号列表默认显示激活状态 - perf: 优化远程应用页面增加应用市场链接 - perf: 优化命令列表页面的加载速度 - perf: 优化命令记录列表增加账号列的显示 - perf: 优化资产直连方式,支持使用资产 ID 进行连接(KoKo) - perf: 优化校验 Kubernetes Token 的方式,解决自定义 Token 连接集群失败的问题 - perf: 优化文件管理上传文件时,如果存在同名文件则使用新名称进行保存 - perf: 优化资产详情页面,通过账号模版添加账号时支持搜索指定模版 - perf: 优化启动容器服务时设置容器名称为 Hostname - perf: 优化固定 video-worker 组件的 CPU 使用数量为 2,解决录像转码过程中资源占用较高的问题 - perf: 优化云同步策略,由于资产名称太长导致同步任务执行失败的问题【企业版】 - perf: 优化组织角色中增加连接令牌的权限并关联到工作台权限位

!!! success "问题修复 🐛" - fix: 修复批量更新资产报错的问题 - fix: 修复使用同名账号登录 Web 资产时用户名代填失败问题 - fix: 修复执行 Ansible 任务报错的问题 - fix: 修复由于资产的名称太长导致资产连接失败的问题 - fix: 修复 MAX_LIMIT_PER_PAGE 配置项的默认值和数据类型转换失败的问题 - fix: 修复用户 SSH Public Key 的校验逻辑,解决用户个人信息页面上传公钥失败的问题 - fix: 修复忘记密码页面发送短信时包含手机号时区 + 字符显示用户未找到的问题 - fix: 修复应用发布机创建同名账号时包含组件名称用户的问题 - fix: 修复连接资产时删除上次连接的资产协议(如:vnc)导致连接报错的问题 - fix: 修复移除 Nginx 缓存配置,解决多台发布机之间获取账号列表不准确的问题 - fix: 修复系统设置 > 消息订阅 > 修改订阅人中用户名显示存在的 XSS 问题 - fix: 修复账号列表添加账号时会明文显示的问题 (issue) - fix: 修复资产列表导出所选时不生效的问题 - fix: 修复标签列表页面点击关联资产数量跳转到空白页面的问题 - fix: 修复通过 Web GUI 方式连接 Windows 资产时窗口比例不正确的问题 - fix: 修复连接 SUSE 操作系统资产失败的问题(KoKo) - fix: 修复 Web Terminal 页面登录资产时记住密码选型未勾选依然生效的问题 - fix: 修复通过 XRDP 组件使用远程客户端连接 Windows 资产,复制粘贴上传下载权限控制不生效的问题【企业版】

v3.5.7

2023年9月26日 !!! summary "功能优化 🚀" - perf: 优化忘记密码验证码 1 min 内至多允许尝试三次,三次失败后立即失效 - perf: 优化连接 MongoDB 数据库时禁用执行某些系统指令(Web CLI)(KoKo)

!!! success "问题修复 🐛" - fix: 修复用户使用 Public Key 登录的问题 - fix: 修复系统用户迁移时包含密码和密钥导致创建账号 ID 冲突报错的问题 - fix: 修复节点下资产数量计算不准确的问题

v3.5.6

2023年9月21日 !!! success "问题修复 🐛" - fix:修复作业中心 Playbook 文件创建问题 - fix: 修复 random 随机数生成逻辑 - fix: 修复公钥认证问题(KoKo)

v3.5.5

2023年9月11日 !!! info "漏洞修复 🧸" - fix: 修复 Private Storage Permission 访问权限漏洞

v3.5.4

2023年8月15日 !!! summary "功能优化 🚀" - perf: 优化任务日志页面时间显示问题 - perf: 升级 MySQL==8.0.34 和 MariaDB==10.3.35 版本号 - perf: 优化飞书信息消息通知文案 【感谢 @BoringCat

!!! success "问题修复 🐛" - fix: 修复忘记密码页面发送短信时包含时区的 + 字符显示用户未找到的问题 - fix: 修复系统设置-消息订阅-修改订阅人中用户名显示存在的 XSS 问题 - fix: 修复移除 Nginx 缓存配置,解决多台发布机之间获取账号列表不准确的问题

v3.5.3

2023年8月8日 !!! summary "功能优化 🚀" - perf: 优化 Kubernetes 资产支持通过网域网关连接 - perf: 优化命令记录列表增加账号字段

!!! success "问题修复 🐛" - fix: 修复 MAX_LIMIT_PER_PAGE 配置默认值和数据类型没有转换问题 - fix: 修复 XRDP 组件复制粘贴上传下载权限控制失败的问题【企业版】

v3.5.2

2023年8月1日 !!! summary "功能优化 🚀" - perf: 优化账号改密,当用户不存在时进行创建【企业版】 - perf: 优化作业中心禁用 host 为 localhost 的情况 - perf: 优化 ChatGPT 资产连接页面的输入框焦点丢失的问题(Kael)

!!! success "问题修复 🐛" - fix: 修复 Web 终端页面连接资产时的分辨率显示问题(小窗口居中)

v3.5.1

2023年7月27日 !!! summary "功能优化 🚀" - perf: 优化账号改密去掉 sudo 参数设置

!!! success "问题修复 🐛" - fix: 修复使用同名账号登录 Web 资产用户名没有代填的问题 - fix: 修复资产批量更新报错的问题 - fix: 修复一些已知的翻译问题

v3.5.0

2023年7月20日 !!! info "新增功能 🌱" - feat: 新增 Web 可视化数据库连接组件 (Chen) - 替换原有的 OmniDB 组件 - feat: 新增 GPT 资产连接组件 (Kael) - 支持对 ChatGPT 资产进行纳管 - feat: 新增 Windows 资产连接组件 (XRDP) - 支持对 Windows 2003 版本的资产进行连接、审计【企业版】 - feat: 支持 AD 域用户登录 Windows 资产 (资产平台中配置 AD 域) - feat: 支持命令过滤告警动作 (执行并告警) - feat: 支持指定远程应用发布机连接某个远程应用 (使用资产标签匹配机制) - feat: 支持授权匿名账号登录Web、自定义类型的资产 (只拉起远程应用不代填任何信息) - feat: 支持对 SFTP 会话进行审计 - feat: 支持对 UCloud 公有云资产自动同步【企业版】

!!! summary "功能优化 🚀" - perf: 优化 Web Luna 页面新窗口连接资产时顶部显示资产名称 - perf: 优化 SFTP 根目录配置支持使用 ${ACCOUNT} 和 ${USER} 变量 - perf: 优化 SSH 连接复用策略 (账号密码更新后不复用,提高安全性) - perf: 优化新增 DEBUG_ANSIBLE 配置项支持打印 Ansible 任务执行的详细日志 - perf: 优化连接令牌超时时间配置项名称 (CONNECTION_TOKEN_ONETIME_EXPIRATION、CONNECTION_TOKEN_REUSABLE_EXPIRATION) - perf: 优化终端端点规则支持快捷启用和禁用 - perf: 优化飞书接收到的工单审批链接无法点击的问题 - perf: 优化账号列表支持通过密钥类型进行搜索 - perf: 优化 Windows WinRM 采用 NTLM 方式认证 (安全性更高) - perf: 优化连接令牌 RBAC 权限位位置 - perf: 优化 LDAP 用户导入、同步时支持 is_active 值为 -1 的情况 - perf: 优化 Core 服务默认启动 4 个 Worker 进程 - perf: 优化获取 Endpoint Oracle 协议端口的逻辑 - perf: 优化资产详情页面支持更新标签 - perf: 优化点击角色列表默认切换到全局组织【企业版】 - perf: 优化 Web 资产协议端口直接从 URL 中获取 (不允许在协议中修改) - perf: 优化用户个人信息页面的认证方式和用户来源一致时不能解绑 - perf: 优化通过客户端方式连接数据库的描述信息 - perf: 优化使用 rz、sz 下载文件完成后终端卡住的问题 - perf: 优化通过 KoKo 组件连接的资产支持对粘贴的多行命令进行命令过滤器校验 - perf: 优化 Web SFTP 软链接目录的显示问题 (Issue) - perf: 优化通过 Lion 组件连接资产时连接断开的提示信息 - perf: 优化通过 Lion 组件监控会话结束后弹框提示断开信息 - perf: 优化 Core 组件日志目录 (/data/jumpserver/core/logs -> /data/jumpserver/core/data/logs)

!!! success "问题修复 🐛" - fix: 修复定时任务偶尔会出现重复执行的问题 - fix: 修复手动切换到全局组织后点击菜单会回到上个非全局组织的问题【企业版】 - fix: 修复网络设备使用账号切换时连接失败的问题 (Issue) - fix: 修复 Web SFTP 上传大文件失败的问题 - fix: 修复直连 SFTP 上传文件失败的问题 - fix: 修复创建 Endpoint 时 Host 被禁用的问题 - fix: 修复创建 Oracle 数据库时,数量超过 MAGNUS_ORACLE_PORTS 端口范围后报错的问题 - fix: 修复 ConnectionToken 过期时间相关配置项默认值类型没有转化的问题 - fix: 修复授权的账号用户名相同时 Web Luna 页面登录资产时只获取到一个的问题 - fix: 修复资产平台导入失败的问题 (ID 字段没有返回) - fix: 修复资产平台创建时自动化配置项默认值设置不正确的问题 - fix: 修复客户端方式访问资产时,配置的 Endpoint 标签匹配策略不生效的问题 - fix: 修复批量执行命令时资产名称包含 [ 特殊字符时执行失败的问题 (Issue) - fix: 修复创建工单时时区不同过期时间保存不正确的问题【企业版】 - fix: 修复邮件主题前缀设置不生效的问题 - fix: 修复账号推送任务中采用动态生成密钥策略时推送失败的问题 - fix: 修复忘记密码时由于 Token 失效导致发送验证码报错的问题 - fix: 修复通过 Ansible 测试资产可连接性报错的问题 (Connection to UNKNOWN port 65535 timed out) - fix: 修复推送账号不填写 Home 信息推送失败的问题 - fix: 修复导入 LDAP 用户时数据库超时导致 Lock wait timeout 的问题 - fix: 修复导入用户手机号为字典类型时报错的问题 - fix: 修复终端端点不填写 Host 地址导致没有匹配的问题 - fix: 修复连接远程应用 Chrome 浏览器时偶尔闪退的问题 - fix: 修复连接自定义远程应用创建会话失败的问题 - fix: 修复账号改密任务报错导致密码保存失败的问题 - fix: 修复远程应用会话无法监控的问题 - fix: 修复迁移文件时触发信号记录操作日志导致迁移失败的问题 - fix: 修复用户登录规则迁移可能冲突的问题 - fix: 修复用户授权的资产根据协议搜索显示重复的问题 - fix: 修复自定义资产详情没有自动化配置选项的问题 - fix: 修复 RBAC 迁移可能导致用户没有用户角色的问题 - fix: 修复批量导入资产时如果指定账号模版可能会导致导入失败的问题 - fix: 修复手动输入的同名账号登录资产失败的问题 - fix: 修复一些 typos (感谢) - fix: 修复 v2 升级到 v3 版本后资产平台为网络设备时资产类型不正确的问题

!!! example "应用市场【企业版】 🧰" - feat: 新增远程应用 - IP-guard - feat: 新增远程应用 - NoSQLBooster for MongoDB - feat: 新增远程应用 - Redis Desktop Manager - feat: 新增远程应用 - PL/SQL Developer 15 - feat: 新增远程应用 - Chrome 浏览器(v92) - feat: 新增远程应用 - Firefox 浏览器

v3.4.3

2023年7月6日 !!! summary "功能优化 🚀" - perf: 优化 Chrome 浏览器远程应用对于 Windows 系统版本的兼容性 (仅支持 Windows 2016 以上版本)

!!! success "问题修复 🐛" - fix: 修复连接 Web 资产时闪退的问题 - fix: 修复 SFTP 直连传文件失败的问题 - fix: 修复 LDAP 导入用户时可能会导致数据库连接超时的问题 (Lock wait timeout exceeded) - fix: 修复用户导入手机号为字典类型时报错的问题 - fix: 修复账号推送 Home 字段为空导致推送失败的问题

v3.4.2

2023年6月30日

!!! summary "功能优化 🚀" - perf: 优化飞书接受的工单信息审批链接不能直接点击的问题【企业版】

!!! success "问题修复 🐛" - fix: 修复自定义远程应用连接失败的问题 - fix: 修复账号改密任务报错导致密码没有存储的问题【企业版】

v3.4.1

2023年6月21日

!!! summary "功能优化 🚀" - perf: 优化自定义平台增加 required 字段

!!! success "问题修复 🐛" - fix: 修复迁移后访问控制逻辑匹配不到的问题 - fix: 修复服务端点主机字段被禁用的问题 - fix: 修复用户登录规则迁移可能重复的问题 - fix: 修复获取用户授权资产列表重复的问题 - fix: 修复自定义资产详情没有 Auto Config 的问题 - fix: 修复创建、更新用户页面密码框隐藏逻辑 - fix: 修复连接 Web 远程应用会话不能监控的问题 - fix: 修复 Web SFTP 上传大文件失败的问题 - fix: 修改 v2 升级 v3 版本,网络设备迁移后的资产类型不对的问题

v3.4.0

2023年6月15日

!!! info "新增功能 🌱" - feat: 支持控制用户连接资产的方式【企业版】 - feat: 支持多种资源选择策略(用户登录、命令过滤、资产登录、连接方式) - feat: 支持记录和审计上传、下载的文件内容 - feat: 支持自定义短信认证服务 - feat: 支持通过资产授权规则控制文件的删除动作 - feat: 支持将所有用户一键加入用户组 - feat: 支持对登录 IP 和 登录时段进行控制(资产登录) - feat: 支持单用户同时打开连接多个 Web 资产 - feat: 支持通过 Chrome 远程应用连接资产时隐藏地址栏 - feat: 支持配置作业中心命令黑名单列表 - feat: 支持 DBeaver 远程应用通过网关连接数据库资产

!!! summary "功能优化 🚀" - perf: 优化 Select2 资源选择组件的显示问题(超过10条显示数量) - perf: 优化 Web Terminal 页面资产连接弹窗中增加连接参数选项 - perf: 优化会话分享链接,限制同一用户只能使用一次 - perf: 优化账号推送支持设置 Home 目录 - perf: 优化命令过滤规则操作日志显示问题 - perf: 优化资产列表搜索支持备注模糊搜索 - perf: 优化删除全部用户时的提示信息 - perf: 优化账号收集任务的处理逻辑(正则表达式) - perf: 优化远程应用发布机平台支持 winrm 协议 - perf: 优化服务端点 Host 字段帮助信息 - perf: 优化禁止修改默认服务端点的 Host 字段 - perf: 优化 LDAP 测试可连接性使用异步方式调用 - perf: 优化 LDAP 同步设置支持将用户同步到多个组织【企业版】 - perf: 优化资产授权规则中的动作字段说明 - perf: 优化 PC 登录企业微信客户端的情况下,不需要手机扫码即可登录成功 (感谢 X-Mars 贡献) - perf: 优化系统设置中字段的名称显示包含时间单位 - perf: 优化自动化任务在资产平台中的名称显示 - perf: 优化资产支持使用多协议搜索 - perf: 优化定时检测命令和录像存储可连接性并发送消息通知 - perf: 优化具有超级工单权限的用户申请工单时可以指定申请人【企业版】 - perf: 优化删除远程应用时自动删除同步创建的自定义资产平台 - perf: 优化账号列表支持使用资产名称搜索 - perf: 优化节点创建时校验同级节点名称不允许重复 (API 方式) - perf: 优化账号模版更新时同步更新账号的处理逻辑 - perf: 优化 Web 资产的脚本代填增加 Sleep 等待指令 - perf: 优化短信服务配置中测试手机号支持选择区号 - perf: 优化 LDAP 导入用户的任务名称 - perf: 优化资产平台详情显示 ID 字段 - perf: 优化组件监控显示 Video-Worker 名称 - perf: 优化资产树右击节点详情显示节点 key 信息 - perf: 优化资产平台详情添加资产列表页(只显示当前组织下的资产) - perf: 优化用户详情中资产授权规则页面的删除按钮 - perf: 优化资产授权规则详情中账号页面的删除和克隆按钮 - perf: 优化会话记录中通过远程应用方式连接资产的协议记录 - perf: 优化 KoKo 组件开启 Vscode 模式后支持使用 SCP 传输文件 - perf: 优化 KoKo 组件使用 SSH 命令行连接时资产列表支持自定义部分字段显示字段 - perf: 优化 KoKo 组件支持高阶正则语法 - perf: 优化 KoKo 组件连接 Ubuntu 系统时支持使用 sudo 方式切换 (Issue) - perf: 优化 Lion 组件支持调整远程桌面显示的缩放比例

!!! success "问题修复 🐛" - fix: 修复资产账号导入报错的问题 - fix: 修复账号改密提示失败但实际上成功的问题【企业版】 - fix: 修复终端端点使用资产标签匹配机制时后端服务报错的问题 - fix: 修复导入远程应用时自动创建的自定义平台没有设置自动化字段的问题 - fix: 修复用户登录认证 MFA 输入错误时没有记录具体错误信息的问题 - fix: 修复禁用平台的账号切换功能,历史创建的切换账号依然可以正常切换的问题 - fix: 修复密码输入框不显示密码复规则的问题 - fix: 修复前端页面不显示 JSON 格式参数的问题 - fix: 修复创建资产指定模版账号后没有自动关联切换自账号的问题 - fix: 修复全局组织下查看账号详情报错的问题【企业版】 - fix: 修复作业中心执行任务偶尔报错的问题 - fix: 修复系统管理员之间不能互相更新的问题 - fix: 修复作业中心 Playbook 文件树无法右击的问题 - fix: 修复创建云账号无法添加认证信息的问题【企业版】 - fix: 修复同步阿里云资产时 IP 为 0.0.0.0 的问题(延时绑定弹性公网 IP 的情况)【企业版】 - fix: 修复 v2 升级到 v3 时一些资产没有节点的问题

!!! example "应用市场【企业版】 🧰" - feat: 新增远程应用 - Citrix NetScaler - feat: 新增远程应用 - Clickhouse - feat: 新增远程应用 - Apache Hive - feat: 新增远程应用 - MySQL Workbench - feat: 新增远程应用 - Phoenix HBase - feat: 新增远程应用 - Apache Spark - feat: 新增远程应用 - VMWare vSphere

v3.3.1

2023年5月26日

!!! summary "功能优化 🚀" - perf: 优化开源版本支持 Web Terminal GUI 键盘布局选择功能 - perf: 优化账号收集功能,解决一些 Linux 操作系统上时间格式匹配失败的问题 - perf: 优化资产平台详情显示 ID 字段 - perf: 优化组件监控显示 Video-Worker 名称【企业版】 - perf: 优化区号和手机号格式,解决发送短信失败的问题 - perf: 优化前端 API 调用超时时间为 2 min,解决 LDAP 测试可连接性超时的问题 - perf: 优化资产平台协议设置中的文案信息 - perf: 优化 Web 页面 MP4 格式录像的播放器样式【企业版】 - perf: 优化使用端点规则后打开 Web SFTP 显示半屏的问题 - perf: 优化命令过滤规则操作日志的显示问题 - perf: 优化连接远程应用时账号选择策略问题

!!! success "问题修复 🐛" - fix: 修复 Chrome 远程应用部署后设置的环境变量不正确导致连接 Web 资产闪退的问题 - fix: 修复用户在登录复核页面点击返回,再登录其他用户时可以绕过 MFA 认证的问题【企业版】 - fix: 修复连接令牌关闭复用后已创建的令牌不会立即失效的问题 - fix: 修复账号列表导入账号报错的问题 - fix: 修复测试账号可连接性偶尔失败的问题 - fix: 修复通过资产标签匹配终端端点时连接资产报错的问题 - fix: 修复创建自定义类型资产时动作列不显示的问题 - fix: 修复账号改密提示失败但实际上成功的问题【企业版】 - fix: 修复用户登录认证 MFA 输入错误时登录日志没有记录详细错误信息的问题 - fix: 修复系统管理员之间不能互相更新的问题

v3.3.0

2023年5月18日

!!! info "新增功能 🌱" - feat: 资产连接令牌支持有效期内不限制次数复用 - feat: 用户登录方式(钉钉、飞书、企业微信)支持不存在的用户扫码登录并自动创建用户 - feat: 账号改密支持修改特权账号和自修改(比如:root 改 root) - feat: 账号列表导出支持对导出文件进行加密保护 - feat: 账号模版新增切换自字段,创建账号时支持自动关联切换自账号 - feat: Web 终端页面左侧用户授权树新增类型树视图 - feat: Web 终端页面连接 Windows 资产时支持键盘布局选择(Keyboard Layout) - feat: 新增 Video-Worker 组件,支持将 Razor 和 Lion 组件产生的会话录像自动转换成 MP4 格式,同时 Web 页面的录像回放支持 MP4 格式【企业版】

!!! summary "功能优化 🚀" - perf: 优化查看账号页面支持直接修改账号密码 - perf: 优化页面切换时顶部进度条颜色根据系统颜色而变化 - perf: 优化忘记密码 URL 设置不自动增加 http:// 前缀 - perf: 优化资产、网关列表页面显示 Labels 信息不全的问题 - perf: 优化资产平台协议中增加公共协议字段(如果是公共协议则进行资产连接时会显示在连接窗口中) - perf: 优化创建资产时节点可以设置为空(默认放到根节点下) - perf: 优化创建数据库资产时默认数据库为必填项 - perf: 优化任务执行日志页面支持显示任务的元数据(如:ID、任务名称、执行日期等等) - perf: 优化快捷命令执行账号输入框的下拉列表支持根据所选资产进行智能推荐、固定排序和关键字搜索 - perf: 优化组织管理员不可以更新、删除系统管理员 - perf: 优化修改账号模版密码时同步修改关联的账号密码(只对未单独修改过的账号生效) - perf: 优化使用 RDP 文件连接 Windows 资产时支持 Console 模式 - perf: 优化用户工作台资产列表显示更多信息字段 - perf: 优化账号执行 Ansible 任务时支持提权操作(需要配置切换自账号,密码可以不用填写,提权时使用当前账号的密码) - perf: 优化组织下拉列表按照名称进行排序 - perf: 优化平台列表导出不包含自动化字段 - perf: 优化 Redis 资产账号创建时用户名的提示信息(如果没有用户名可以设置为 null) - perf: 优化用户使用远程应用连接资产时发布机和账号优先使用上次使用的账号 - perf: 优化远程应用支持使用同名账号连接 - perf: 优化命令记录列表支持快捷查看近半年、一年的数据 - perf: 优化 Web 终端左侧用户授权树交换机资产的图标信息 - perf: 优化 Lion 组件相关环境变量配置 Bool 类型忽略大小写 - perf: 优化 Tinker 组件增加定时同步发布机的账号(固定每 30 分钟同步一次) - perf: 优化升级 v3 版本时迁移 Redis 数据库默认设置为 Redis 平台(之前会默认设置为 Redis6+ 平台)

!!! success "问题修复 🐛" - fix: 修复删除组织时组织下资产根节点未被删除的问题 - fix: 修复 Razor 组件连接 Linux 的 XRDP 服务时由于声音传输错误造成的会话退出问题 - fix: 修复 Web SFTP 相关的国际化问题 - fix: 修复连接 MySQL、MariaDB 类型的数据库资产时显示高级选项 - fix: 修复第三方用户认证失败时循环跳转的问题(如:CAS、OIDC、SAML2.0、OAuth2 等) - fix: 修复 Oracle 数据库资产测试可连接性偶尔失败的问题 - fix: 修复快捷命令选择搜索后的资产执行报错的问题 - fix: 修复资产类型树循环显示的问题 - fix: 修复 /api/v1/prometheus/metrics/ 接口调用 500 的问题 - fix: 修复云账号 LAN 不能创建的问题 - fix: 修复更新资产时,其它资产的协议可能会丢失的问题 - fix: 修复更新端点规则中 IP 字段不显示的问题 - fix: 修复安全设置中登录限制黑白名单参数不显示的问题 - fix: 修复组织切换可能引起的路由错误的问题 - fix: 修复 Web 终端页面设置分辨率不生效的问题 - fix: 修复升级 v3 版本时迁移 Redis 资产账号可能丢失的问题(系统用户用户名为空字符串) - fix: 修复升级 v3 版本时迁移应用时没有设置节点的问题(组织下只有一个资产根节点)

!!! example "应用市场【企业版】 🧰" - feat: 新增远程应用 - 达梦数据库管理系统 - feat: 新增远程应用 - 阿里云管理平台 - feat: 新增远程应用 - Amazon 云计算管理平台 - feat: 新增远程应用 - Microsoft Azure 云 - feat: 新增远程应用 - 腾讯云 - feat: 新增远程应用 - IBM DB2 - feat: 新增远程应用 - MongoDB Compass - feat: 新增远程应用 - PL/SQL Developer 12 - feat: 新增远程应用 - Radmin - feat: 新增远程应用 - RedisInsight - feat: 新增远程应用 - SSMS 17 - feat: 新增远程应用 - SSMS 19

v3.2.2

2023年5月9日

!!! summary "功能优化 🚀" - perf: 优化 Magnus Oracle 认证逻辑(针对所有已支持的数据库版本)【企业版】

!!! success "问题修复 🐛" - fix: 修复密钥密码为空字符串时解密失败的问题 - fix: 修复更新资产系统平台时可能会导致其他资产协议被清空的问题 - fix: 修复使用 rz、sz 命令上传、下载文件失败的问题 - fix: 修复 Web SFTP 语言切换不生效的问题 - fix: 修复安全设置中登录限制黑白名单参数提交失败的问题 - fix: 修复迁移应用后没有设置节点的问题(组织下只有根节点) - fix: 修复迁移 Redis 资产账号丢失的问题(系统用户用户名为空字符串) - fix: 修复创建端点规则 IP 组不显示默认值问题 - fix: 修复云同步中更新账号不显示 IP 网段的问题【企业版】 - fix: 修复云账号 LAN 不能创建的问题【企业版】

v3.2.1

2023年4月21日

!!! summary "功能优化 🚀" - perf: 优化导入资产时节点字段允许为空

!!! success "问题修复 🐛" - fix: 修复使用自定义远程应用、资产、资产平台会报错的问题 - fix: 修复使用 Web CLI 方式连接资产时偶尔出现中文乱码的问题 - fix: 修复云同步更新实例任务时 IP 网段组不显示的问题【企业版】

v3.2.0

2023年4月20日

!!! info "新增功能 🌱" - feat: 会话分享支持读写权限的控制 - feat: 资产账号支持使用账号模版批量添加 - feat: Kubernetes 资产支持通过网关进行连接 - feat: 账号收集支持自动同步为资产账号 - feat: 资产平台支持自定义一些自动化任务,如:资产探活方式、账号验证方式和改密方式 - feat: 账号改密支持修改特权用户【企业版】 - feat: 账号改密支持 WinRM 方式(针对 Windows 资产)【企业版】 - feat: 账号改密支持网络设备(交换机)【企业版】 - feat: 账号推送支持配置推送参数,如:Sudo 权限、 Shell 类型和 Windows 用户组 - feat: 账号切换支持网络设备(交换机),如:Cisco、华为交换机、H3C - feat: 支持使用自定义远程应用连接自定义平台类型的资产(高阶用法)

!!! summary "功能优化 🚀" - perf: 优化导入导出功能 - perf: 优化资产导入的节点字段支持填写节点的完整路径 - perf: 优化用户手机号支持区号选择 - perf: 优化用户个人信息文件加密密码显示是否已设置 - perf: 优化账号列表支持单独、批量清除账号密文信息 - perf: 优化批量创建账号时支持多种处理策略,如:跳过、更新、失败 - perf: 优化远程应用使用 PowerShell 命令行进行部署 - perf: 优化连接的资产为网关时采用直连策略 (Issue) - perf: 优化资产、资产平台 http 协议页面显示为 http(s) - perf: 优化命令过滤详情显示更多信息 - perf: 优化作业中心执行历史显示作业名称 - perf: 优化创建资产时账号列表显示模版添加信息 - perf: 优化创建、更新资产后默认按照更新时间进行排序 - perf: 优化 Luna 页面用户授权树鼠标悬停显示资产的备注信息 - perf: 优化 Luna 页面连接资产使用新窗口打开时显示在当前页面 - perf: 优化 Web 远程应用连接时支持 iframe 标签选择语法 - perf: 优化资源列表批量操作下拉菜单样式 - perf: 优化通过 DBeaver 连接数据库时不再提示检查更新 - perf: 优化作业中心命令字段最大长度为 8192 字节 - perf: 优化支持旧版本的 SSH 服务端认证

!!! success "问题修复 🐛" - fix: 修复自定义 Linux 平台无法复用连接的问题 - fix: 修复 OAuth2 认证获取用户个人信息失败的问题 (Issue) - fix: 修复资产平台关闭 SFTP 选项后,Luna 页面依然显示 Web SFTP 连接方式的问题 (Issue) - fix: 修复执行批量命令时报错的问题 (Issue) - fix: 修复日志记录到 Syslog 日志系统时的中文编码问题 - fix: 修复导出账号历史记录的一些翻译信息 - fix: 修复普通用户申请工单时指定账号提示没有权限的问题 - fix: 修复 Luna 页面用户授权树默认展开所有节点的问题(同步加载方式) - fix: 修复 Luna 页面用户授权树搜索问题(同步加载方式) - fix: 修复 LDAP 导入用户时指定其他组织,还会导入到 Default 组织的问题 - fix: 修复用户首次登录选择强制启用 MFA 失败的问题 - fix: 修复账号克隆报错的问题 - fix: 修复授权规则创建账号模版弹窗取消按钮不生效问题 - fix: 修复云导入 LAN 局域网账号保存资产平台失败的问题 - fix: 修复资产树连续创建节点后连续修改节点名称,只有最后一个节点名称能修改成功的问题 - fix: 修复 Magnus 连接 Oracle 数据库 12c+ 版本认证失败的问题【企业版】 - fix: 修复 Magnus 对超长 SQL 无法解析的问题【企业版】 - fix: 修复 Magnus 对某些 Oracle 数据库获取用户名失败的问题【企业版】 - fix: 修复 Magnus 连接 Redis 数据库无用户名认证失败的问题【企业版】 - fix: 修复 v2 版本升级 v3 版本时系统用户用户名不存在可能失败的问题

v3.1.2

2023年4月11日

!!! summary "功能优化 🚀" - perf: 优化用户手机号支持选择区号

!!! success "问题修复 🐛" - fix: 修复创建资产添加模版账号后创建失败的问题 - fix: 修复 LDAP 导入用户时指定其他组织,还会导入到 Default 组织的问题 - fix: 修复 Web CLI 连接资产后,关闭窗口最后一条命令会执行的问题

v3.1.1

2023年3月27日

!!! summary "功能优化 🚀" - perf: 优化资源文件导入导出逻辑 - perf: 优化批量推送账号使用分批处理 - perf: 优化 Luna 连接资产时连接文件下载控制

!!! success "问题修复 🐛" - fix: 修复云导入中 LAN 账号保存 Platform 不可选的问题 - fix: 修复 Magnus 连接 Oracle 12c 及以上版本的数据库时,认证失败的问题【企业版】

v3.1.0

2023年3月16日

!!! info "新增功能 🌱" - feat: Web 终端连接资产支持重新连接、复制窗口操作 - feat: 授权规则授权账号时支持自动推送(通过模版添加的账号) - feat: 用户认证支持飞书国际版(Lark)【企业版】

!!! summary "功能优化 🚀" - perf: 优化资源列表表头支持左右拖动 - perf: 优化资产中的平台信息允许修改 - perf: 优化只允许系统管理员可以查看任务监控 - perf: 优化远程应用部署机增加忽略证书校验字段 - perf: 优化导入、导出文件内容 - perf: 优化资产迁移逻辑,避免应用和资产的名称冲突 - perf: 优化 Playbook 删除策略,不能删除正在执行的任务 - perf: 优化导出账号历史的一些字段翻译信息 - perf: 优化账号列表查看详情 MFA 弹窗没有关闭问题 - perf: 优化 Koko 静态资源缓存逻辑,解决 Web 终端连接资产较慢的问题

!!! success "问题修复 🐛" - fix: 修复认证 MFA 失败次数没有重置的问题 - fix: 修复资产类型树节点展开重复的问题 - fix: 修复 AD/LDAP 用户登录时邮箱已存在报错的问题 - fix: 修复 Ed25519 私钥测试可连接性失败问题 - fix: 修复创建账号上传私钥文件保存失败的问题 - fix: 修复自签证书下发布机部署失败的问题 - fix: 修复邮箱测试不填写主题前缀会报错的问题 - fix: 修复包含失效的外部存储时获取录像的失败问题 - fix: 修复存在无效 Elasticsearch 时获取终端配置失败的问题 - fix: 修复远程应用特权用户不生效的问题 - fix: 修复用户导入模版中没有密码策略字段的问题 - fix: 修复手动登录用户偶尔失败的问题 - fix: 修复日志记录到 Syslog 时中文没有解码的问题 - fix: 修复快捷命令操作按钮不能点击问题 - fix: 修复组织管理员打开用户列表报错的问题【企业版】 - fix: 修复组织管理员查看操作日志可以看到系统组织下的操作问题【企业版】

v3.0.4

2023年3月8日

!!! summary "功能优化 🚀" - perf: 优化只有系统管理员可以查看任务监控页面 - perf: 优化操作日志中敏感信息的内容显示

!!! success "问题修复 🐛" - fix: 修复组织管理员打开用户列表报错的问题 - fix: 修复组织管理员可以查看系统组织下操作日志的问题 - fix: 修复测试邮件服务器不填写邮件前缀时报错的问题 - fix: 修复创建账号时查询切换用户报错的问题

v3.0.3

2023年3月2日

!!! summary "功能优化 🚀" - perf: 优化选择平台的弹窗样式 - perf: 优化通告组件链接样式 - perf: 优化移动端菜单样式

!!! success "问题修复 🐛" - fix: 修复资产类型树展开交换机等节点时重复显示的问题 - fix: 修复作业执行普通用户没有权限的问题 - fix: 修复 LDAP 用户登录时邮箱重复报错的信息显示问题 - fix: 修复查看操作日志页面报错的问题

v3.0.2

2023年3月1日

!!! success "问题修复 🐛" - fix: 修复连接 Windows 资产时勾选自动登录后再次连接失败的问题 - fix: 修复作业中心作业管理运行任务报错的问题

v3.0.1

2023年2月27日

!!! summary "功能优化 🚀" - perf: 优化授权规则创建时账号选择,指定账号类型会给出账号建议 - perf: 优化更新资产时可以修改同类型的其他资产平台 - perf: 优化 Web GUI 方式支持的数据库类型 - perf: 优化社区版开放远程应用连接,支持通过 Web 方式访问 Web 资产和拉起远程 DBeaver 数据库客户端连接数据库资产

!!! success "问题修复 🐛" - fix: 修复社区版连接资产可能失败的问题 - fix: 修复数据库编码为 utf8mb4 时资产地址长度太长导致迁移失败的问题 - fix: 修复获取授权资产详情返回特殊信息字段,解决通过 Magnus 连接数据库失败的问题 - fix: 修复仪表盘今日活跃资产数的条件判断 - fix: 修复认证 MFA 失败次数没有清空的问题 - fix: 修复账号改密成功后邮件发送失败的问题 - fix: 修复活动日志可能创建失败的问题

v3.0.0

2023年2月27日

!!! info "新增功能 🌱" 一、用户体验全新升级

- 操作界面简约清晰,操作体验更加流畅;

二、**资产应用统一纳管**

- 合并后的资产种类包括主机、网络设备、数据库、云服务以及Web;

- 资产树视图显示包括两种,一种是用户自定义节点的视图,一种是系统内置的资产类型视图;

- 将资产应用合并为同一种实体资源,消除了冗余的管理,提高用户的管理效率;

三、**资产账号进行关联**

- 将账号强关联到某一个资产,能够更加准确的描述一个资产上的所有账号信息;

- 创建资产时可以同时添加资产账号,提高资产、账号创建效率;

- 在资产详情页面可以管理资产账号,包括添加、删除、更新、查看以及测试可连接性;

四、**账号管理全面整合**

- 账号管理模块包括账号列表、账号模版、账号推送、账号收集、账号改密以及账号备份;

- 账号列表提供了一个全局视图,管理员可以查看到系统纳管的所有账号信息;

- 账号模版相当于一个抽象账号,主要解决相同账号重复创建的问题,提高管理员的管理效率;

- 账号推送可以帮助管理员在资产上快速创建一批账号;

- 账号收集可以帮助管理员将资产上已存在的账号快速纳管到系统中;

- 账号改密可以帮助管理员批量更新资产账号认证信息的功能;

- 账号备份可以帮助管理员快速备份账号信息,并以文件的形式发送到管理员的邮箱,管理员可以选择持久留存

五、**资产平台重新设计**

- 资产平台种类和资产一致,包括主机、网络设备、数据库、Web和云服务;

- 资产平台的属性包括名称、类型、编码、支持的协议类型以及默认端口、是否启用网域功能、是否支持账号切换以及账号切换方式,还包括一些自动化配置的选项,包括资产探活、账号收集、账号推送、账号改密、账号校验等;

- 管理员在定义资产平台时,可以将一些资产的公共属性抽象到资产平台中进行统一配置,在资产中进行差异处理,这样可以提高资产纳管效率;

六、**权限管理集中控制**

- 权限管理包括资产授权、资产登录以及命令过滤;

- 资产授权主要控制用户有权限的资产,包括用户、用户组、资产、节点、以及账号;账号的选择包括,所有账号、指定账号、同名账号和手动输入;

- 资产登录主要控制用户登录资产时的附加校验,动作包括拒绝、接受和审批;

- 命令过滤主要控制用户登录资产后执行命令时的权限控制,动作包括拒绝、接受和审批;

七、**远程应用自动部署**

- 远程应用自动部署包括远程应用和应用发布机的一键部署;

- 远程应用内置了Chrome Browser、DBeaver Community、Navicat premium 16(企业版)等,在连接远程应用时会拉起调用;

- 远程应用发布机是使用远程应用功能必备的资源,主要用来安装、连接远程应用;

八、**审计日志详细记录**

- 审计日志包括会话审计、日志审计、活动日志;

- 会话审计包括会话记录、命令记录和文件传输,主要记录用户登录资产的行为信息,并且管理员可以实时监控和终断用户的在线会话;

- 日志审计包括登录日志、操作日志、改密日志、作业日志,主要记录用户、管理员的基本操作行为信息;

- 活动日志会按照时间线记录了每一个资源的活动日志,从而让管理员能够及时的掌握资源的使用情况;

九、**作业中心全面改版**

- 作业中心包括快捷命令、作业管理、模版管理以及执行历史,提高用户对于批量命令的操作效率;

- 快捷命令可以帮助用户批量对资产执行相同的命令;

- 作业管理命令作业和 Playbook 作业,可以帮助用户批量对资产执行 Shell 命令、PowerShell 命令、Python 代码或一个 Playbook 脚本;

- 模版管理相对应与作业管理包括,命令管理和 Playbook 管理,方便用户保存、复用相同的执行逻辑;

- 执行历史主要记录了用户执行的命令、脚本等日志信息;

📄 contact.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/contact.md

联系我们

1 微信公众号

wechat-official{ width="156px" }

2 微信群

wechat-group{ width="156px" }

3 开源社区论坛

!!! tip "" - 飞致云官方开源社区论坛:开源社区论坛

4 学习认证

contact01{ width="156px" }

5 项目地址

!!! tip "" - JumpServer jumpserver stars

6 联系方式

!!! tip "" - 官网:https://www.jumpserver.org/ - 邮箱:support@fit2cloud.com - 电话:400-052-0755

7 在线文档问题反馈

!!! tip "" - 如您在阅读该文档时,发现一些问题,欢迎您通过以下表单反馈给我们,我们将尽快调整优化。 - 在线文档问题反馈表

📄 rest_api.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/dev/rest_api.md

API 文档

!!! info "提示" API 文档默认已经集成在代码里面,部署完成后可以通过下面的方式进行访问

1 API 访问

!!! tip ""

|  Version                 |       Access method      |               example              |
| ------------------------ | ------------------------ | ---------------------------------- |
|  `{{ jumpserver.tag }}`  | `http://<url>/api/docs/` | `http://192.168.244.144/api/docs/` |

1.2 页面效果

api_swagger

2 API 认证

!!! tip "JumpServer API 支持的认证有以下几种方式" Session 登录后可以直接使用 session_id 作为认证方式 Token 获取一次性 Token,该 Token 有有效期, 过期作废 Private Token 永久 Token Access Key 对 Http Header 进行签名

=== "Session"
    用户通过页面后登录,cookie 中会存在  jms_sessionid,请求时同样把  jms_sessionid 放到 cookie 中

=== "Token"
    ```sh
    curl -X POST http://localhost/api/v1/authentication/auth/ \
         -H 'Content-Type: application/json' \
         -d '{"username": "admin", "password": "admin"}'
    ```
    === "Python"
        ```python
        # Python 示例
        # pip install requests
        import requests, json

        def get_token(jms_url, username, password):
            url = jms_url + '/api/v1/authentication/auth/'
            query_args = {
                "username": username,
                "password": password
            }
            response = requests.post(url, data=query_args)
            return json.loads(response.text)['token']

        def get_user_info(jms_url, token):
            url = jms_url + '/api/v1/users/users/'
            headers = {
                "Authorization": 'Bearer ' + token,
                'X-JMS-ORG': '00000000-0000-0000-0000-000000000002'
            }
            response = requests.get(url, headers=headers)
            print(json.loads(response.text))

        if __name__ == '__main__':
            jms_url = 'https://demo.jumpserver.org'
            username = 'admin'
            password = 'admin'
            token = get_token(jms_url, username, password)
            get_user_info(jms_url, token)
        ```

    === "Golang"
        ```go
        // Golang 示例
        package main

        import (
            "encoding/json"
            "fmt"
            "io/ioutil"
            "log"
            "net/http"
            "strings"
        )

        const (
            JmsServerURL = "https://demo.jumpserver.org"
            UserName = "admin"
            Password = "password"
        )

        func GetToken(jmsurl, username, password string) (string, error) {
            url := jmsurl + "/api/v1/authentication/auth/"
            query_args := strings.NewReader(`{
                "username": "`+username+`",
                "password": "`+password+`"
            }`)
            client := &http.Client{}
            req, err := http.NewRequest("POST", url, query_args)
            req.Header.Add("Content-Type", "application/json")
            resp, err := client.Do(req)
            if err != nil {
                log.Fatal(err)
            }
            defer resp.Body.Close()
            body, err := ioutil.ReadAll(resp.Body)
            if err != nil {
                log.Fatal(err)
            }
            response := map[string]interface{}{}
            json.Unmarshal(body, &response)
            return response["token"].(string), nil
        }

        func GetUserInfo(jmsurl, token string) {
            url := jmsurl + "/api/v1/users/users/"
            client := &http.Client{}
            req, err := http.NewRequest("GET", url, nil)
            req.Header.Add("Authorization", "Bearer "+token)
            req.Header.Add("X-JMS-ORG", "00000000-0000-0000-0000-000000000002")
            resp, err := client.Do(req)
            if err != nil {
                log.Fatal(err)
            }
            defer resp.Body.Close()
            body, err := ioutil.ReadAll(resp.Body)
            if err != nil {
                log.Fatal(err)
            }
            fmt.Println(string(body))
        }

        func main() {
            token, err := GetToken(JmsServerURL, UserName, Password)
            if err != nil {
                log.Fatal(err)
            }
            GetUserInfo(JmsServerURL, token)
        }
        ```
    === "Java"
        ```java
        // Java 示例
        import com.alibaba.fastjson.JSONObject;
        import org.apache.commons.lang3.StringUtils;

        import javax.net.ssl.*;
        import java.io.BufferedReader;
        import java.io.IOException;
        import java.io.InputStreamReader;
        import java.io.OutputStream;
        import java.net.URL;
        import java.util.HashMap;
        import java.util.Map;

        public class HttpsClientTest {

            private static final String JMS_URL = "hhttps://demo.jumpserver.org";
            private static final String JS_USER = "admin";
            private static final String JS_PASSWORD = "admin";

            public static void main(String[] args) throws IOException {
                Map map = new HashMap();
                map.put("username", JS_USER);
                map.put("password", JS_PASSWORD);
                https(JSONObject.toJSONString(map), "", "/api/v1/authentication/auth/");
            }

            public static void https(String params, String token, String uri) throws IOException {

                // 创建 URL 对象
                URL obj = new URL(JMS_URL + uri);
                // 打开连接
                HttpsURLConnection conn = (HttpsURLConnection) obj.openConnection();

                // 忽略证书认证
                conn.setHostnameVerifier((hostname, session) -> true);
                conn.setSSLSocketFactory(getTrustedSSLSocketFactory());

                // 设置请求方法
                conn.setRequestMethod("GET");

                // 设置请求头部
                conn.setRequestProperty("Content-Type", "application/json");
                conn.setRequestProperty("x-jms-org", "00000000-0000-0000-0000-000000000002");


                if (StringUtils.isNotBlank(token)) {
                    conn.setRequestProperty("Authorization", "Bearer " + token);
                }

                // 设置请求体数据
                conn.setDoOutput(true);
                if (StringUtils.isNotBlank(params)) {
                    try (OutputStream outputStream = conn.getOutputStream()) {
                        outputStream.write(params.getBytes("UTF-8"));
                    }
                }
                // 发送请求并获取响应
                int responseCode = conn.getResponseCode();
                BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
                String inputLine;
                StringBuilder response = new StringBuilder();
                while ((inputLine = in.readLine()) != null) {
                    response.append(inputLine);
                }
                String res = response.toString();
                in.close();
            }

            private static SSLSocketFactory getTrustedSSLSocketFactory() {
                try {
                    SSLContext sslContext = SSLContext.getInstance("TLS");
                    sslContext.init(null, new TrustManager[] { new X509TrustManager() {
                        @Override
                        public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) {
                        }

                        @Override
                        public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) {
                        }

                        @Override
                        public java.security.cert.X509Certificate[] getAcceptedIssuers() {
                            return null;
                        }
                    } }, new java.security.SecureRandom());
                    return sslContext.getSocketFactory();
                } catch (Exception e) {
                    e.printStackTrace();
                    return null;
                }
            }
        }
        ```

=== "Private Token"
    ```sh
    docker exec -it jms_core /bin/bash
    cd /opt/jumpserver/apps
    python manage.py shell
    from users.models import User
    u = User.objects.get(username='admin')
    u.create_private_token()
    ```
    已经存在 private_token,可以直接获取即可
    ```python
    u.private_token
    ```
    以 PrivateToken: 937b38011acf499eb474e2fecb424ab3 为例:
    ```sh
    curl http://demo.jumpserver.org/api/v1/users/users/ \
         -H 'Authorization: Token 937b38011acf499eb474e2fecb424ab3' \
         -H 'Content-Type: application/json' \
         -H 'X-JMS-ORG: 00000000-0000-0000-0000-000000000002'
    ```
    === "Python"
        ```python
        # Python 示例
        # pip install requests
        import requests, json

        def get_user_info(jms_url, token):
            url = jms_url + '/api/v1/users/users/'
            headers = {
                "Authorization": 'Token ' + token,
                'X-JMS-ORG': '00000000-0000-0000-0000-000000000002'
            }
            response = requests.get(url, headers=headers)
            print(json.loads(response.text))

        if __name__ == '__main__':
            jms_url = 'https://demo.jumpserver.org'
            token = '937b38011acf499eb474e2fecb424ab3'
            get_user_info(jms_url, token)
        ```

    === "Golang"
        ```go
        // Golang 示例
        package main

        import (
            "encoding/json"
            "fmt"
            "io/ioutil"
            "log"
            "net/http"
            "strings"
        )

        const (
            JmsServerURL = "https://demo.jumpserver.org"
            JMSToken = "adminToken"
        )

        func GetUserInfo(jmsurl, token string) {
            url := jmsurl + "/api/v1/users/users/"
            client := &http.Client{}
            req, err := http.NewRequest("GET", url, nil)
            req.Header.Add("Authorization", "Token "+token)
            req.Header.Add("X-JMS-ORG", "00000000-0000-0000-0000-000000000002")
            resp, err := client.Do(req)
            if err != nil {
                log.Fatal(err)
            }
            defer resp.Body.Close()
            body, err := ioutil.ReadAll(resp.Body)
            if err != nil {
                log.Fatal(err)
            }
            fmt.Println(string(body))
        }

        func main() {
            GetUserInfo(JmsServerURL, JMSToken)
        }
        ```

=== "Access Key"
    在 Web 页面 API Key 列表创建或获取 AccessKeyID AccessKeySecret
    === "Python"
        ```python
        # Python 示例
        # pip install requests drf-httpsig
        import requests, datetime, json
        from httpsig.requests_auth import HTTPSignatureAuth

        def get_auth(KeyID, SecretID):
            signature_headers = ['(request-target)', 'accept', 'date']
            auth = HTTPSignatureAuth(key_id=KeyID, secret=SecretID, algorithm='hmac-sha256', headers=signature_headers)
            return auth

        def get_user_info(jms_url, auth):
            url = jms_url + '/api/v1/users/users/'
            gmt_form = '%a, %d %b %Y %H:%M:%S GMT'
            headers = {
                'Accept': 'application/json',
                'X-JMS-ORG': '00000000-0000-0000-0000-000000000002',
                'Date': datetime.datetime.utcnow().strftime(gmt_form)
            }

            response = requests.get(url, auth=auth, headers=headers)
            print(json.loads(response.text))

        if __name__ == '__main__':
            jms_url = 'https://demo.jumpserver.org'
            KeyID = 'AccessKeyID'
            SecretID = 'AccessKeySecret'
            auth = get_auth(KeyID, SecretID)
            get_user_info(jms_url, auth)
        ```

    === "Golang"
        ```go
        // Golang 示例
        package main

        import (
            "fmt"
            "io/ioutil"
            "log"
            "net/http"
            "time"
            "gopkg.in/twindagger/httpsig.v1"
        )

        const (
            JmsServerURL = "https://demo.jumpserver.org"
            AccessKeyID = "f7373851-ea61-47bb-8357-xxxxxxxxxxx"
            AccessKeySecret = "d6ed1a06-66f7-4584-af18-xxxxxxxxxxxx"
        )

        type SigAuth struct {
            KeyID    string
            SecretID string
        }

        func (auth *SigAuth) Sign(r *http.Request) error {
            headers := []string{"(request-target)", "date"}
            signer, err := httpsig.NewRequestSigner(auth.KeyID, auth.SecretID, "hmac-sha256")
            if err != nil {
                return err
            }
            return signer.SignRequest(r, headers, nil)
        }

        func GetUserInfo(jmsurl string, auth *SigAuth) {
            url := jmsurl + "/api/v1/users/users/"
            gmtFmt := "Mon, 02 Jan 2006 15:04:05 GMT"
            client := &http.Client{}
            req, err := http.NewRequest("GET", url, nil)
            req.Header.Add("Date", time.Now().Format(gmtFmt))
            req.Header.Add("Accept", "application/json")
            req.Header.Add("X-JMS-ORG", "00000000-0000-0000-0000-000000000002")
            if err != nil {
                log.Fatal(err)
            }
            if err := auth.Sign(req); err != nil {
                log.Fatal(err)
            }
            resp, err := client.Do(req)
            if err != nil {
                log.Fatal(err)
            }
            defer resp.Body.Close()
            body, err := ioutil.ReadAll(resp.Body)
            if err != nil {
                log.Fatal(err)
            }
            json.MarshalIndent(body, "", "    ")
            fmt.Println(string(body))
        }

        func main() {
            auth := SigAuth{
                KeyID:    AccessKeyID,
                SecretID: AccessKeySecret,
            }
            GetUserInfo(JmsServerURL, &auth)
        }
        ```
    === "Java"
        ```java
        // Java 示例
        import com.google.common.net.MediaType;
        import net.adamcin.httpsig.api.*;
        import net.adamcin.httpsig.hmac.HmacKey;
        import okhttp3.OkHttpClient;
        import okhttp3.Request;
        import okhttp3.Response;

        import javax.net.ssl.SSLContext;
        import javax.net.ssl.TrustManager;
        import javax.net.ssl.X509TrustManager;
        import java.io.IOException;
        import java.security.KeyManagementException;
        import java.security.NoSuchAlgorithmException;
        import java.security.SecureRandom;
        import java.security.cert.CertificateException;
        import java.security.cert.X509Certificate;
        import java.util.HashMap;
        import java.util.Map;

        public class JMSApiClient {
            private static final String JMS_URL = "https://demo.jumpserver.org";
            private static final String KEY_ID = "f7373851-ea61-47bb-8357-xxxxxxxxxxx";
            private static final String SECRET_ID = "d6ed1a06-66f7-4584-af18-xxxxxxxxxxxx";
            private static final String ORGANIZATION_ID = "00000000-0000-0000-0000-000000000002";

            public static void main(String[] args) throws IOException {
                String apiKey = "";
                String keySecret = "";
                String endpoint = "";

                String uri = "/api/v1/users/users/";

                DefaultKeychain provider = new DefaultKeychain();
                HmacKey hmacKey = new HmacKey(apiKey, keySecret);
                provider.add(hmacKey);

                Map<String, String> headers = new HashMap<>();
                headers.put("Accept", MediaType.JSON_UTF_8.toString());
                headers.put("keyId", apiKey);
                headers.put("secret", keySecret);
                headers.put("algorithm", Algorithm.HMAC_SHA256.name());
                RequestContent.Builder requestContentBuilder = new RequestContent.Builder();

                requestContentBuilder.setRequestTarget("GET", "/api/v1/users/users/");
                for (Map.Entry<String, String> header : headers.entrySet()) {
                    requestContentBuilder.addHeader(header.getKey(), header.getValue());
                }
                if (requestContentBuilder.build().getDate() == null) {
                    requestContentBuilder.addDateNow();
                    String dateValue = requestContentBuilder.build().getDate();
                    requestContentBuilder.addHeader("date", dateValue);
                    headers.put("date", dateValue);
                }
                Signer signer = new Signer(provider, key -> hmacKey.getId());
                RequestContent requestContent = requestContentBuilder.build();
                Authorization authorization = signer.sign(requestContent);
                if (authorization != null) {
                    headers.put("Authorization", authorization.getHeaderValue());
                }

                try {
                    OkHttpClient.Builder builderClient = new OkHttpClient().newBuilder();
                    disableCertificateValidation(builderClient);
                    OkHttpClient client = builderClient.build();

                    Request.Builder builder = new Request.Builder()
                            .url(endpoint + uri)
                            .method("GET", null);
                    for (Map.Entry<String, String> header : headers.entrySet()) {
                        builder.addHeader(header.getKey(), header.getValue());
                    }
                    Request request = builder.build();
                    Response response = client.newCall(request).execute();
                    System.out.println(response.body().string());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }

            public static void disableCertificateValidation(OkHttpClient.Builder builderClient) {
                // 创建信任所有证书的 TrustManager
                try {
                    TrustManager[] trustAllCerts = new TrustManager[]{new X509TrustManager() {
                        @Override
                        public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
                        }

                        @Override
                        public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
                        }

                        @Override
                        public X509Certificate[] getAcceptedIssuers() {
                            return new X509Certificate[0];
                        }
                    }};
                    // 创建 SSLContext,并关联信任所有证书的 TrustManager
                    SSLContext sslContext = SSLContext.getInstance("TLS");
                    sslContext.init(null, trustAllCerts, new SecureRandom());
                    // 创建 OkHttpClient.Builder,并设置 SSLContext builder
                    builderClient.sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustAllCerts[0]);
                    builderClient.hostnameVerifier((hostname, session) -> true);
                } catch (NoSuchAlgorithmException | KeyManagementException e) {
                    e.printStackTrace();
                }
            }
        }
        ```

📄 shell.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/dev/shell.md

交互命令

!!! warning "操作不当将导致数据丢失,操作前请仔细确认"

1 操作方法

!!! tip "" sh docker exec -it jms_core bash cd /opt/jumpserver/apps python manage.py shell python # 新版本操作之前均需要切换到对应组织, 默认为 Default from orgs.models import * Organization.objects.all() org = Organization.objects.get(name='Default') org.change_to()

!!! tip "" - 选择交互命令对象查看

=== "User"
    ```python
    from users.models import *

    # 用户
    User.objects.all()
    User.objects.count()  # 数量

    # 指定用户查询
    user = User.objects.get(username = 'admin')

    # 查询用户邮箱
    user.email

    # 修改用户邮箱
    user.email='test@jumpserver.org'

    # 修改密码
    user.reset_password('test01')

    # 保存修改
    user.save()

    # 删除用户 MFA key
    user.otp_secret_key=''
    user.save()

    # 创建新用户
    User.objects.create(name = '测试用户', username = 'test', email = 'test@jumpserver.org')

    # 测试用户是否重名, 不存在就创建
    User.objects.get_or_create(name = '测试用户', username = 'test', email = 'test@jumpserver.org')

    user = User.objects.get(username = 'test')
    user.delete()

    # 更优雅的删除方法
    User.objects.all().filter(username='test').delete()
    ```
    ```python
    # 用户组
    UserGroup.objects.all()
    UserGroup.objects.count()

    # 创建用户组
    UserGroup.objects.create(name = 'Test')
    group = UserGroup.objects.get(name = 'Test')

    # 用户组添加用户
    user = User.objects.get(username='test')
    group.users.add(user)
    group.save()

    # 用户组删除用户
    user = User.objects.get(username='test')
    group.users.remove(user)
    group.save()

    # 删除用户组
    UserGroup.objects.all().filter(name='Test').delete()
    ```

=== "Asset"
    ```python
    from assets.models import *

    # 资产
    Asset.objects.all()
    Asset.objects.count()

    # 创建
    asset = Asset.objects.create(name = 'test', address = '172.16.0.1')

    # 删除
    asset = Asset.objects.get(name = 'test')
    asset.delete()
    ```
    ```python
    # 节点
    Node.objects.all()
    Node.objects.count()

    node = Node.objects.get(value = 'Test')

    asset = Asset.objects.get(name = 'test')
    # 添加资产到节点
    node.assets.add(asset)

    # 从节点删除资产
    node.assets.remove(asset)

    node.delete()
    ```

2 数据解密

!!! tip ""

=== "系统用户"
    ```sh
    docker exec -it jms_core bash
    cd /opt/jumpserver/apps
    python manage.py shell
    ```
    ```python
    from accounts.models import Account
    # 81aef7ac-e432-4d1b-aaf5-a3bc37c2b230 为你要查询账号的 id, 在 web 页面的账号详情里面有该字段
    a = Account.objects.get(id='81aef7ac-e432-4d1b-aaf5-a3bc37c2b230')
    ```
    ```python
    a.secret_type
    ```
    ```nginx
    Out[4]: 'password'
    ```
    ```python
    a.secret
    ```
    ```nginx
    Out[6]: '-----BEGIN RSA PRIVATE KEY-----
    MIIEpAIBAAKCAQEAxg4C1KKD5mz+3arCKETugJggR4HzEvIjAutKv+zZwAYm5SbB
    3IGXoEzdXbk/9u1btyTGbmTpKubsJh5MeGlHWExqzA2n9NsC/3hYenjwm1OP1Vhc
    bGZYnZTqbUGTiWiRhtXUCOC2yzgSdLiCLGS5XdIVEhCO3AvWZCvauhEQYu3PLlUN
    Xuc7JZBLGrZ+YVo87b+AvwpnAX2igWRTHdAlP0hL+MWoN3lzba90Jox1zJNeyZ64
    M/u1TsiMGGWs/H35SqpH9jerCl5+1Mqw5oryidYApuNOilN8ucYa6XDueweEXkHk
    oY8QxwaC8GFLZErb0Ov8lzEhlpALsCYgekiecQIDAQABAoIBAQC5W/OaPl9kES6X
    F3GPbrQo9jd/tUdhu+y4lq3m4i0JYriUTqmxTjgydr3XMcGDwLHNvkVYnGj9FhJ9
    um2nZCC5qwto3n8K1s8DegaU2QuXLX64FXKqoT8efLjKeE00lQFeSFGh3W4208uy
    Idzy33H9NNkzhvutRgboyYJ0EfRcIL/wyxc0ndMKt/bVYH8T14aWViVRF7OyiIkd
    eFx7tdnVscBSujNX027ycmjElwRf9TPNFUFwF5XGf3xwWjPmBNWr91XxPcF9VecG
    gyd9qxNd12YYGcX4SR6V0p+36Av+rZoHB0405b/ZncmevSStUCu6fTtQYwdCZj0p
    PgTradABAoGBAOVjCRleXfO9OVc4Y7sM2+1i/So5dmp66foC76j6CDKzztA2b5FX
    tduNhoObeNYdnV32WvW3/xXcFWFnbWf0Eymx2DMuxMfWlTvM0InParq0TpeVMWMP
    uxW+7YNZ9IWuuLMs3jfY1lRQBUgVlcb0zA7tjWZO/n/mKW5Fd2rItvmRAoGBAN0I
    YzFGEPoKgGqYme58KpebM1jt1XoyLtbH1ygRvaPlnLfPDBsBhrqLCyR3+oK0kFlM
    f7Neqo86hCQ/aqVC1lMu2o3htg52b1Mj2T0YUTNsPTwx+8lHciRnqJZytHRjwfFC
    4UySAzWKDDQZcIQGTAsdoXngkAZFITMBZBdRz+bhAoGAfytphvvvIEq+eGFVwQR/
    BNtFOVyEDsI35xgrn8WGN/3BYWNcdPpoYuDSOzI9So8+iDIk+WbZb1gFLmv1lpUU
    7p+fGbkK9TM8ptuEnXI1XG7Lx3O53o6BDKw95vz+98IGuabdR57aLAH0+6Kj15ot
    avU92ANhSqziOTUf4D6IWlECgYAe+kr0n+5HLOuchPCl9O7/Ongy0Xpm2tunrHBi
    JEJg0xBoznLS5h7gzBXusYYBhY7phQgsumrLEhdtARpQORa/Q8TLt8ONOVoW2+JZ
    ZqwSuevHIPY52nKL2Z9OHptd6JFI3+e1lI0wlr1pG9uiFUPZFvkHnMpypoOlo19E
    yWmK4QKBgQCVmBTLSA+M3WJqDBK2Z6lUaDCaAjwn2Q5RSq2B/lLjzaod6WYWyecY
    NASeo6CC4fxOCfMJN1DT5CLyW4XpRk3GeR4QKSfFkwD2yRqk+7opm8PppdMuLZKU
    LQMMI90AWvU3Cx9aAbl1bLSIT0qRoc5FGwmLEL12yDBZA2l3vYhnaw==
    -----END RSA PRIVATE KEY-----'
    ```

=== "系统设置字段"
    ```sh
    docker exec -it jms_core bash
    cd /opt/jumpserver/apps
    python manage.py shell
    ```
    ```python
    from settings.models import Setting

    s = Setting.objects.get(name='EMAIL_HOST_PASSWORD')
    ```
    ```python
    s.cleaned_value
    ```
    ```nginx
    Out[9]: '123456'
    ```

📄 enterprise.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/faq/enterprise.md

企业版

1 JumpServer 开源版和企业版有什么区别?

!!! tip "" JumpServer 的核心功能全部开源,坚持按月发布新版本,永久免费使用。

相比 JumpServer 开源版,JumpServer 企业版提供面向企业级应用场景的 X-Pack 增强包,以及高等级的原厂企业级支持服务,同时提供 JumpServer 运维安全最佳实践,有效助力企业快速构建并运营自己的运维安全审计系统。

X-Pack 增强包括一些企业级客户所需的附加功能,比如页面自定义 Logo、多组织管理、支持管理 Oracle、PostgreSQL 数据库等;X-Pack 增强包的具体功能会随新版发布持续增加;

!!! tip "" - JumpServer 企业版功能列表

!!! info "X-Pack 增强包功能将跟随 JumpServer 版本迭代按月持续增加,企业版客户在服务期内无需支付额外费用就可以使用上新增功能。"

2 如何申请企业版使用?企业版如何收费?

!!! tip "" JumpServer 企业版试用申请请点击:https://jinshuju.net/f/kyOYpi

我们会安排专人与您联系。

📄 faq.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/faq/faq.md

产品 FAQ

1 常见问题汇总

!!! tip "" - JumpServer 常见问题汇总 - JumpServer 查询日志方法 - JumpServer 组件相关的常见问题

2 系统管理相关

!!! tip "" - Linux 常见高危命令汇总 - JumpServer 存储目录迁移 - JumpServer 如何使用自己的 SSL 证书进行访问? - JumpServer 登录密码忘记及用户锁定如何处理 - JumpServer 堡垒机对接 Elasticsearch 集群存储命令 - 资产列表中的”可连接“与”硬件信息“如何获取? - 如何修改 JumpServer 对接其他认证方式后的等待时间? - 如何限制某个资产只允许通过某个 IP 登录 JumpServer 之后进行连接? - JumpServer 如何对接 Windows AD 域? - 如何修改 JumpServer 的上传文件大小的限制并修改上传文件的超时时间? - 如何解决纳管资产的网段与 JumpServer 后台服务器 Docker 网段重复?

3 功能模块相关

!!! tip "" - v3版本远程应用发布与使用 - Windows 资产无法连接 - Windows 资产测试可连接性 - 批量改密、资产连接性测试等任务输出显示“....” - 如何通过表格批量创建更新资产、授权、用户信息? - Windows 设备中没有虚拟设备 Guacamole RDP 解决方案 - 用户通过密钥连接 JumpServer 堡垒机 - RDP 访问组件 Razor 常见问题 - 如何通过 JumpServer 访问 Linux(CentOS)的图形化界面? - 通过开源软件 XRDP 实现堡垒机远程 Linux(Ubuntu) 桌面 - JumpServer 使用 Magnus 组件连接数据库报错 Unknown system variable 'transaction_isolation' - Razor 组件证书不可信任导致资产无法连接 - Windows 资产纳管&连接问题&文件上传下载 - Linux 资产纳管&登录连接常见错误&文件上传下载

4 身份认证相关

!!! tip "" - JumpServer 对接 SSO 身份认证 - JumpServer 对接 CAS 身份认证 - JumpServer 开启 MFA 多因子认证 - JumpServer 对接 LDAP 身份认证 - JumpServer 对接 SAML2 身份认证 - JumpServer 对接 OpenID 身份认证 - JumpServer 对接 Radius 身份认证 - JumpServer 对接钉钉 - JumpServer 对接企业微信 - JumpServer 对接飞书 - JumpServer 常用的 MFA 工具

5 版本相关

!!! tip "" - JumpServer V3 版本解读

6 升级相关

!!! tip "" - JumpServer 升级问题 - JumpServer 升级回退说明

📄 security.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/faq/security.md

安全建议

1 基本安全要求

!!! tip "" - JumpServer 对外最低需要开放 80 443 2222 端口。 - JumpServer 所在服务器操作系统应该升级到最新。 - JumpServer 依赖的软件应该升级到最新版本。 - 服务器、数据库、Redis 等依赖组件请勿使用弱口令密码。 - 不推荐关闭 Firewalld 和 SELinux。 - 只开放必要的端口,必要的话请通过 VPN 或者 SSLVPN 访问 JumpServer。 - 如果必须开放到外网使用,你应该部署 Web 应用防火墙做安全过滤。 - 请部署 SSL 证书通过 HTTPS 协议来访问 JumpServer。 - JumpServer 应该在安全设置强密码规则,禁用用户使用弱口令密码。 - 应该开启 JumpServer MFA 认证功能,避免因密码泄露导致的安全问题。

!!! warning "注意" - 如发现 JumpServer 安全问题,请反馈给我们 ibuler@fit2cloud.com

2 安全配置建议

!!! tip "" - Linux 常见高危命令汇总{:target="_blank"} - 设置某个资产只允许通过某个 IP 登录 JumpServer 之后进行连接{:target="_blank"} - JumpServer 使用用户自己的 SSL 证书进行访问{:target="_blank"} - JumpServer 增强用户登录的安全性{:target="_blank"} - JumpServer 登录资产用户切换{:target="_blank"} - JumpServer 高危命令限制{:target="_blank"} - 限制来源 IP 登录 JumpServer 堡垒机{:target="_blank"} - JumpServer 常用的 MFA 工具{:target="_blank"} - JumpServer 设置会话过期时间{:target="_blank"}

📄 account_backup.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/admin/account/account_backup.md

账号备份

!!! note "注:账号备份为 JumpServer 企业版功能。"

1 功能简述

!!! tip "" - 为了防止不可控因素导致服务器出现异常,出现数据损坏、资产账户丢失等环境无法正常运行的情况,JumpServer支持了账户备份功能,该功能可备份JumpServer上所有的资产账户。 - 备份策略可选择即时备份和定时备份。

2 账号备份任务创建

!!! tip "" - 点击账号备份页面的创建按钮,创建一个账号备份任务。 account_backup01

!!! tip "" - 详细参数说明:

| 参数    |                说明                  |
| ------- | ------------------------------------ |
| 名称 | 账号备份任务的名称。 |
| 类型 | 需要备份账号的类型,可以根据账号类型创建备份任务。 |
| 备份类型 | 支持将账号通过表格的方式备份到邮箱中,或通过SFTP的方式备份。 |
| 密钥是否拆分成前后两部分 | 是否将账号的密钥拆分,保证安全。 |
| 收件人A | 备份后的账号会发送一封邮件给用户,设置接收邮件的用户。账号的密钥会被拆分成前后两部分 |
| 收件人B | 备份后的账号会发送一封邮件给用户,设置接收邮件的用户。账号的密钥会被拆分成前后两部分。 |
| 定时执行 | 设置该备份任务是否定时任务,备份任务支持定时执行或手动执行。 |

3 执行列表

!!! tip "" - 点击切换至账号备份-执行列表页签,该页面主要查看账号备份任务的执行日志、任务详情等详细信息。 account_backup02

📄 account_change_secret.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/admin/account/account_change_secret.md

账号改密

!!! note "注:账号改密为 JumpServer 企业版功能。"

1 功能简述

!!! tip "" - 账号改密功能是为了满足用户的安全需求,定期修改资产中的用户密码,减少人力操作。 - 账号改密功能修改资产中的用户密码是通过该资产配置的特权账号进行操作。 - 账号改密目前支持 Linux 和部分支持 SSH 协议的资产,Windows 资产需安装 OpenSSH;账号改密目前不支持更改 Windows 域账号密码。

2 账号改密任务创建

!!! tip "" - 点击账号改密页面的创建按钮,创建一个账号改密任务。 account_change_secret01

!!! tip "" - 详细参数说明:

| 参数    |                说明                  |
| ------- | ------------------------------------ |
| 名称 | 账号改密自动化任务的名称。 |
| 用户名 | 需要改密的用户名。 |
| 资产 | 需要改密的用户名目标资产。 |
| 节点 | 需要改密的用户名目标资产所在的节点。 |
| 密码策略-密文生成策略 | 选择被改密的用户的密码策略。 <br> A.指定:管理员用户手动输入密码。 <br> B.随机:JumpServer 自行生成密码。 |
| 密码策略-密文类型 | 改密用户名的密文类型,支持密码和 SSH 密钥。 |
| 定时执行 | 选择该自动化任务是否定时执行,设置定时任务执行时间。 |
| 收件人 | 选择用户接受改密后的邮件通知信息。 |

3 执行列表

!!! tip "" - 点击切换至账号改密-执行列表页签,该页面主要查看账号改密任务的执行日志、任务详情等详细信息。 account_change_secret02

📄 account_gather.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/admin/account/account_gather.md

账号收集

!!! note "注:账号收集为 JumpServer 企业版功能。"

1 功能简述

!!! tip "" - JumpServer 可以收集资产上的账号,通过创建任务,定时或者手动的执行,去收集各个资产上的用户账号信息,并且支持帐号同步。 account_gather01

1.1 帐号同步

!!! tip "" - 支持将收集到的帐号同步到对应资产中的帐号列表,并且支持同步后做同步删除动作。 account_gather04

2 收集任务创建

!!! tip "" - 点击账号收集-收集任务页签的创建按钮,创建一个账号收集任务。 account_gather02

!!! tip "" - 详细参数说明:

| 参数    |                说明                  |
| ------- | ------------------------------------ |
| 名称 | 账号收集任务的名称。 |
| 节点 | 需要做账号收集任务的资产节点。 |
| 定时执行 | 选择该自动化任务是否定时执行,设置定时任务执行时间。 |
| 同步到资产 | 将收集到的帐号同步到资产中。 |

3 执行列表

!!! tip "" - 点击切换至账号收集-执行列表页签,该页面主要查看账号收集任务的执行日志、任务详情等详细信息。 account_gather03

📄 account_list.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/admin/account/account_list.md

账号列表

1 功能简述

!!! tip "" - JumpServer 支持对资产的账号进行托管管理。

2 功能使用

2.1 账号信息查看

!!! tip "" - 点击页面左侧的资产树或者类型树选择节点或者资产,可以查看相关资产关联的账号信息(默认需要校验管理员账户的MFA) account_list01

!!! tip "提示" - 查看账号详细信息例如账号密码时需要验证用户的MFA。 - JumpServer 为提高安全性,默认查看密码需要校验MFA;如需取消验证MFA,可以在JumpServer的配置文件(默认为/opt/jumpserver/config/config.txt)中添加配置项SECURITY_VIEW_AUTH_NEED_MFA=False并重启 JumpServer 服务。

2.2 账号信息导入/导出

!!! tip "" - 可以针对账户信息批量导入/导出,JumpServer 支持导出所有资产关联账号的详细信息与账号密码。 account_list02

📄 account_push.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/admin/account/account_push.md

账号推送

1 功能简述

!!! tip "" - JumpServer 支持自动化推送用户到纳管的资产中。

2 账号推送规则的创建

!!! tip "" - 点击账号推送页面的创建按钮,创建一个账户推送任务。 account_push01

!!! tip "" - 详细参数说明:

| 参数    |                说明                  |
| ------- | ------------------------------------ |
| 名称 | 账号推送任务的名称。 |
| 资产 | 需要被推送账户的资产。 |
| 节点 | 需要被推送账户的节点。 |
| 用户名 | 被推送的资产账户名称。 |
| 密码策略-密文生成策略 | 选择被推送的用户的密码策略。 <br> A.指定:管理员用户手动输入密码; <br>B.随机:JumpServer 自行生成密码。 |
| 密码策略-密文类型 | 被推送的用户密文的类型。 |
| 密码策略-密码 | A.选择密文生成策略为指定,管理员用户输入密码; <br> B.选择密文生成策略为随机,管理员用户设置密码长度。 |
| 定时执行 | 选择该自动化任务是否定时执行,设置定时任务执行时间。 |

3 执行列表

!!! tip "" - 点击切换至账号推送-执行列表页签,该页面主要查看账号推送计划任务的执行日志、任务详情等详细信息。 account_push02

!!! tip "" - 执行日志示例图如下: account_push03

📄 account_template.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/admin/account/account_template.md

账号模版

1 功能简述

!!! tip "" - 在纳管资产中,可能会出现多个资产账户与密码相同的情况,账号模板功能即简化每一次创建资产时创建系统用户步骤,授权时选择账号模板,账号模板即一个账户信息。

2 账号模版创建

!!! tip "" - 点击账号模版页面的创建按钮,即进入账号模版创建页面。 account_template01

📄 admin_tickets.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/admin/admin_tickets.md

工单

!!! note "注:工单为 JumpServer 企业版功能。"

1 功能简述

!!! tip "" - 工单功能主要负责授权工单的申请与审核,同时 JumpServer 堡垒机支持二级审批流程。 - 工单功能支持对 JumpServer 用户登录请求的行为以及命令过滤功能进行限制。 - 用户点击申请、申请授权工单信息,根据设置完成的流程对应的审批人审批通过后,用户即可获得申请资产的权限或用户登录请求与命令过滤。 admin_tickets01

2 我的申请

!!! tip "" - 我的申请页面主要进行资产授权的申请、查看资产授权工单详情。

2.1 申请工单

!!! tip "" - 在我的申请页面点击申请工单按钮。 - 选择申请资产授权按钮,进入资产授权申请页面如下所示: admin_tickets02

!!! tip "" - 详细参数说明:

| 参数     | 说明                  |
| ------- | --------------------- |
| 标题 | 该工单的标题。 |
| 组织 ID | 该工单所申请的权限以及 JumpServer 用户所处的组织。 |
| 节点 | JumpServer 用户申请的资产,节点指申请整个节点下所有资产的权限。 |
| 资产 | JumpServer 用户申请的资产。 |
| 申请账号 | JumpServer 用户申请的资产所使用的登录账号。 |
| 动作 | JumpServer 用户申请拥有的动作权限。 |
| 开始日期、失效日期 | 用户申请的权限使用的期限。 |

2.2 查看工单

!!! tip "" - 点击创建好的工单标题按钮,可进入工单详情页中。 - 工单详情页中包含该工单的基本信息、申请信息以及审批人同时可以与审批人进行对话。 admin_tickets03

2.3 关闭工单

!!! tip "" - 申请人在审批人未审批前可自行关闭工单,关闭入口位于工单详情页下方。 admin_tickets04

3 待我审批

!!! tip "" - 在待我审批页面,点击工单名称按钮,对工单进行查阅审批。 - 审批人查看工单时,可修改申请人申请的资产、账号、动作等权限。 admin_tickets05

4 流程设置

4.1 查看

!!! tip "" - 点击申请资产按钮即可进入申请资产的流程详情页,查看申请资产工单的基本信息以及审批信息。 admin_tickets06

!!! tip "审批人流转规则如下:" - 审批人为超级管理员,申请人为普通用户时正常流转。 - 审批人为两个用户时,当其中一个用户申请工单时,审批流程只会流转到另一个用户。 - 审批人并不局限于组织内,某一个用户不存在于当前组织但只要条件符合也会流转到用户。

4.2 更新

!!! tip "" - 点击申请资产流程后方的更新按钮,即可进入流程更新页面,调整审批的级别与审批流程信息。 admin_tickets07

📄 asset_list.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/admin/asset/asset_list.md

资产列表

!!! note "注:云同步为 JumpServer 企业版功能。" !!! note "注:Oracle、PostgreSQL、SQL Server、ClickHouse 数据库均为 JumpServer 企业版功能。"

1 资产树与类型树

1.1 资产树

!!! tip "" - 资产树是对资产类别的一个划分,对于每个资产,可以按照不同维度进行划分,同一资产可以存在多维度的划分,例如:按照组织划分、按照项目划分、按照协议划分等等。 - 划分节点后,可以灵活的分配用户权限,达到高效管理主机的目的。 - 资产树根节点不能重名,右击节点可以添加、删除和重命名节点,以及资产的相关操作。 asset_list01

!!! tip "" - 详细参数说明:

| 参数    |                说明                  |
| -------| ------------------------------------ |
| 创建节点 | 在当前节点下创建一个新的子节点。  |
| 重命名节点 | 重命名节点。 |
| 删除节点 | 删除当前节点。 |
| 添加资产到节点 | 将其他节点的资产添加到当前节点下,原节点下资产不会被移除。 |
| 移动资产到节点 | 将其他节点的资产移动到当前节点下,原节点下的资产会被移除。 |
| 更新节点资产硬件信息 | 拉起自动化任务,批量更新当前节点下资产硬件信息。 <br> 注:需当前节点下的资产开启了自动化任务并配置正确的特权用户,该功能只支持 SSH 协议。|
| 测试资产节点可连接性 | 拉起自动化任务,批量更新当前节点下资产的可连接性。 <br> 注:需当前节点下的资产开启了自动化任务并配置正确的特权用户,该功能只支持 SSH 协议。 |
| 仅显示当前节点资产 | 只显示当前节点下的资产,不显示子节点下的资产。 |
| 显示所有子节点资产 | 当前节点下和所有子节点下的资产都显示出来,不论子节点下是否还有多层子节点。 |
| 校对资产数量 | 校对当前节点下的资产数量。 |
| 显示节点详情 | 显示当前节点的详细信息,包含节点ID、名称与全称。 |

1.2 类型树

!!! tip "" - 类型树是对资产的另一种区分,JumpServer将主机、网络设备、数据库等均归类于JumpServer资产,类型树主要主要统计每一种类型的资产数量更直观的查看资产分布。 asset_list02

2 资产类型

!!! tip "" - JumpServer 将主机、网络设备、数据库等等均归类于 JumpServer 资产。 - 管理员用户可以自行在平台列表中自定义平台类型。 - 主机类型中默认包含 Linux 资产、Windows 资产、Unix 资产等。 asset_list03

!!! tip "" - 网络设备类型中默认包含 General、Cisco 等。 asset_list04

!!! tip "" - 数据库类型中默认包含 MySQL、MariaDB、Oracle、Redis 等。 asset_list05

!!! tip "" - 云服务中默认包含私有云与 Kubernetes。 asset_list06

!!! tip "" - Web 类型中默认包含网站。 asset_list07

!!! tip "" - GPT 类型中默认包含 ChatGPT。 asset_list18

3 资产创建

3.1 手动创建单个资产

=== "主机" !!! tip "" - JumpServer 支持手动创建资产,资产的创建需要填入资产的基本信息、账号、节点信息等必要信息。 - 点击资产分类进入具体的分类页面(以 Linux 主机为例) - 点击页面左上角的创建按钮,进入资产创建页面,填写资产详细信息。 asset_list08

!!! tip ""
    - 详细参数说明:

    | 参数    |                说明                  |
    | -------| ------------------------------------ |
    | 名称 | 必填项,该资产在 JumpServer 中的名称,与资产本身计算机名无关,不可重名。  |
    | IP/主机 | 必填项,资产的真实 IP 或 VIP 或域名。允许重名。 |
    | 资产平台 | 默认项,资产的资产平台,各个平台可以设置不同的字符编码及连接参数以及改密命令。 |
    | 节点 | 必填项,该资产所属于的节点。 |
    | 协议组 | 必填项,资产访问时用到的协议,可选一个或多个。 |
    | 账号列表 | 必填项,该资产的账号,可创建多个账号。账号与资产绑定。 |
    | 网域 | 可选项,针对某些跨网段资产,需要以网域网关(sshpass)为代理进行访问。 |
    | 标签 | 可选项,给该资产添加的标签, 方便管理。 |
    | 激活 | 必选项,该资产是否可使用。 |

=== "GPT" !!! tip "" - JumpServer 支持创建 GPT 资产,资产的创建需要填入资产的基本信息、代理地址、账号、节点信息等必要信息。 asset_list19

!!! tip ""
    - 详细参数说明:

    | 参数    |                说明                  |
    | -------| ------------------------------------ |
    | 名称 | 必填项,该资产在 JumpServer 中的名称,与资产本身计算机名无关,不可重名。  |
    | 地址 | 必填项,Chat.openai 的地址。 |
    | 资产平台 | 默认项,资产的资产平台。 |
    | 节点 | 必填项,该资产所属于的节点。 |
    | HTTP(s) 代理 | 如果服务器不能直接访问 API 地址,你需要设置一个 HTTP 代理。例如 http(s)://host:port |
    | 账号列表 | 必填项,该资产的账号,可创建多个账号。账号与资产绑定。 |
    | 标签 | 可选项,给该资产添加的标签, 方便管理。 |
    | 激活 | 必选项,该资产是否可使用。 |

=== "Website" !!! tip "" - Website 资产创建方式参考

3.2 通过 Excel 批量导入资产

!!! tip "" - JumpServer 支持通过Excel表格导入进行批量创建、更新资产。 - JumpServer 提供两种模板信息,csv 与 xlsx 模板。 - 首次导入资产,可点击资产列表的右上角导入按钮,下载导入模板后根据模板提示填写需要导入或更新的信息,填写完成后在导入页面导入文件即可。 asset_list09

3.3 云同步

!!! tip "" - JumpServer 堡垒机提供云主机同步功能。 - 云同步功能支持将云资产同步到 JumpServer 堡垒机中。 - 通过创建云账号和同步实例将阿里云、腾讯云、华为云、百度云、京东云、金山云、AWS(中国)、AWS(国际)、Azure(中国)、Azure(国际)、谷歌云、VMware、青云私有云、华为私有云、天翼私有云、OpenStack、Nutanix、Fusion Compute、局域网等云资产同步到 JumpServer 资产列表。

!!! tip "" - 点击页面左侧资产列表按钮,进入资产列表页面。 - 点击资产列表页面的主机页签,点击云同步按钮,进入云同步页面。 asset_list10

!!! tip "" - 点击云同步页面的云账号页签,在此页面上创建云账号,以腾讯云为例(在腾讯云的账号页面获取腾讯云的相关密钥) asset_list11 asset_list12

!!! tip "" - 点击云同步页面的同步策略页签,在此页面上创建同步策略。 asset_list18 asset_list19

!!! tip "" - 点击云同步页面的同步任务页签,在此页面上创建同步任务实例。 asset_list13 asset_list14

!!! tip "" - 详细参数说明:

| 参数    |                说明                  |
| -------| ------------------------------------ |
| 名称 | 同步任务的名称。 |
| 云账号 | 同步源的账号,即账号列表中的账号。 |
| 地域 | 账号列表中可识别的地域,即需求同步的资产所处的地域。 |
| 主机名策略 | 同步资产的主机名,选择`实例名称`或`实例名称+部分 IP` |
| IP网段组 | 同步资产被匹配的 IP 网段组。如果匹配成功,资产即可被同步。 |
| 同步IP类型 | 同步资产被同步的 IP 类型,私有 IP 或者公网 IP。 |
| 资产信息保持最新 | 每次执行同步任务时,是否更新资产的所有信息。 |
| 资产完全同步 | 当资产条件不满足匹配资产策略时,是否继续同步此类资产。 |
| 策略 | 选择需要匹配的策略。 |
| 定时执行 | 是否开启定时执行。 |

!!! tip "" - 点击提交按钮后,同步实例任务创建完成。 - 同步任务可定时执行也可手动执行。 - 手动执行即点击同步任务实例后方的更多按钮,选择执行按钮,即可执行同步任务。 asset_list20

4 资产更新

!!! tip "" - 当需求对某一个资产的信息进行更新时,可点击资产后方的更新按钮,进入资产信息更新页面,更新资产相关信息。 asset_list15

5 资产详情

!!! tip "" - 在资产列表页面点击资产名称,进入资产详情页面。 - 资产详情页包含的信息包括资产基本信息、资产账号列表、授权用户、会话记录、命令记录、资产活动记录。 asset_list16

!!! tip "" - 详细参数说明:

| 参数    |                说明                  |
| -------| ------------------------------------ |
| 基本信息 | 基本信息模块主要介绍资产的信息,包括名称、协议、资产平台等。 |
| 快速更新 | 快速更新模块主要进行资产的自动化任务执行,例如:更新资产硬件信息与资产可连接性。 |
| 节点 | 节点模块可以调整资产所属的模块。 |
| 标签 | 标签模块可以查看资产所属的标签。 |
| 账号列表 | 账号列表模块主要包含资产绑定的账号信息,在此模块进行账号的增加、删除、查看、修改。 |
| 授权用户 | 授权用户模块主要介绍资产被授权的用户以及用户组并查看对应的授权规则。 |
| 会话记录 | 会话记录模块记录该资产的会话信息,包括连接用户、连接时间等。 |
| 命令记录 | 命令记录模块主要记录该资产上执行过的命令记录。 |
| 活动记录 | 活动记录模块主要查看资产最近30次的日志,包含更新日志和会话记录。 |

6 资产删除

!!! tip "" - 当需要删除某个资产时,可以点击相应的资产后方的更多按钮,选择删除按钮,点击删除即可。 asset_list17

📄 domain_list.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/admin/asset/domain_list.md

网域列表

1 功能简述

!!! tip "" - JumpServer 支持网域功能。 - 网域功能是为了解决部分环境无法连接的问题,原理是通过网关服务器进行 SSH 隧道进行流量转发。 - 点击页面左侧的网域列表按钮,进入网域列表界面。网域列表界面主要针对于 JumpServer 的网域进行增加、删除、更改、查看。 domain_list01

2 网域创建/更新/删除

!!! tip "" - 点击网域列表页面的创建按钮,进入网域列表信息设置页面,填写网域信息。 domain_list02

!!! tip "" - 当需要更新某个网域信息时,可以点击相应的网域名称后方的更新按钮,进入网域信息更新页面,更新网域相关信息。 - 当需要删除某个网域时,可以点击相应的网域名称后方的更多按钮,选择删除按钮,点击删除即可。 domain_list05

3 网关创建/更新/删除

!!! tip "" - 在创建好网域名称后,点击网域名称进入网域详情页面,选择网关列表,进入创建页面,创建网关,填写网关信息。 domain_list03 domain_list04

!!! tip "" - 当需要更新某个网关信息时,可以点击相应的网域名称进入网域详情页面,切换至网关列表,点击相应网关名称后方的更新按钮,进入网关信息更新页面,更新网关相关信息。 - 当需要删除某个网关时,可以点击相应的网域名称进入网域详情页面,切换至网关列表,点击相应网关名称后方的更多按钮,选择删除按钮,点击删除即可。 domain_list06

📄 platform_list.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/admin/asset/platform_list.md

平台列表

1 功能简述

!!! tip "" - JumpServer 支持用户自定义平台列表。 - 平台列表在创建资产时供选择,用户可以在创建资产时为资产选择不同的系统类型,如 Linux、Windows 等。 - 用户也可以新建一个平台类型,并选择指定的基础平台,就可以在创建资产中指定新建的平台类型。 platform_list01

2 资产平台的创建

!!! tip "" - 点击平台列表页面的创建按钮,填写资产平台的信息即可创建新的资产平台,以 Linux 为例。 platform_list02 platform_list03

!!! tip "" - 详细参数说明:

| 参数    |                说明                  |
| ------- | ------------------------------------ |
| 名称 | 资产平台的名称。 |
| 类型 | 资产平台的类型,不同的系统类型决定不同的编码与自动化方式。 |
| 编码 | 资产平台选择的编码方式,可选择"UTF8"或"GBK"。 |
| 启用网域 | 是否启用网域,某些类型的平台中不可开启即该平台类型不支持启用网域。 |
| 支持的协议 | 设置资产平台支持的协议,每个平台中默认的协议不可删除。协议的默认端口号支持修改。 |

!!! tip "" - 切换账号参数说明:

| 启用/禁用  |                说明                  |
| --------- | ------------------------------------ |
| 启用切换账号 | 启用切换账号,支持的帐号切换方式有`sudo su -`、`su -`。 |
| 不启用切换账号 | 不启用切换账号功能。某些资产平台中不支持启用切换账号即表示该资产平台不支持切换账号功能。 |

!!! tip "" - 自动化参数说明(启用状态),不启用为自动化任务关闭:

| 参数  |                说明                  |
| --------- | ------------------------------------ |
| Ansible配置 | Ansible 连接等信息配置。一般不进行修改。 |
| 启用资产探测 | 是否启用资产探测,即获取资产连接性。 |
| 资产探测方式 | 设置资产的探测方式。 |
| 收集资产信息 | 是否启用资产信息,即获取资产硬件信息等。 |
| 收集信息方式 | 设置收集信息的方式。 |
| 启用账号改密 | 是否启用账号改密。 |
| 账号改密方式 | 设置账号改密的方式。 |
| 启用推送账号 | 是否开启推送账号。 |
| 推送账号方式 | 设置推送账号的方式。账号推送中可更改推送账号的默认参数。 |
| 启用校验账号 | 是否开启校验账号。 |
| 校验账号方式 | 设置校验账号的方式。 |
| 启用账号收集 | 是否启用账号收集功能。 |
| 收集账号方式 | 设置收集账号的方式。 |

3 自定义 SFTP 目录路径

!!! tip "" - SFTP 目录的默认路径为/tmp ,我们支持自定义该目录。 - 点击平台列表页面的创建按钮,增加SFTP协议后点击配置后方的齿轮按钮。 platform_list04

!!! tip "" - 自定义修改 SFTP home 目录即可。 platform_list05

📄 dashboard.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/admin/dashboard.md

仪表盘

1 功能简述

!!! tip "" - JumpServer 的仪表盘页面,主要展示用户与资产以及登录会话情况的概览数据。 - 系统管理员可切换到各个组织下,看到该组织的用户总数、资产总数、在线用户、在线会话等。 - 组织管理员只能看到某个组织的概览数据。 - JumpServer 系统内置全局组织,系统管理员通过全局组织下可看到整个 JumpServer 平台的综合数据。

2 仪表盘页面展示

admin_dashboard01

3 仪表盘页面导出为图片

!!! tip "" - JumpServer 支持将仪表盘页面的图像(用户/资产活跃情况、用户数据库图、资产数据图、资产类型占比)导出为图片,方便保存,在该页面中空白处鼠标右击,选择图片另存为按钮。 admin_dashboard02

📄 label_list.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/admin/more_options/label_list.md

标签列表

1 功能简述

!!! tip "" - JumpServer支持标签功能。将资产打上标签便于查询和管理,可以由用户自定义资产的各种属性,方便归类汇总分析。

2 标签的创建

!!! tip "" - 点击标签管理页面左上角创建按钮,进入标签创建页面。 label_list01

!!! tip "提示" - 标签信息有名称和值。 - 名称可以是描述功能信息,例如:用途。 - 值则可以是具体信息,例如:组织,1-部门1-研发。 - 在创建资产的时候,可以选择为该资产打上标签,标签名称可以重名,一个资产可以有多个标签。 - 标签删除,资产上的标签信息会自动消失。

3 标签的绑定

!!! tip "" - 在创建资产的页面中选择标签绑定。 label_list02

📄 asset_permissions.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/admin/permission/asset_permissions.md

资产授权

1 功能简述

!!! tip "" - 资产的授权规则通过三个维度确定用户能使用哪个资产登录账号访问哪些资产并且拥有什么样的权限。

!!! tip "" - 资产授权规则三个维度分别如下:

| 序号 | 维度   |                说明                  |
| -- | ------- | ------------------------------------ |
| 1 | 用户 | 用户维度主要包括用户与用户组(代表该用户组下所有的用户) |
| 2 | 资产 | 资产维度主要包括资产、节点(资产组的概念,代表该节点下的所有资产)、账号(登录资产的账号) |
| 3 | 动作 | 动作维度主要包括连接权限、上传下载权限、复制粘贴权限(仅支持SSH协议、RDP协议和VNC协议) |

2 创建资产授权规则

!!! tip "" - 点击资产授权页面的创建按钮,即进入资产授权创建页面。 asset_permissions01

!!! tip "" - 详细参数说明:

| 参数    |                说明                  |
| ------- | ------------------------------------ |
| 名称 | 授权规则的名称。 |
| 用户 | JumpServer 登录用户,即给该用户授权后续资产的连接或其它权限。 |
| 用户组 | JumpServer 登录用户组,即给该用户组授权后续资产的连接或其它权限。 |
| 资产 | 授权的资产,即用户需求连接的资产。 |
| 节点 | 授权的节点,即用户需求连接的资产组。 |
| 账号 | 授权资产登录的账号。 <br> A.所有账号:资产上添加的所有账号都授权; <br> B.指定账号:手动输入需要授权的账号名称; <br> C.手动输入:授权用户连接时自行输入用户名/密码; <br> D.同名账户:授权用户连接时使用与用户同名的账号 |
| 协议 | A.所有:所有协议均可使用;  <br> B.指定: 指定用户使用 SSH、SFTP、RDP 等协议。 |
| 权限 | 授权的动作,即用户对资产可以做什么。 <br> 注:剪贴板权限控制目前仅支持RDP/VNC协议的连接。 |
| 开始日期 | 该授权规则开始的时间,默认为该授权规则创建的时间。 |
| 失效日期 | 该授权规则失效的时间。 |

3 资产授权示例

3.1 仅给某个用户授权某资产

!!! tip "" - 选择将用户模块中的用户选项选择为需要授权的用户,用户组选项置空; - 选择将资产模块中的资产选项为需要登录的资产,节点选项为空,账号选择所有账户。

!!! tip ""
- 授权规则截图如下: asset_permissions02

3.2 给某个用户组授权某资产

!!! tip "" - 选择将用户模块用户组选项选择为需要授权的用户组,用户选项为空; - 选择将资产模块中的资产选项选择为需要登录的资产,节点选项为空,账号选择所有账户。

!!! tip "" - 用户组截图如下: asset_permissions03

!!! tip "" - 授权规则截图如下: asset_permissions04

!!! warning "注意" - 授权规则模块中的任何选项都为空的情况下,该授权规则不起任何作用。 - 授权规则模块中的任一模块选项都为空的情况下,该授权规则不起任何作用。 - 授权规则不能使用“*”进行全匹配。

📄 cmd_acls.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/admin/permission/cmd_acls.md

命令过滤

1 功能简述

!!! tip "" - JumpServer 支持对会话过程中使用的命令进行过滤,设置命令过滤规则。 - 命令过滤器可以绑定 JumpServer 用户、资产、连接资产使用的用户,一个命令过滤可以绑定多个命令组,当绑定的用户用绑定的账号连接绑定的资产执行命令时,这个命令需要被绑定过滤器的所有命令组进行匹配,高优先级先被匹配;当某一条规则被匹配到后,会根据该规则的动作执行,如果没有匹配到对应的规则,命令即正常执行。

2 命令过滤的创建

!!! tip "" - 该页面可以针对命令过滤器进行创建、删除、更新、查看。 - 点击命令过滤页面的命令过滤页签即进入命令过滤器的页面。 - 点击该页面左上角的创建按钮,即可创建命令过滤器。 cmd_acls01

!!! tip "" - 详细参数说明:

| 参数    |                说明                  |
| ------- | ------------------------------------ |
| 名称 | 命令过滤器的名称。 |
| 用户 | A."所有用户":所有用户资源; <br> B."指定用户":指定用户资源; <br> C."属性筛选":根据属性名来匹配属性值筛选目标资源。 |
| 资产 | A."所有资产":所有资产资源; <br> B."指定资产":指定资产资源; <br> C."属性筛选":根据属性名来匹配属性值筛选目标资源。 |
| 帐号 | A."所有帐号":所有帐号资源; <br> B."指定帐号":指定帐号资源。 |
| 命令组 | 该命令过滤器关联的命令组,当匹配到的 JumpSerevr 使用匹配到的系统用户登录匹配到的资产执行这些命令时执行相应的动作。 |
| 动作 | 匹配到该资产登录规则时做出的动作。 <br> A."拒绝":拒绝登录资产; <br>B."接收":允许登录资产; <br>C."审批":审批人会收到命令复核通知,即可允许或拒绝相应动作执行; <br>D."告警":当匹配导指令时,发送告警信息给指定人员。 |
| 优先级 | 命令过滤器的优先级,优先级可选范围为1~100,数值越小规则匹配越优先,默认为50。 |

3 命令组的创建

!!! tip "" - 命令组可以绑定到命令过滤器中,命令组目前支持两种语法,分别是正则表达式和命令。 - 点击命令过滤页面的命令组页签即进入命令过滤器的页面。 - 点击该页面左上角的创建按钮,即可创建命令组。 cmd_acls02

!!! tip "" - 详细参数说明:

| 参数    |                说明                  |
| ------- | ------------------------------------ |
| 名称 | 命令组的名称。 |
| 类型 | 正则表达式表示通过正则表达式进行命令匹配,命令则表示过滤某固定命令。 |
| 内容 | 内容可以是多行文本,每一行代表一条匹配规则。 |
| 忽略大小写 | 指将填入的命令不论大小写,一律按规则进行筛选。 |

📄 connect_method_acls.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/admin/permission/connect_method_acls.md

连接方式

!!! note "注:连接方式控制为 JumpServer 企业版功能。"

1 功能简述

!!! tip "" - JumpServer 支持在资产连接时进行连接方式的控制。 - 通过连接方式过滤,您可以控制用户是否可以使用某种连接方式登录到资产上。根据您设定的规则,某些连接方式可以被放行,而另一些连接方式则被禁止。

2 连接方式控制规则的创建

!!! tip "" - 点击权限管理-连接方式页面的创建按钮,填写连接方式控制规则的信息。 connect_method_acls01

!!! tip "" - 详细参数说明:

| 参数    |                说明                  |
| ------- | ------------------------------------ |
| 名称 | 连接方式控制规则的名称。 |
| 优先级 | 连接方式控制规则的优先级,优先级可选范围为1~100,数值越小规则匹配越优先,默认为50。 |
| 用户 | A."所有用户":所有用户资源; <br> B."指定用户":指定用户资源; <br> C."属性筛选":根据属性名来匹配属性值筛选目标资源。 |
| 连接方式 | JumpServer 提供的资产连接方式,常见的有:Web Cli、Web SFTP、SSH、Web GUI、数据库客户端等 |
| 动作 | 匹配到连接方式控制规则时做出的动作。 <br>A."拒绝":拒绝使用规则中限制的连接方式。 |

📄 host_acls.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/admin/permission/host_acls.md

资产登录

!!! note "注:资产登录复核为 JumpServer 企业版功能。"

1 功能简述

!!! tip "" - JumpServer 支持对资产登录进行二次复核功能。 - 依据安全策略,系统可以针对 JumpServer 登录用户、资产信息、账号信息三个维度对资产的登录进行限制,当设置二次复核动作时,执行审批人审批资产登录。

2 资产登录规则的创建

!!! tip "" - 点击权限管理-资产登录页面的创建按钮,填写资产登录规则的信息。 host_acls01

!!! tip "" - 详细参数说明:

| 参数    |                说明                  |
| ------- | ------------------------------------ |
| 名称 | 资产登录规则的名称。 |
| 优先级 | 资产登录规则的优先级,优先级可选范围为1~100,数值越小规则匹配越优先,默认为50。 |
| 用户 | A."所有用户":所有用户资源; <br> B."指定用户":指定用户资源; <br> C."属性筛选":根据属性名来匹配属性值筛选目标资源。 |
| 资产 | A."所有资产":所有资产资源; <br> B."指定资产":指定资产资源; <br> C."属性筛选":根据属性名来匹配属性值筛选目标资源。 |
| 帐号 | A."所有帐号":所有帐号资源; <br> B."指定帐号":指定帐号资源。 |
| 登录IP | 限制资产登录的IP地址。 |
| 时段 | 限制资产登录的时间段。 |
| 动作 | 匹配到该资产登录规则时做出的动作。 <br>A."拒绝":拒绝登录资产; <br>B."接收":允许登录资产; <br>C."审批":经过设置的审批人审批允许或者拒绝登录; <br>D."通知": 指定接收人,触发规则后发送通知。 |

📄 user_acls.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/admin/permission/user_acls.md

用户登录

1 功能简述

!!! tip "" - JumpServer 支持对用户登录进行二次复核功能。 - 依据安全策略,系统可以针对 JumpServer 登录用户属性来对用户的登录进行限制,当设置二次复核动作时,执行审批人审批用户登录。

2 用户登录规则的创建

!!! tip "" - 点击权限管理-用户登录页面的创建按钮,填写用户登录规则的信息。 user_acls01

!!! tip "" - 详细参数说明:

| 参数    |                说明                  |
| ------- | ------------------------------------ |
| 名称 | 用户登录规则的名称。 |
| 优先级 | 用户登录规则的优先级,优先级可选范围为1~100,数值越小规则匹配越优先,默认为50。 |
| 用户 | A."所有用户":所有用户资源; <br> B."指定用户":指定用户资源; <br> C."属性筛选":根据属性名来匹配属性值筛选目标资源。 |
| IP组 | 限制用户登录的IP地址。 |
| 时段 | 限制用户登录的时间段。 |
| 动作 | 匹配到该用户登录规则时做出的动作。 <br>A."拒绝":拒绝用户登录; <br>B."接收":允许用户登录; <br>C."审批":经过设置的审批人审批允许或者拒绝登录; <br>D."通知": 指定接收人,触发规则后发送通知。 |

📄 role_list.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/admin/user/role_list.md

角色列表

!!! note "注:自定义角色为 JumpServer 企业版功能。"

1 功能简述

!!! tip "" - JumpServer 系统中角色可以分为系统角色和组织角色。 - 系统角色默认有系统管理员、系统审计员、用户与系统组件;组织角色默认有组织管理员、组织审计员、组织用户。默认角色不可以进行删除,更新等操作。

2 创建角色

!!! tip "" - 点击角色列表页面左侧上方的创建按钮,进入角色创建页面。 - 系统角色与组织角色均可新建。 role_list01 role_list02

!!! tip "" - 创建角色成功后,进入新创建的角色详情页,可以对该角色进行权限设置。 - 如下图,右边部分为角色的权限设置。根据需求的权限更新设置后,点击更新按钮提交。 role_list03

3 角色导入导出

!!! tip "" - 角色支持导入创建和已存在角色导出,支持 xlxs 和 cvs 的表格格式。 - 首次导入,可点击导入按钮下载模板后根据提示填写信息后导入。 role_list04

4 角色详情

!!! tip "" - 在角色列表页面点击角色名称,进入角色详情页面。 - 角色详情页包含的信息包括角色基本信息、角色权限、授权用户以及角色活动记录。 role_list05

!!! tip "" - 详细参数说明:

| 参数    |                说明                  |
| -------| ------------------------------------ |
| 基本信息 | 基本信息页面显示该角色的详细信息,包括名称、是否内置、创建者等信息。 |
| 权限 | 该选项用来设置当前角色的权限,是否可以使用目前这些功能。 |
| 授权用户 | 该页面用来绑定角色与用户,即给某个用户赋于该角色的权限。 |
| 活动记录 | 该页面显示当前角色的活动记录。 |

5 更新角色

!!! tip "" - 当需求对某个角色的信息进行更新时,可在角色列表页面中,点击角色后方的更新按钮进行角色信息更新。 role_list06

6 克隆角色

!!! tip "" - 点击角色后方的更多按钮选择克隆按钮,进入角色创建界面,修改相关信息后,提交后修改角色权限即克隆完成。 - 所有角色均支持克隆,克隆后,在角色详情页可以选择进行该角色的权限。 role_list07

7 删除角色

!!! tip "" - 系统默认角色不允许删除,非内置角色可进行删除。 - 点击角色后方的删除按钮,删除角色。 role_list08

📄 user_group.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/admin/user/user_group.md

用户组

1 功能简述

!!! tip "" - 点击用户管理-用户组按钮,进入用户组页面。 - 该页面主要针对于用户组,包括用户组的创建、删除、更新、查看。 - 用户组是对用户进行分组管理,在分配资产权限的时候,可针对用户组进行授权,一个用户支持加入多个用户组。 user_group01

2 创建用户组

!!! tip "" - 点击用户组页面的创建按钮,进入用户组创建页面。 - 填写用户组相关信息,点击提交按钮后创建用户组完成。 user_group02

!!! tip "" - 详细参数说明:

| 参数    |                说明                  |
| -------| ------------------------------------ |
| 名称 | 用户组名称。  |
| 用户 | 将用户添加到该用户组中。 |

3 用户组导入导出

!!! tip "" - 用户组支持导入创建和已存在用户组导出,支持 xlxs 和 cvs 的表格格式。 - 首次导入,可点击导入按钮下载模板后根据提示填写信息后导入。 user_group03

4 用户组详情

!!! tip "" - 在用户组列表页面点击用户组名称,进入用户组详情页面。 - 用户组详情页包含的信息包括用户组基本信息以及活动记录。 user_group04

!!! tip "" - 详细参数说明:

| 参数    |                说明                  |
| -------| ------------------------------------ |
| 基本信息 | 基本信息页面显示该用户组的详细信息,包括ID、名称、用户数量、创建者等信息。 |
| 成员 | 该选项可增加或删除该用户组中的成员。 |
| 活动记录 | 该选项记录该用户组的活动记录,创建时间、创建人等等信息。 |

5 更新用户组

!!! tip "" - 对于用户组信息变动情况,可以对用户组信息进行更新。点击对应用户组后方的更新按钮,进入用户信息页,改动后点击提交按钮即可。 user_group05

6 克隆用户组

!!! tip "" - 当需要删除用户组时,可以点击相应的用户组后方的更多按钮,选择克隆按钮,点击克隆即可。 user_group06

7 删除用户组

!!! tip "" - 当需要删除用户组时,可以点击相应的用户组后方的更多按钮,选择删除按钮,点击删除即可。 user_group07

📄 user_list.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/admin/user/user_list.md

用户列表

1 功能简述

!!! tip "" - 点击用户管理-用户列表按钮,进入用户列表页面。 - 该页面主要负责 JumpServer 用户的操作,包含增加、删除、更新、查看等。 user_list01

2 创建用户

!!! tip "" - 点击用户列表页面的创建按钮,进入用户详细创建页面。 user_list02

!!! tip "" - 详细参数说明:

| 参数    |                说明                  |
| -------| ------------------------------------ |
| 名称 | 用户识别名称,可重复。  |
| 用户名 | 登录 JumpServer 的登录账号,不可重复。 |
| 邮箱 | 登录账号对应的邮箱地址,不可重复。 |
| 用户组 | 将用户按组进行管理,主要用于资产授权,当某个资产对某个用户组授权时,这个用户组所有的用户都对这个资产有相应的权限。 |
| 密码策略 | 密码在管理员创建用户的过程中可以自主设置;也可以生成密码连接,通过邮件发送给用户。在成功提交用户信息后,JumpServer 会发送一条“设置用户密码”的邮件到所填写的用户邮箱。 |
| MFA | 多因子身份认证。启用 MFA 后,用户登录 JumpServer 系统时,系统将要求输入用户名和密码(第一安全要素),然后要求输入来自其 MFA 设备的动态验证码(第二安全要素),双因子的安全认证将为账户提供更高的安全保护。 |
| 来源 | 指定该用户的来源,如手动创建则为“数据库”,如从 LDAP 中导入则为 “LDAP”。 |
| 系统角色 | 系统角色是决定一个用户在系统层面具有哪些权限(系统管理员、审计员、用户/其他自定义角色) |
| 组织角色 | 组织角色是决定一个用户在组织层面具有哪些权限(组织管理员、审计员、用户/其他自定义角色) |
| 激活 | 表示用户状态是否正常可登录,非激活状态用户不可登录。 |
| 失效日期 | 失效日期指用户可进行登录的最后日期,时间截止后不可登录。 |
| 手机 | 非必填项,配置用户的手机号,用于 “MFA” 手机短信的接收。 |
| 微信 | 非必填项,配置用户的企业微信,用于“企业微信”方式的认证登录。 |
| 备注 | 非必填项,管理员配置该用户的备注信息。 |

3 邀请用户

!!! tip "" - 点击用户详情页面的邀请用户按钮,使用邀请用户功能。 - 该功能主要用于某个 JumpServer 用户存在于整个系统中,但不存在于当前组织中时,邀请该用户加入到当前组织中。 - 点击邀请用户按钮后,在弹窗中输入需要邀请的用户并设置该用户在当前组织中的组织角色,点击提交按钮保存。 user_list03

4 用户导入导出

!!! tip "" - 用户支持导入创建、更新和已存在用户导出,支持 xlxs 和 cvs 的表格格式。 - 首次导入,可点击导入按钮下载模板后根据提示填写信息后导入。 user_list04

5 用户详情

!!! tip "" - 在用户列表页面点击用户名称,进入用户详情页面。 - 用户详情页包含的信息包括基本信息、授权的资产、资产授权规则、用户授权规则以及活动记录。 user_list05

!!! tip "" - 详细参数说明:

| 参数    |                说明                  |
| -------| ------------------------------------ |
| 基本信息 | 基本信息页面显示该用户的详细信息,包括 ID、名称、用户名、邮件、角色、创建者等信息。 |
| 授权的资产 | 显示出当前组织下授权给该用户的资产列表。 |
| 资产授权规则 | 显示出包含该用户的资产授权规则列表。 |
| 用户登录规则 | 该用户的登录策略配置详情。可通过配置登录规则限制某用户只允许在某个时间段登录等。 |
| 活动记录 | 该用户的登录活动记录。 |
| 激活 | 快速操作按钮,允许或禁止该用户进行登录。 |
| 重置 MFA | 快速操作按钮,还原用户的 MFA 到初始状态,用户下次登录需要再次进行绑定操作。 |
| 重置密码 | 快速操作按钮,向该用户的邮箱发送重置密码的邮件。 |
| 重置SSH密钥 | 快速操作按钮,向该用户的邮箱发送重置用户的 SSH Key 的邮件。 |
| 解锁用户 | 快速操作按钮,如该用户因为密码多次输入错误导致账号锁定,可通过此按钮进行解锁。 |
| 用户组 | 快速操作按钮,可在输入框中选择某个用户组进行加入或点击已加入用户组列表右侧删除按钮进行删除。 |

5.1 用户登录规则

!!! tip "" - 点击用户详情页面的用户登录规则按钮,可设置规则限制用户的登录IP与登录时间段。 - 在该页面配置具体的登录规则,点击提交按钮后进行保存生效。 user_list06

!!! tip "" - 详细参数说明:

| 参数    |                说明                  |
| -------| ------------------------------------ |
| 名称 | 指定该登录规则的名称。 |
| 优先级 | 指定该登录规则生效的优先级,数字越小优先级越高。 |
| IP 组 | 指定该登录规则生效所限制的登录 IP,格式为逗号分隔的字符串, * 表示匹配所有。例如:192.168.10.1, 192.168.1.0/24, 10.1.1.1-10.1.1.20, 2001:db8:2de::e13, 2001:db8:1a:1110::/64。该 IP 是指用户登录时的 IP。 |
| 时段 | 指定该登录规则所限制的用户登录时间段。 |
| 动作 | 指定该登录规则被执行时的动作,可选择“拒绝”,“允许”,“登录复核”。分别表示拒绝该用户的登录,允许该用户进行登录,待指定的审批人员审批通过后进行登录。 |
| 激活中 | 指定该登录规则是否生效。 |

6 用户信息更新

!!! tip "" - 当需求对某个用户的信息进行更新时,可点击用户列表页面用户后方的更新按钮进行用户信息更新。 user_list07

7 用户克隆

!!! tip "" - 针对于用户信息相同,或大部分相同的情况,可以点击用户后方的更多按钮,选择克隆按钮,进入用户信息更改界面,修改相关信息后,提交即可。 user_list08

8 用户删除/移除

!!! tip "" - 当需求将用户从当前组织中移除,点击用户后方的更多按钮,选择移除按钮(此操作可通过邀请用户重新将用户加入到当前组织中) - 当需求将用户从整个 JumpServer 系统中删除,点击用户后方的更多按钮,选择删除按钮(该操作将在数据库层面删除此用户数据,操作结果不可逆) user_list09

📄 kubernetes.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/asset_requirements/kubernetes.md

Kubernetes 应用要求

1 Kubernetes 的集群地址

!!! tip "" - 集群填写的是 K8S 的集群地址。 - 直接访问集群地址页面可以显示如下信息(如: https://10.1.13.67:6443),一般是 master 节点的 6443或8443 端口。

```sh
kubectl config view --minify
```
```vim hl_lines="5"
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: DATA+OMITTED
    server: https://10.1.13.67:6443
  name: kubernetes
contexts:
- context:
    cluster: kubernetes
    user: kubernetes-admin
  name: kubernetes-admin@kubernetes
current-context: kubernetes-admin@kubernetes
kind: Config
preferences: {}
users:
- name: kubernetes-admin
  user:
    client-certificate-data: REDACTED
    client-key-data: REDACTED
```

2 获取 Token 方法

!!! tip "" - 下面以 ko-admin 为例,如果你的系统中没有此账户可以使用其他有权限的账户或者新建。

```sh
kubectl get secret -n kube-system
```
```vim hl_lines="22"
> kubectl get secret -n kube-system
NAME                                             TYPE                                  DATA   AGE
attachdetach-controller-token-qss79              kubernetes.io/service-account-token   3      44m
bootstrap-signer-token-ftqb6                     kubernetes.io/service-account-token   3      44m
bootstrap-token-abcdef                           bootstrap.kubernetes.io/token         5      44m
certificate-controller-token-gm8mf               kubernetes.io/service-account-token   3      44m
clusterrole-aggregation-controller-token-92v9j   kubernetes.io/service-account-token   3      44m
coredns-token-mjpwp                              kubernetes.io/service-account-token   3      44m
cronjob-controller-token-bjdn5                   kubernetes.io/service-account-token   3      44m
daemon-set-controller-token-6wljg                kubernetes.io/service-account-token   3      44m
default-token-9pl84                              kubernetes.io/service-account-token   3      44m
deployment-controller-token-wbpq6                kubernetes.io/service-account-token   3      44m
disruption-controller-token-9mrbr                kubernetes.io/service-account-token   3      44m
endpoint-controller-token-hmgw5                  kubernetes.io/service-account-token   3      44m
endpointslice-controller-token-pbnkw             kubernetes.io/service-account-token   3      44m
endpointslicemirroring-controller-token-zkc6z    kubernetes.io/service-account-token   3      44m
expand-controller-token-btlqv                    kubernetes.io/service-account-token   3      44m
flannel-token-qc6kw                              kubernetes.io/service-account-token   3      42m
generic-garbage-collector-token-j8c7c            kubernetes.io/service-account-token   3      44m
horizontal-pod-autoscaler-token-v9d49            kubernetes.io/service-account-token   3      44m
job-controller-token-9pldd                       kubernetes.io/service-account-token   3      44m
ko-admin-token-kprl9                             kubernetes.io/service-account-token   3      40m
kube-proxy-token-9pfd2                           kubernetes.io/service-account-token   3      44m
metrics-server-token-cmdpk                       kubernetes.io/service-account-token   3      41m
namespace-controller-token-k94nh                 kubernetes.io/service-account-token   3      44m
nfs-client-provisioner-token-pb5qx               kubernetes.io/service-account-token   3      28m
nginx-ingress-serviceaccount-token-vk8tm         kubernetes.io/service-account-token   3      41m
node-controller-token-v5k59                      kubernetes.io/service-account-token   3      44m
persistent-volume-binder-token-jfgm7             kubernetes.io/service-account-token   3      44m
pod-garbage-collector-token-7lptd                kubernetes.io/service-account-token   3      44m
pv-protection-controller-token-fpqqm             kubernetes.io/service-account-token   3      44m
pvc-protection-controller-token-wcrmp            kubernetes.io/service-account-token   3      44m
replicaset-controller-token-9g9s7                kubernetes.io/service-account-token   3      44m
replication-controller-token-xg4fq               kubernetes.io/service-account-token   3      44m
resourcequota-controller-token-lskn4             kubernetes.io/service-account-token   3      44m
root-ca-cert-publisher-token-sdt67               kubernetes.io/service-account-token   3      44m
service-account-controller-token-2xr8k           kubernetes.io/service-account-token   3      44m
service-controller-token-9dghl                   kubernetes.io/service-account-token   3      44m
statefulset-controller-token-wqm5v               kubernetes.io/service-account-token   3      44m
token-cleaner-token-gv552                        kubernetes.io/service-account-token   3      44m
ttl-controller-token-cgqcd                       kubernetes.io/service-account-token   3      44m
```
```sh
kubectl describe secret ko-admin-token-kprl9 -n kube-system
```
```vim hl_lines="14"
> kubectl describe secret ko-admin-token-kprl9 -n kube-system
Name:         ko-admin-token-kprl9
Namespace:    kube-system
Labels:       <none>
Annotations:  kubernetes.io/service-account.name: ko-admin
              kubernetes.io/service-account.uid: 8be05ad6-83ce-483b-9324-7c3f041c6da1

Type:  kubernetes.io/service-account-token

Data
====
ca.crt:     1038 bytes
namespace:  11 bytes
token:      eyJhbGciOiJSUzI1NiIsImtpZCI6ImlCVkhHTlhHem9idXNtYmtsaVpDZXRESVFMSHRFNUdsOFJWOXc0MnRZTG8ifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvsA50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmAxbmV0ZXMuaW8vc6VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJrby1hZG1pbi10b2tlbi1rcHJsOSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2AxdmljZS1hY2NvdW50Lm5hbQAiOiJrby1hZG1pbiIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFiQ291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjhiZTA1YWQ2LTgzY2UtNDgzYi05MzI0LTdjM2YwNDFjNmRhMSIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDprdWJlLXN5c3RlbTprby1hZG1pbiJ9.qP04Yd6sTf5IDbQ_9lF_VdoyBEN5UCBmp1P7tvv9Fn9ibZFOGsupXjzbxCMhu3HhkGSE1pUuu1NNmcJUCUb_pFi5x5Bvo2xkF1_SfQACo40kzrUQ9ATTX8wuDzpiNw9sjf-_1l7rwnseOC4WJYNQIOs9i9FOeyRPYbKvkwsysJBVCq_XkoqvZt9xPp-LtsMUdWKHhLKUkBBM5F1NpVyahSrrsgH2lRuNsGALGb0FGIwYfMWN6KaHim2eeOaH4nqnVJ0WGCVJNx9-_PJQXfFWZtnceF_IiTUGwC7fqrA7T-5vOafPvG7c6PgjPzgMyEo4ade1bRV3fM98gHs_5v-oVw
```

!!! info "上面 token: 后面的内容就是我们需要的 token,把这个内容填写到 JumpServer 账号列表中即可。"

📄 linux_ssh.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/asset_requirements/linux_ssh.md

Linux SSH 资产要求

!!! tip "资产要求" - 资产必须部署 openssh-server。 - 防火墙 ssh 端口必须开放给 JumpServer 所有服务器访问。 - 请检查 /etc/hosts.allow /etc/hosts.deny /etc/ssh/sshd_config 是否有登录限制。 - 资产连接超时 timeout 请检查 /etc/ssh/sshd_configUSEDNS 项是否为 novim UseDNS no

📄 linux_vnc.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/asset_requirements/linux_vnc.md

Linux VNC 资产要求

!!! tip "资产要求" - 资产必须部署 vncserver。 - 防火墙 vncserver 端口必须开放给 JumpServer 所有服务器访问。

!!! tip "" - Centos 7 示例:

```sh
yum -y groupinstall "GNOME Desktop" "Graphical Administration Tools"
yum -y install tigervnc-server tigervnc
```
```sh
vncpasswd
```
```
Password: ******
Verify: ******
Would you like to enter a view-only password (y/n)? n
A view-only password is not used
```

- 安装提示设置密码,这个密码填在 JumpServer 页面的 `账号管理` - `账号列表模块` 中,`用户名` 为空不需要填写。

```sh
firewall-cmd --permanent --add-service vnc-server
firewall-cmd --reload
```
```sh
vncserver :1
```

- `:1` 为 `5901` 端口,同理 `:2` 为 `5902`

📄 macos_vnc.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/asset_requirements/macos_vnc.md

macOS VNC 资产要求

1 屏幕共享

!!! tip "" - 在 Mac 端配置 系统偏好设置-共享-屏幕共享 功能开启。 - 默认的端口为 5900

2 RealVNC

!!! tip "" - 如果不使用自带的 vnc,可以单独安装 RealVNC Server。 - 正常安装好 RealVNC Server,注意安装过程中允许放行防火墙。 - 在 RealVNC Server-Options-Security 选项里面设置 EncryptionPrefer off。 - 在 RealVNC Server-Options-Security 选项里面选择 AuthenticationVNC password。 - 点击保存,然后会提示输入 vnc 密码,这个密码就是用来连接 vnc server。

!!! tip "" - 默认的端口是 5900 可以在 vnc server 主页上查看,用户名为空。

!!! warning "注意" - RealVNC 不支持使用系统自带的身份认证,只能使用 vnc password 进行连接。

📄 mysql.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/asset_requirements/mysql.md

MySQL 应用要求

!!! warning "注意" - 注意防火墙放行相应的 MySQL 服务端口。 - MySQL Server 需要授权 Core 和 KoKo 的远程访问的权限。

```sh
mysql -uroot
```
```mysql
create user 'root'@'%' identified by 'Test2020.M';
grant all on *.* to 'root'@'%';
flush privileges;
```

📄 telnet.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/asset_requirements/telnet.md

Telnet 资产要求

!!! tip "提示" - JumpServer 通过 Telnet 协议和资产建立连接时,无法确认服务端返回的字符是否表示连接成功,所以需要配正则表达式来确认是否连接成功。 - 需要在 平台列表-创建-配置 选择telnet协议 点击右侧 小齿轮平台协议配置:telnet 中添加成功提示代码。

!!! tip "通过 telnet 命令登录 telnet设备 成功 的返回字符串" - 举例:

```sh
telnet 172.16.0.1
```
```vim
Login authentication  
login: admin  
password: *********  
Info: The max number or VTY users is 10, and the number  
      of current VTY users on line is 1.  
<RA-L7-RD>
<RA-L7-RD> system-view

```

- 把 `<RA-L7-RD>` 写入到 Web "系统设置"-"终端设置"-"Telnet 成功正则表达式" 里面
- `<RA-L7-RD> 正则可用 <.*> 表示 或者 <RA-.*>`
- `RW-F1-1  正则可用 RW-.*`

!!! tip "不会写正则直接写设备名就行,设备1名|设备2名|设备3名|设备4名|success|成功" - RW-1F-1|RW-2F-1|RW-3F-1|success|成功 - <RA-L7-RD>|<RA-L6-RD>|<RA-L5-RD>|success|成功 - <.*>|.*>|success|成功

📄 windows_rdp.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/asset_requirements/windows_rdp.md

Windows RDP 资产要求

!!! info "提示" - 部分安装了安全软件的资产无法正常连接。 - 创建资产的 "资产平台" 默认情况下使用 Windows 即可。

!!! tip "资产要求" - 打开 Windows 远程设置 - 防火墙放行 rdp 端口 - 创建资产时 "资产平台" 选择 Windows - 正常创建 RDP 账号 - 授权后即可

!!! warning "如果资产设置了 远程(RDP)连接要求使用指定的连接层 SSL" - 在 JumpServer 资产管理 - 平台列表 创建一个新的平台模板。 - 名称: Windows-SSL - 基础: Windows - 编码: UTF-8 如果复制粘贴乱码可以改成 GBK - RDP security: TLS - RDP console: 默认 - 提交后, 修改资产的资产平台为 Windows-SSL。

!!! warning "如果资产设置了 远程(RDP)连接要求使用指定的连接层 RDP" - 在 JumpServer 资产管理 - 平台列表 创建一个新的平台模板 - 名称: Windows-RDP - 基础: Windows
- 编码: UTF-8 如果复制粘贴乱码可以改成 GBK
- RDP security: RDP
- RDP console: 默认
- 提交后, 修改资产的资产平台为 Windows-RDP

!!! warning "域账号注意事项" - 如果域账号配置了特定的登录工作站, 则需要在 DC 域控制器的 域用户属性登录工作站,在里面添加 lion 的 Container ID。 - 如不确定, 请配置为此用户可以登录到: 所有计算机(C)

📄 windows_ssh.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/asset_requirements/windows_ssh.md

Windows SSH 资产要求

!!! info "Windows 资产的测试连接、硬件信息获取、用户自动推送功能需要进行以下相关设置" 注意:按照下面的文档部署好 Openssh 后,在 Web 的资产列表里面找到您的 Windows 资产,在协议组中加入 rdp 3389和 ssh 22协议,然后就可以使用资产测试连接、硬件信息获取、用户自动推送的功能。

!!! tip "Win7/Win2008 需要升级 powershell 到 3.0 以上,详情请参考 ansible 客户端需求{:target="_blank"}"

1 安装 OpenSSH

!!! tip "" 下载最新的 OpenSSH-Win64.msi{:target="_blank"}
- 通过管理员身份的直接运行即可,安装过程无需交互,安装完成后不需要任何配置即可直接使用。

2 使用 Private Key

!!! tip "" - Setup public key based authentication for windows{:target="_blank"}

```powershell
ssh-keygen.exe -t rsa
cp $env:USERPROFILE\.ssh\id_rsa.pub $env:USERPROFILE\.ssh\authorized_keys
```
```powershell
notepad C:\ProgramData\ssh\sshd_config
```
```vim hl_lines="88-89"
# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options override the
# default value.

#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

#HostKey __PROGRAMDATA__/ssh/ssh_host_rsa_key
#HostKey __PROGRAMDATA__/ssh/ssh_host_dsa_key
#HostKey __PROGRAMDATA__/ssh/ssh_host_ecdsa_key
#HostKey __PROGRAMDATA__/ssh/ssh_host_ed25519_key

# Ciphers and keying
#RekeyLimit default none

# Logging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin prohibit-password
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

PubkeyAuthentication yes

# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
AuthorizedKeysFile  .ssh/authorized_keys

#AuthorizedPrincipalsFile none

# For this to work you will also need host keys in %programData%/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no

# GSSAPI options
#GSSAPIAuthentication no

#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
#PermitTTY yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#PermitUserEnvironment no
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none

# no default banner path
#Banner none

# override default of no subsystems
Subsystem   sftp    sftp-server.exe

# Example of overriding settings on a per-user basis
#Match User anoncvs
#   AllowTcpForwarding no
#   PermitTTY no
#   ForceCommand cvs server

# 注释下面两行
#Match Group administrators
#       AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys
```
```powershell
net stop sshd
net start sshd
```

3 Private Key 使用方式

!!! tip "" powershell ssh user@ip -i <private_key_absolute_path> (local users) ssh user@domain@ip -i <private_key_absolute_path> (Domain users)

📄 windows_vnc.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/asset_requirements/windows_vnc.md

Windows VNC 资产要求

!!! tip "资产要求" - 正常安装好 RealVNC Server,注意安装过程中允许放行防火墙。 - 在 RealVNC Server-Options-Security 选项里面设置 EncryptionPrefer off - 在 RealVNC Server-Options-Security 选项里面选择 AuthenticationVNC password - 点击保存,然后会提示输入 vnc 密码,这个密码用来连接 vnc server。

!!! tip "" - 默认的端口是 5900 可以在 vnc server 主页上查看,用户名为空。

!!! warning "注意" - VNC 目前不支持加密的连接。 - VNC 不支持使用系统自带的身份认证,只能使用 vnc password 进行连接。

📄 dashboard.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/audit/dashboard.md

仪表盘

1 功能简述

!!! tip "" - JumpServer 审计台初始页面参考下图,可以查看当前组织的日志详情。 - 仪表盘页面可查看日志数量、会话数量、会话登录趋势、用户登录趋势等。

2 仪表盘页面展示

audit_dashboard01

📄 job_log.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/audit/log_audit/job_log.md

作业日志

1 功能简述

!!! tip "" - 作业任务是针对于用户的作业中心功能中任务执行的日志信息记录。 - 主要记录信息为任务创建者、执行命令、是否完成/成功、日期等信息,并且可以输出执行任务记录。 job_log01

!!! tip "" - 任务日志输出示例如图所示: job_log02

📄 login_log.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/audit/log_audit/login_log.md

登录日志

1 功能简述

!!! tip "" - 登录日志是指 JumpServer 平台的用户登录日志,在此页面可以查看到用户登录 JumpServer 的详细信息包括用户的登录类型、登录IP、登录城市、登录日期、登录失败的原因等信息。 login_log01

📄 operation_log.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/audit/log_audit/operation_log.md

操作日志

1 功能简述

!!! tip "" - 操作日志是指整个 JumpServer 平台的管理操作日志,在此页面可以查看操作的用户、资产类型、操作的日志等信息。 - 具体的操作变更可以点击操作日志后方的查看按钮。 operation_log01 operation_log02

📄 secret_change_log.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/audit/log_audit/secret_change_log.md

改密日志

1 功能简述

!!! tip "" - 改密日志是针对于 JumpServer 平台用户的改密日志,即 JumpServer 用户的账号改密。 - 主要记录信息为改密用户、修改者、日期等信息。 secret_change_log01

📄 command_record.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/audit/session_audit/command_record.md

命令记录

1 功能简述

!!! tip "" - 命令记录主要显示用户在资产连接后执行的命令,单击某一行记录,可以查看命令执行的详细结果。 command_record01

2 页面功能

!!! tip "" - 点击切换至命令记录页面。 - 点击图示下拉框,可以展示命令执行结果的部分内容输出。 command_record02

!!! tip "" - 点击转到连接,会跳转到详细的会话页面,如果会话已结束可以查看会话录像。 command_record03 command_record04

📄 ftp.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/audit/session_audit/ftp.md

文件传输

1 功能简述

!!! tip "" - 文件传输可以查看所有上传/下载文件到资产上的历史记录。 ftp01

📄 session_record.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/audit/session_audit/session_record.md

会话记录

1 功能简述

!!! tip "" - 会话记录包含在线会话与历史会话两部分,主要展示的信息有登录资产的会话详细记录,包含用户、协议、远端地址、会话时间以及会话录像等。

2 在线会话

!!! tip "" - 在线会话可以查看到所有目前正在使用 JumpServer 登录资产的会话。并且可以实时监控,在出现不合规操作时,可直接终断会话。 - JumpServer 实时监控支持 SSH 协议与 RDP 协议的会话连接,RDP 客户端方式会话与数据库协议会话暂不支持实时监控。

!!! tip "" - 点击切换至会话记录-在线会话页签,如图所示: session_record01

3 历史会话

!!! tip "" - 历史会话可以查看所有 JumpServer 连接资产的详细信息以及操作录像,方便进行回溯与追责。 - JumpServer 可以在线浏览器查看录像或者下载录像到本地通过 JumpServer 离线录像播放器播放录像。

!!! tip "" - 点击切换至会话记录-历史会话页签,如图所示: session_record02

3.1 会话详情

!!! tip "" - 点击会话记录-历史会话页签,该页面的编号按钮,可进入会话的详细信息页面。 session_record03

!!! tip "" - 详细模块说明:

!!! tip ""

| 模块    |                说明                  |
| ------- | ------------------------------------ |
| 基本信息 | 基本信息模块主要介绍该会话的基础信息,包含登录用户、登录来源、远端地址、会话开始时间与结束时间等。 |
| 快速更新 | 快速更新模块主要针对录像的播放,包含直接播放与下载录像后播放。 |
| 命令 | 命令模块可以查询到该会话连接过程中用户执行的命令记录。 |
| 活动 | JumpServer 支持会话分享,即分享已连接的会话给其它用户。活动模块即可查看分享记录。 |
| 活动记录 | 活动记录模块主要查看该会话的详细记录。 |

📄 currency.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/currency.md

通用功能

1 语言切换

!!! tip "" - 在登录 JumpServer 页面处,可进行指定语言的切换,目前支持切换简体中文、英文、日本语。 currency01

2 搜索框

!!! tip "" - JumpServer 在功能模块中设有搜索框功能来提高查询效率,包含用户、资产、任务、审计等模块。

!!! tip "" - 选择图示搜索下拉框,即可针对数据字段进行搜索。 currency02

3 "更多"按钮

3.1 针对资产、用户类型

!!! tip "" - JumpServer 在功能模块中设有"更多"按钮来方便管理员对资产、用户等类型的目标进行删除、克隆、测试动作,如下图所示: currency03

3.2 针对任务、规则类型

!!! tip "" - JumpServer 在功能模块中设有"更多"按钮来方便管理员对任务、规则等类型等目标进行删除、执行(手动执行任务)动作,如下图所示: currency04

4 数据导入导出

!!! tip "" - JumpServer 支持通过 excel、csv 模版来对数据进行导入导出操作。 - 数据类型:资产、账号、授权规则。 currency05

5 自定义列表字段

!!! tip "" - JumpServer 支持在功能模块中的页面进行自定义列表字段操作。 currency06

📄 env.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/env.md

参数说明

!!! warning "注意" - 修改配置文件前请先关闭 JumpServer 服务。

1 Core 参数说明

!!! tip "" - 打开 config.txt 配置文件。

```sh
vi /opt/jumpserver/config/config.txt
```

!!! tip "" - Core 参数如下:

参数名称 默认值 可选项 说明
SECRET_KEY '' - 用于对敏感字段进行加解密的 Key
BOOTSTRAP_TOKEN '' - 用于组件向 Core 服务注册使用的 Token
DEBUG false true
false
Debug 模式,如果开启页面请求 API 报错时会显示更多信息
DEBUG_DEV false true
false
Debug 开发模式,如果开启后端日志会显示更多信息
LOG_LEVEL DEBUG DEBUG
INFO
WARNING
ERROR
CRITICAL
日志级别
LOG_DIR /data/jumpserver/core/logs - 日志目录
DB_ENGINE mysql - 数据库引擎
DB_NAME jumpserver - 数据库名
DB_HOST 127.0.0.1 - 数据库地址
DB_PORT 3306 - 数据库端口
DB_USER root - 数据库用户
DB_PASSWORD '' - 数据库用户密码
DB_USE_SSL false true
false
数据库启用 SSL 方式
REDIS_HOST 127.0.0.1 - Reids 地址
REDIS_PORT 6379 - Redis 端口
REDIS_PASSWORD '' - Redis 密码
REDIS_USE_SSL false true
false
Redis 启用 SSL 方式
REDIS_SSL_KEY null - Redis SSL Key
REDIS_SSL_CERT null - Redis SSL Cert 证书
REDIS_SSL_CA null - Redis SSL CA Cert 证书
REDIS_SSL_REQUIRED 'none' - Redis SSL 证书是否必须
REDIS_SENTINEL_HOSTS '' - Redis 哨兵地址(多个地址使用 / 分割)
REDIS_SENTINEL_PASSWORD '' - Redis 哨兵密码
REDIS_SENTINEL_SOCKET_TIMEOUT '' - Redis 哨兵 Socket 超时时间
REDIS_DB_CELERY 3 0-15 Redis 库编号,Celery 任务使用
REDIS_DB_CACHE 4 0-15 Redis 库编号,缓存使用
REDIS_DB_SESSION 5 0-15 Redis 库编号,用户 Session 使用
REDIS_DB_WS 6 - Redis 库编号,WebSocket 使用
TOKEN_EXPIRATION 3600 * 24(s) - 通过 API 创建用户 Token 的有效期
# 如果配置为空或者0,则默认值为 3600
DEFAULT_EXPIRED_YEARS 70(year) - 创建资源的默认过期年份,比如:授权规则
# 不允许修改
SESSION_COOKIE_DOMAIN null - 用户 Session Cookie 域,比如:fit2cloud.com
CSRF_COOKIE_DOMAIN null - 用户 CSRF Cookie 域,默认与 SESSION_COOKIE_DOMAIN 保持一致
SESSION_COOKIE_NAME_PREFIX jms_ - 用户 Session Cookie 名称的前缀
# 如果配置了 SESSION_COOKIE_DOMAIN 参数,会使用 . 前的值作为默认值,比如:fit2cloud
SESSION_COOKIE_AGE 3600 * 24(s) - 用户 Session Cookie 的有效期
SESSION_EXPIRE_AT_BROWSER_CLOSE false true
false
用户 Session 在浏览器关闭后过期
CONNECTION_TOKEN_EXPIRATION 5 * 60 >= 5 * 60 有效期内 ConnectionToken 只能使用一次
CONNECTION_TOKEN_EXPIRATION_MAX 3600 * 24 * 30(s) - 有效期内 ConnectionToken 可以多次使用
CONNECTION_TOKEN_REUSABLE false true
false
ConnectionToken 是否可以多次使用
AUTH_CUSTOM false true
false
开启自定义用户认证
AUTH_CUSTOM_FILE_MD5 '' - 自定义用户认证的文件 md5 值
MFA_CUSTOM false true
false
开启自定义 MFA 认证
MFA_CUSTOM_FILE_MD5 '' - 自定义 MFA 认证的文件 md5 值
AUTH_TEMP_TOKEN false true
false
开启临时密码功能
LOGIN_REDIRECT_TO_BACKEND '' Direct(直接进入内部登录页面)
OpenID
CAS
SAML2
OAuth2 的服务提供商名称(系统设置)
开启第三方认证后,不出现倒计时跳转页面直接跳转到认证服务,比如:OpenID
LOGIN_REDIRECT_MSG_ENABLED true true
false
开启第三方跳转倒计时页面
SYSLOG_ADDR '' - SysLog 服务地址
SYSLOG_FACILITY user - SysLog FACILITY
SYSLOG_SOCKTYPE 2 - SysLog SockType
PERM_EXPIRED_CHECK_PERIODIC 60 * 60(s) - 校验过期的资产授权规则并过期用户授权树的周期
LANGUAGE_CODE zh zh
en
ja
语言
TIME_ZONE Asia/Shanghai - 时区
SESSION_COOKIE_SECURE false true
false
用户 Session Cookie 安全模式,开启后只允许在 https 协议下发送
CSRF_COOKIE_SECURE false true
false
用户 CSRF Token 安全模式,开启后只允许在 https 协议下发送
REFERER_CHECK_ENABLED false true
false
开启 REFERER 校验
CSRF_TRUSTED_ORIGINS - - CSRF 同源信任,多个地址使用 , 分割
SESSION_ENGINE cache - 用户 Session 引擎
SESSION_SAVE_EVERY_REQUEST true true
false
每个请求都要保存用户 Session
SESSION_EXPIRE_AT_BROWSER_CLOSE_FORCE false true
false
浏览器关闭后强制过期用户 Session 会话
SERVER_REPLAY_STORAGE {} - 服务端录像存储
比如:
{
'TYPE': 's3',
'BUCKET': '',
'ACCESS_KEY': '',
'SECRET_KEY': '',
'ENDPOINT': ''
}
# 组件上传录像到 Core 服务,Core 自动上传到配置的对象存储服务
CHANGE_AUTH_PLAN_SECURE_MODE_ENABLED true true
false
改密计划安全模式
启用后,不支持用户自己改自己;
禁用后,支持自己改自己;
比如 root 改 root
SECURITY_VIEW_AUTH_NEED_MFA true true
false
需要校验 MFA
SECURITY_DATA_CRYPTO_ALGO aes(GMSSL_ENABLED=false)
gm(GMSSL_ENABLED=true)
aes_ecb
aes_gcm
aes
gm_sm4_ecb
gm
数据加密算法
GMSSL_ENABLED false true
false
开启国密算法(数据加密算法)
SECURITY_DATA_CRYPTO_ALGO
GMSSL_ENABLED
# 如果同时配置,优先使用 SECURITY_DATA_CRYPTO_ALGO
OPERATE_LOG_ELASTICSEARCH_CONFIG {} - 操作日志“变更字段”的存储ES配置
比如:
{
"INDEX": "",
"HOSTS": "",
"OTHER": "",
"IGNORE_VERIFY_CERTS": "",
"INDEX_BY_DATE": "",
"DOC_TYPE": ""
}
MAGNUS_ORACLE_PORTS 30000-30030 - Magnus 组件需要监听的 Oracle 端口范围
APPLET_DOWNLOAD_HOST '' - Applet 等软件的下载地址
FTP_FILE_MAX_STORE 100(M) - FTP 文件上传下载备份阈值,单位(M),当值<=0时,不备份文件

2 KoKo 参数说明

!!! tip "" - KoKo 参数如下:

参数名称 默认值 可选项 说明
NAME hostname - 主机名
CORE_HOST http://127.0.0.1:8080 - Jumpserver 项目的 Url,API 请求注册会使用
BOOTSTRAP_TOKEN '' - 预共享秘钥,请和JumpServer 配置文件中保持一致
BIND_HOST 0.0.0.0 - 启动时绑定的IP
SSHD_PORT 2222 - 监听的SSH端口号
HTTPD_PORT 5000 - 监听的HTTP/WS端口号
ACCESS_KEY '' - 项目使用的ACCESS KEY, 默认会注册,并保存到文件
ACCESS_KEY_FILE data/keys/.access_key - ACCESS KEY 保存的地址, 默认注册后会保存到该文件中
LOG_LEVEL DEBUG DEBUG
INFO
WARNING
ERROR
CRITICAL
日志级别
SSH_TIMEOUT 15 - SSH 连接超时时间(单位=秒)
# 如果用户服务器启用了 useDNS 这些参数,有可能登录时间超过 15S,需要修改此参数
LANGUAGE_CODE zh zh
en
ja
语言
UPLOAD_FAILED_REPLAY_ON_START true true
false
未上传录像遗留文件,启动时是否上传
SFTP_SHOW_HIDDEN_FILE false true
false
SFTP 是否显示隐藏文件
REUSE_CONNECTION true true
false
是否复用同一用户的 SSH 连接
ASSET_LOAD_POLICY all - all 则用户资产缓存本地搜索分页;默认异步加载资产, 异步搜索分页
ZIP_MAX_SIZE 1024M - Web Sftp 文件下载,zip 支持压缩的最大额度 (单位=M)
ZIP_TMP_PATH /tmp - Web Sftp 文件下载,zip压缩文件存放的临时目录
CLIENT_ALIVE_INTERVAL 30 30
0
用户 SSH 登录 KoKo 之后,KoKo 给 SSH Client 发送的心跳间隔,默认为30,0则表示不发送,保持登录用户连接不断开
RETRY_ALIVE_COUNT_MAX 3 - 登录资产之后,KoKo 向资产发送心跳包出现错误的重试次数,默认为3。
# 当网络不稳定时,可以数值可设置大一些。
SHARE_ROOM_TYPE local local
redis
会话监控和共享使用的方式
REDIS_HOST 127.0.0.1 - Reids 地址
REDIS_PORT 6379 - Redis 端口
REDIS_PASSWORD '' - Redis 密码
REDIS_DB_ROOM 0 - 选择的 Redis 库索引
ENABLE_LOCAL_PORT_FORWARD true true
false
是否开启本地转发 (目前仅对 VScode Remote SSH 有效果)
ENABLE_VSCODE_SUPPORT true true
false
是否开启针对 VScode 的 Remote SSH 远程开发支持
# 前置条件: 必须开启 ENABLE_LOCAL_PORT_FORWARD

3 Lion 参数说明

!!! tip "" - Lion 参数如下:

参数名称 默认值 可选项 说明
NAME hostname - 主机名
CORE_HOST http://127.0.0.1:8080 - Jumpserver 项目的 Url,API 请求注册会使用
BOOTSTRAP_TOKEN '' - 预共享秘钥,请和JumpServer 配置文件中保持一致
BIND_HOST 0.0.0.0 - 启动时绑定的IP
HTTPD_PORT 8081 - 监听的 HTTP/WS 端口号
GUA_HOST 127.0.0.1 - Guacd 项目 URL
GUA_PORT 4822 - Guacd 项目端口
LOG_LEVEL DEBUG DEBUG
INFO
WARNING
ERROR
CRITICAL
日志级别
SHARE_ROOM_TYPE local local
redis
会话监控和共享使用的方式
REDIS_HOST 127.0.0.1 - Reids 地址
REDIS_PORT 6379 - Redis 端口
REDIS_PASSWORD '' - Redis 密码
REDIS_DB_ROOM 0 - 选择的 Redis 库索引
JUMPSERVER_DISABLE_ALL_COPY_PASTE false true
false
全局禁用上传下载
JUMPSERVER_DISABLE_ALL_UPLOAD_DOWNLOAD false true
false
全局禁用剪切板粘贴复制
JUMPSERVER_REMOTE_APP_UPLOAD_DOWNLOAD_ENABLE false true
false
开启Remote App的上传下载
JUMPSERVER_REMOTE_APP_COPY_PASTE_ENABLE false true
false
开启Remote app的剪切板粘贴复制
JUMPSERVER_COLOR_DEPTH 32 低色 16位
真彩 24位
真彩 32位
颜色深度
JUMPSERVER_DPI 120 120
160
240
图像每英寸长度内的像素点数
JUMPSERVER_DISABLE_AUDIO false true
false
禁止声音
JUMPSERVER_ENABLE_WALLPAPER false true
false
启用墙纸
JUMPSERVER_ENABLE_THEMING false true
false
启用主题
JUMPSERVER_ENABLE_FONT_SMOOTHING false true
false
启用平滑字体
JUMPSERVER_ENABLE_FULL_WINDOW_DRAG false true
false
启用拖拽窗口时渲染全部内容
JUMPSERVER_ENABLE_DESKTOP_COMPOSITION false true
false
启用透明窗口和阴影等图形效果
JUMPSERVER_ENABLE_MENU_ANIMATIONS false true
false
启用菜单开关动画
JUMPSERVER_DISABLE_BITMAP_CACHING true true
false
禁用RDP的内置位图缓存功能
JUMPSERVER_DISABLE_OFFSCREEN_CACHING true true
false
禁用客户端中当前不可见的屏幕区域缓存
JUMPSERVER_DISABLE_GLYPH_CACHING true true
false
禁用RDP会话中的字形缓存
JUMPSERVER_CLEAN_DRIVE_SCHEDULE_TIME 1
0
- 定时清理挂载盘文件的时间间隔 (单位:小时) ,如果设置值 0,则不清理

📄 index_description.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/index_description.md

页面说明

!!! warning "注意" - 带有 X-Pack 标识的功能为 JumpServer 堡垒机企业版功能。

1 页面展示

!!! tip "" - 页面左侧为功能菜单区,第一次登录默认展示仪表盘界面。 - 右上方区域为功能按钮,可以快速跳转 站内信、Web 终端、工单、系统设置等功能。 - 可以在图示序号1的位置,进行功能视图的切换。 index

2 功能说明

!!! tip ""

| 序号  |   名称   |                                   说明                                                         |
| :------ | :------- | :------------------------------------------------------------------------------------------------ |
|    1    |   控制台 | 管理员操作入口,通过控制台,管理员可进行用户管理、资产管理、应用管理、账号管理、权限管理、访问控制等配置。 |
|         |   审计台  | 审计员操作入口,通过审计台,审计员可查看各会话的连接详细信息及各类型日志,组织审计员只能够看到该组织下的相关数据。 |
|         |   工作台  | 普通用户操作入口,通过工作台,普通用户可以通过工作台看到自己有权限操作运维的资产。 |
|    2    |   站内信  | 站内消息通知中心,接收工单处理提醒,高危命令告警等通知。 |
|    3    |  Web 终端 | 资产运维操作入口,通过Web 终端进入资产运维页面,进行资产正常运维操作。 |
|    4    |    工单   | 工单入口,通过该按钮进入工单页面,查看提交的工单及待审批的功能等。 |
|    5    |  系统设置  | 系统设置入口,通过该按钮进入系统设置中,配置认证,安全等各类型系统参数。 |
|    6    |   帮助    | 帮助入口,通过该按钮进入帮助页面,可访问产品官网或下载系统工具。 |
|    7    |  个人信息  | 个人信息入口,点击该按钮,查看个人账号信息,用于API 调用的APIKey,当前用户连接资产使用的资产令牌以及退出登录的按钮等。 |

📄 storages.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/storages.md

存储说明

1 命令存储

1.1 在 JumpServer 页面添加 Elasticsearch 配置信息

!!! tip "" - 点击 系统设置 - 存储设置 - 命令存储 - 创建 - Elasticsearch 切换到新建命令存储界面。

| 名称     | 示例                    | 说明            |
| :------- | :--------------------- | :-------------- |
| 名称     | jms_es                  | 标识用, 不可重复 |
| 类型     | Elasticsearch           | 必填, 无法更改   |
| 主机     | http://172.16.11.3:9200 | http://es_user:es_password@es_host:es_port |
| 索引     | jumpserver              | 索引             |
| 默认存储 | √                       | 默认存储         |
| 备注     | es 测试服务器            | 仅标识, 可不填   |

1.2 修改命令存储为 Elasticsearch

!!! tip "" - 在 组件管理 页面选择 更新 组件,把命令存储修改成刚才创建的 ES 服务器即可。 - 勾选 默认存储 后,新注册的组件将会自动使用默认存储不需要再次修改,但是旧组件要更新才能生效。 - 如果 Elasticsearch 使用了非信任证书,需要勾选 忽略证书认证。 - 修改完成后,大概需要 1 分钟的时间完成同步。

1.3 重启组件服务

!!! tip "" - 重启 KoKo 组件服务,使配置生效。

```sh
docker restart jms_koko
```

2 录像存储

2.1 操作过程

!!! tip "" - 点击 系统设置 - 存储设置 - 对象存储 - 创建 切换到新建录像存储界面。 - 在 组件管理 页面选择 更新 组件。 - 之前已经存储在本地的录像需要自己手动上传到你新的存储环境。 - 勾选 默认存储 后,新注册的组件将会自动使用默认存储不需要再次修改,但是旧组件要更新才能生效。 - 选择你需要的存储方式即可,大概需要 1 分钟的时间完成同步。

3 日志存储

3.1 对接 Syslog 服务

!!! tip "" - 打开 config.txt 配置文件。

```sh
vi /opt/jumpserver/config/config.txt
```

!!! tip "" - 加入 Syslog 相关设置。

```vim
# Syslog 相关设置
SYSLOG_ENABLE=True
SYSLOG_ADDR=192.168.100.215:514   # Syslog 服务器的IP以及端口
```

!!! tip "" - 重启 JumpServer 服务。

```sh
./jmsctl.sh restart
```

📄 cas.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/system/authentication/cas.md

CAS 认证

!!! tip "对接参考资料" - 阿里云新 IDaaS 对接 - Casdoor 对接

!!! tip "提示" - 使用 CAS 的用户作为 JumpServer 登录用户。

1 操作过程

!!! tip "" - 修改 JumpServer 配置文件启用 CAS 认证。

```sh
vi /opt/jumpserver/config/config.txt
```
```vim
AUTH_CAS=True
CAS_SERVER_URL=https://account.jumpserver.org/cas/
CAS_ROOT_PROXIED_AS=https://demo.jumpserver.org:8443
CAS_LOGOUT_COMPLETELY=False
CAS_VERSION=3
CAS_USERNAME_ATTRIBUTE=uid
CAS_APPLY_ATTRIBUTES_TO_USER=False
CAS_CREATE_USER=True
```

!!! tip "" - 修改完成后保存,重启 JumpServer 即可。

2 参数说明

!!! tip "" - CAS 参数说明如下:

| name                           | explain                                                                                                                                                                            |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `AUTH_CAS`                     | Whether to open CAS authentication. |
| `CAS_SERVER_URL`               | This is the only setting you must explicitly define. Set it to the base URL of your CAS source (e.g. https://account.example.com/cas/). |
| `CAS_ROOT_PROXIED_AS`          | Useful if behind a proxy server. If host is listening on http://foo.bar:8080 but request is https://foo.bar:8443. Add CAS_ROOT_PROXIED_AS = https://foo.bar:8443 to your settings. |
| `CAS_LOGOUT_COMPLETELY`        | If False, logging out of the application won’t log the user out of CAS as well. |
| `CAS_VERSION`                  | The CAS protocol version to use. |
| `CAS_USERNAME_ATTRIBUTE`       | The CAS user name attribute from response. If set with a value other than uid when CAS_VERSION is not 'CAS_2_SAML_1_0', this will be handled by the CASBackend, in which case if the user lacks that attribute then authentication will fail. Note that the attribute is checked before CAS_RENAME_ATTRIBUTES is applied. |
| `CAS_APPLY_ATTRIBUTES_TO_USER` | If True any attributes returned by the CAS provider included in the ticket will be applied to the User model returned by authentication. This is useful if your provider is including details about the User which should be reflected in your model. |
| `CAS_RENAME_ATTRIBUTES`        |  A dict used to rename the (key of the) attributes that the CAS server may retrun. For example, if CAS_RENAME_ATTRIBUTES = {"casUserUid": "username", "casUser": "name", "casUserEmail", "email"} the ln attribute returned by the cas server will be renamed as last_name. Used with CAS_APPLY_ATTRIBUTES_TO_USER = True, this provides an easy way to fill in Django Users’ info independently from the attributes’ keys returned by the CAS server. |
| `CAS_CREATE_USER`              | Create a user when the CAS authentication is successful. The default is True. |

!!! warning "注意" - CAS_VERSION 可选 123CAS_2_SAML_1_0

📄 dingtalk.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/system/authentication/dingtalk.md

钉钉认证

!!! note "注:钉钉认证为 JumpServer 企业版功能。"

!!! tip "提示" - 使用阿里钉钉的用户作为 JumpServer 登录用户

1 创建钉钉应用

!!! tip "" - 打开 钉钉开发平台,用管理员权限用户登录; - 点击 企业内部开发创建应用,应用类型:H5微应用、小程序都可以,开发方式:企业自主开发。 钉钉创建应用

!!! tip "" - 在创建应用成功后可以查看到应用凭据。 查看应用凭据

2 配置 JumpServer 钉钉认证

!!! tip "" - 把钉钉获取到的应用凭据 AgentIdAppKeyAppSecret 对应的值填到 JumpServer 钉钉认证里面。 - 填写完成后可以点击测试确认状态。 配置钉钉认证

3 设置钉钉应用

3.1 配置回调域名

!!! tip "" - 点击钉钉的 登录与分享 模块页面,配置 接入登陆回调域名 为 JumpServer 的 Url 地址。 配置回调域名

3.2 钉钉出口配置

!!! tip "" - 点击钉钉的 开发管理 模块页面,配置 服务器出口IP应用首页地址钉钉出口配置

!!! tip "" - 详细参数说明:

| 参数     | 说明                  |
| ------- | --------------------- |
| 服务器出口IP | JumpServer 实际对外的公网地址。钉钉的白名单限制,你设置此 ip 后,只能通过此 ip 与钉钉 api 通信。 |
| 应用首页地址 | http 或 https 开头的 JumpServer 链接地址。 |

3.3 配置权限管理

!!! tip "" - 点击钉钉的 权限管理 模块页面,搜索 成员信息读权限。 - 选中 通讯录管理 - 成员信息读权限,点击批量申请。 钉钉权限配置

4 钉钉账号登陆 JumpServer

!!! tip "" - 用户正常使用账号密码登录 JumpServer 后,在个人信息里面绑定钉钉账号,绑定完成后就可以使用钉钉账号登录 JumpServer。 钉钉登陆

📄 feishu.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/system/authentication/feishu.md

飞书认证

!!! note "注:飞书认证为 JumpServer 企业版功能。"

!!! tip "提示" - 使用 飞书 的用户作为 JumpServer 登录用户

1 创建飞书应用

!!! tip "" - 打开 飞书开放平台,用管理员权限用户登录; - 点击 创建企业自建应用飞书创建应用

!!! tip "" - 输入 应用名称应用描述 后点击创建。 飞书创建应用02

2 设置飞书应用

!!! tip "" - 点击刚创建的应用,进入应用详情页。 应用详情

2.1 配置机器人

!!! tip "" - 点击左侧菜单 添加应用能力 模块页面,添加机器人能力。 启用机器人

2.2 配置安全设置

!!! tip "" - 点击左侧菜单 安全设置,添加重定向 URL 和 IP 白名单。 安全设置

!!! tip "" - 详细参数说明:

| 参数     | 说明                  |
| ------- | --------------------- |
| 重定向 URL | 注:jumpserver_host 改成你自己的 JumpServer 域名。 <br> https://`jumpserver_host`/core/auth/feishu/qr/bind/callback/ <br> https://`jumpserver_host`/core/auth/feishu/qr/login/callback/ |
| IP 白名单 | JumpServer 服务器的公网 IP。 |

2.3 配置权限管理

!!! tip "" - 点击左侧菜单 权限管理,搜索选中 获取用户 user ID获取与发送单聊、群组消息 的权限,点击批量开通。 权限管理

2.4 配置版本管理

!!! tip "" - 点击左侧菜单 版本管理与发布,选中页面右上角 创建版本创建版本

!!! tip "" - 应用功能选择 机器人,输入 应用版本号 等必要信息后点击保存。 创建版本

!!! tip "" - 在页面右上角选中 申请线上发布申请发布

!!! tip "" - 打开 飞书管理后台 页面,在左侧菜单 工作台 中,点击 应用审核 ,找到刚才提交的应用,点击 审核 通过。 应用审核

!!! tip "" - 确定 应用列表 的应用已经处于 已启用 状态。 检查应用

3 查看凭据

!!! tip "" - 点击应用名称进入应用详情,选中左侧菜单 凭证与基础信息,可以看到应用凭据。 查看凭据

4 配置 JumpServer 飞书认证

!!! tip "" - 把飞书获取到的应用凭据 App IDApp Secret 对应的值,填到 JumpServer 飞书认证中。 查看凭据

5 飞书账号登陆 JumpServer

!!! tip "" - 用户正常使用账号密码登录 JumpServer 后,在个人信息里面绑定飞书账号,绑定完成后就可以使用飞书账号登录 JumpServer。 查看凭据

📄 ldap.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/system/authentication/ldap.md

LDAP 认证

!!! tip "提示" - LDAP 支持 使用 LDAP 与 Windows AD 的用户作为 JumpServer 登录用户。

1 LDAP 配置

!!! tip "" - 可选 LDAP 或 LDAPS 来进行配置。 === "LDAP"

    | name        | explain                                           |
    | :---------- | :------------------------------------------------ |
    | LDAP地址    | ldap://serverurl:389                               |
    | 绑定DN      | administrator@jumpserver.org                       |
    | 密码        | ********                                           |
    | 用户OU      | ou=jumpserver,dc=jumpserver,dc=org                 |
    | 用户过滤器   | (cn=%(user)s)                                     |
    | LADP属性映射 | {"username": "cn", "name": "sn", "email": "mail"} |
    | 启动LDAP认证 | ☑️                                                 |

=== "LDAPS"

    | name        | explain                                           |
    | :---------- | :------------------------------------------------ |
    | LDAP地址    | ldaps://serverurl:636                              |
    | 绑定DN      | administrator@jumpserver.org                       |
    | 密码        | ********                                           |
    | 用户OU      | ou=jumpserver,dc=jumpserver,dc=org                 |
    | 用户过滤器   | (cn=%(user)s)                                     |
    | LADP属性映射 | {"username": "cn", "name": "sn", "email": "mail"} |
    | 启动LDAP认证 | ☑️                                                 |
    | CA 证书     | /opt/jumpserver/core/data/certs/ldap_ca.pem        |

!!! warning "注意" - 部分 LDAP 如 ldap.google.com,需要开启账号密码认证且 配置 stunnel 代理{:target="_blank"}

2 选项说明

!!! tip "" - DN 一定要是完整的DN,不能跳过OU,可以使用其他工具查询
- cn=admin,ou=aaa,dc=jumpserver,dc=org 或者用 user@domain.com 形式

!!! tip "" - 用户OU 用户OU可以只写顶层OU,不写子OU
- ou=aaa,ou=bbb,ou=ccc,dc=jumpserver,dc=org,可以只写 ou=ccc,dc=jumpserver,dc=org

!!! tip "" - 用户过滤器 根据规则到 用户OU 里面去检索用户,支持 memberof
- (uid=%(user)s)(sAMAccountName=%(user)s)

!!! tip "" - LADP属性映射 username name email 这三项不可修改删除
- {"username": "uid", "name": "sn", "email": "mail"}{"username": "sAMAccountName", "name": "cn", "email": "mail"}

!!! warning "注意" - 用户过滤器用什么筛选,LDAP属性映射字段要与其一致,过滤器用 uid,LDAP属性映射也要用 uid

3 参数说明

!!! tip "" - LDAP 的部分功能在 jumpserver/config/config.txt 进行设置 - LDAP 参数说明如下:

```vim
# LDAP/AD settings
# LDAP 搜索分页数量
AUTH_LDAP_SEARCH_PAGED_SIZE=1000
#
# 定时同步用户
# 启用 / 禁用
AUTH_LDAP_SYNC_IS_PERIODIC=True
# 同步间隔 (单位: 时) (优先)
AUTH_LDAP_SYNC_INTERVAL=12
# Crontab 表达式
AUTH_LDAP_SYNC_CRONTAB=* 6 * * *
#
# LDAP 用户登录时仅允许在用户列表中的用户执行 LDAP Server 认证
AUTH_LDAP_USER_LOGIN_ONLY_IN_USERS=False
#
# LDAP 认证时如果日志中出现以下信息将参数设置为 0 (详情参见:https://www.python-ldap.org/en/latest/faq.html)
# In order to perform this operation a successful bind must be completed on the connection
AUTH_LDAP_OPTIONS_OPT_REFERRALS=-1
```

📄 mfa.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/system/authentication/mfa.md

MFA 认证

!!! tip "提示" - MFA:多因子认证。

1 开启 MFA

!!! tip "" - 启用的情况,在 创建用户 或者 更新用户 时可以指定 启用多因子认证。 - 强制用户开启的情况,在 web - 用户管理 - 用户列表 点击用户详情,可强制启用多因子认证。 - 全局启用的情况,在 web - 系统设置 - 安全设置 勾选 多因子认证(开启后所有用户都会强制启用 MFA 认证,用户无法手动关闭)

!!! warning "推荐设置" - 所有管理员都应该强制启用多因子认证。 - 在实际生产环境中应该开启全局 MFA 以增加安全性。

2. 关闭 MFA

!!! tip "" - 正常启用的 MFA 用户可以自行关闭。 - 强制启用的 MFA 需要管理员关闭。 - 全局启用 MFA 无法关闭,必须先在 系统设置 - 安全设置 关闭全局 MFA。

3. 重置 MFA

!!! tip "" - 管理员可以在其他用户详情里面重置该用户的多因子认证,Web - 用户列表 点击用户的名称,即可看到用户详情。

!!! tip "" - 如果是管理员忘记了 MFA,可以通过控制台重置。

```sh
docker exec -it jms_core /bin/bash
cd /opt/jumpserver/apps
python manage.py shell
```
```python
from users.models import User
u = User.objects.get(username='admin')
u.mfa_level='0'
u.otp_secret_key=''
u.save()
```

📄 openid.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/system/authentication/openid.md

OpenID 认证

!!! note "注:OpenId 认证为 JumpServer 企业版功能。"

!!! tip "对接参考资料" - TOPIAM 对接

1 Keycloak 对接

1.1 创建设置 KeyCloak Client

KeyCloak

1.2 获取 Secret key

KeyCloak

1.3 查看配置

KeyCloak

!!! tip "" yaml { "issuer":"https://id.jumpserver.org/auth/realms/jumpserver", "authorization_endpoint":"https://id.jumpserver.org/auth/realms/jumpserver/protocol/openid-connect/auth", "token_endpoint":"https://id.jumpserver.org/auth/realms/jumpserver/protocol/openid-connect/token", "token_introspection_endpoint":"https://id.jumpserver.org/auth/realms/jumpserver/protocol/openid-connect/token/introspect", "userinfo_endpoint":"https://id.jumpserver.org/auth/realms/jumpserver/protocol/openid-connect/userinfo", "end_session_endpoint":"https://id.jumpserver.org/auth/realms/jumpserver/protocol/openid-connect/logout", "jwks_uri":"https://id.jumpserver.org/auth/realms/jumpserver/protocol/openid-connect/certs", "check_session_iframe":"https://id.jumpserver.org/auth/realms/jumpserver/protocol/openid-connect/login-status-iframe.html", "grant_types_supported":[ "authorization_code", "implicit", "refresh_token", "password", "client_credentials" ], "response_types_supported":[ "code", "none", "id_token", "token", "id_token token", "code id_token", "code token", "code id_token token" ], "subject_types_supported":[ "public", "pairwise" ], "id_token_signing_alg_values_supported":[ "ES384", "RS384", "HS256", "HS512", "ES256", "RS256", "HS384", "ES512", "RS512" ], "userinfo_signing_alg_values_supported":[ "ES384", "RS384", "HS256", "HS512", "ES256", "RS256", "HS384", "ES512", "RS512", "none" ], "request_object_signing_alg_values_supported":[ "ES384", "RS384", "ES256", "RS256", "ES512", "RS512", "none" ], "response_modes_supported":[ "query", "fragment", "form_post" ], "registration_endpoint":"https://id.jumpserver.org/auth/realms/jumpserver/clients-registrations/openid-connect", "token_endpoint_auth_methods_supported":[ "private_key_jwt", "client_secret_basic", "client_secret_post", "client_secret_jwt" ], "token_endpoint_auth_signing_alg_values_supported":[ "RS256" ], "claims_supported":[ "sub", "iss", "auth_time", "name", "given_name", "family_name", "preferred_username", "email" ], "claim_types_supported":[ "normal" ], "claims_parameter_supported":false, "scopes_supported":[ "openid", "address", "email", "offline_access", "phone", "profile", "roles", "web-origins" ], "request_parameter_supported":true, "request_uri_parameter_supported":true, "code_challenge_methods_supported":[ "plain", "S256" ], "tls_client_certificate_bound_access_tokens":true, "introspection_endpoint":"https://id.jumpserver.org/auth/realms/jumpserver/protocol/openid-connect/token/introspect" }

2 配置 JumpServer

!!! warning "注意" - 配置有两种方式,一种是 Keycloak 的配置,一种是 OIDC 的配置

!!! tip "" === "Keycloak 方式使用配置" sh vi /opt/jumpserver/config/config.txt vim # OPENID配置 # version <= 1.5.8 AUTH_OPENID=True BASE_SITE_URL=http://demo.jumpserver.org/ AUTH_OPENID_SERVER_URL=https://id.jumpserver.org/auth AUTH_OPENID_REALM_NAME=jumpserver AUTH_OPENID_CLIENT_ID=jumpserver AUTH_OPENID_CLIENT_SECRET=**************** AUTH_OPENID_SHARE_SESSION=True AUTH_OPENID_IGNORE_SSL_VERIFICATION=True

    !!! tip "参数说明"

    | name                                  | explain                                                 |
    | ------------------------------------- | ------------------------------------------------------- |
    | `BASE_SITE_URL`                       | JumpServer服务的地址(注意末尾加  "/")                   |
    | `AUTH_OPENID `                        | 是否启用 OpenID 认证                                     |
    | `AUTH_OPENID_SERVER_URL`              | OpenID Server 服务的地址(注意末尾要加 "/")              |
    | `AUTH_OPENID_REALM_NAME`              | realm 名称(client 所在的的 realm                        |
    | `AUTH_OPENID_CLIENT_ID`               | Client ID                                               |
    | `AUTH_OPENID_CLIENT_SECRET`           | Client Secret                                           |
    | `AUTH_OPENID_IGNORE_SSL_VERIFICATION` | 是否忽略 SSL 验证(在向 OpenID Server 发送请求获取数据时) |
    | `AUTH_OPENID_SHARE_SESSION`           | 是否共享 session(控制用户是否可以单点退出)               |

=== "标准 OIDC 配置方式"
    ```sh
    vi /opt/jumpserver/config/config.txt
    ```
    ```vim
    # OPENID配置
    AUTH_OPENID=True
    BASE_SITE_URL=https://demo.jumpserver.org/
    AUTH_OPENID_CLIENT_ID=jumpserver
    AUTH_OPENID_CLIENT_SECRET=****************
    AUTH_OPENID_PROVIDER_ENDPOINT=https://id.jumpserver.org/auth
    AUTH_OPENID_PROVIDER_AUTHORIZATION_ENDPOINT=https://id.jumpserver.org/auth/realms/jumpserver/protocol/openid-connect/auth
    AUTH_OPENID_PROVIDER_TOKEN_ENDPOINT=https://id.jumpserver.org/auth/realms/jumpserver/protocol/openid-connect/token
    AUTH_OPENID_PROVIDER_JWKS_ENDPOINT=https://id.jumpserver.org/auth/realms/jumpserver/protocol/openid-connect/certs
    AUTH_OPENID_PROVIDER_USERINFO_ENDPOINT=https://id.jumpserver.org/auth/realms/jumpserver/protocol/openid-connect/userinfo
    AUTH_OPENID_PROVIDER_END_SESSION_ENDPOINT=https://id.jumpserver.org/auth/realms/jumpserver/protocol/openid-connect/logout
    AUTH_OPENID_PROVIDER_SIGNATURE_ALG=HS256
    AUTH_OPENID_PROVIDER_SIGNATURE_KEY=null
    AUTH_OPENID_SCOPES=openid profile email
    AUTH_OPENID_ID_TOKEN_MAX_AGE=60
    AUTH_OPENID_ID_TOKEN_INCLUDE_CLAIMS=True
    AUTH_OPENID_USE_STATE=True
    AUTH_OPENID_USE_NONCE=True
    AUTH_OPENID_SHARE_SESSION=True
    AUTH_OPENID_IGNORE_SSL_VERIFICATION=True
    ```


    !!! tip "参数说明"

    | name                                          | explain
    | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | `BASE_SITE_URL`                               | JumpServer service URL.                                                                                                                                                               |
    | `AUTH_OPENID`                                 | Whether to enable OpenID authentication.                                                                                                                                              |
    | `AUTH_OPENID_CLIENT_ID`                       | This setting defines the Client ID that should be provided by the considered OIDC provider.                                                                                           |
    | `AUTH_OPENID_CLIENT_SECRET`                   | This setting defines the Client Secret that should be provided by the considered OIDC provider.                                                                                       |
    | `AUTH_OPENID_PROVIDER_ENDPOINT`               | This setting defines the top-level endpoint under which all OIDC-specific endpoints are available (such as the authotization, token and userinfo endpoints).                          |
    | `AUTH_OPENID_PROVIDER_AUTHORIZATION_ENDPOINT` | This setting defines the authorization endpoint URL of the OIDC provider.                                                                                                             |
    | `AUTH_OPENID_PROVIDER_TOKEN_ENDPOINT`         | This setting defines the token endpoint URL of the OIDC provider.                                                                                                                     |
    | `AUTH_OPENID_PROVIDER_JWKS_ENDPOINT`          | This setting defines the JWKs endpoint URL of the OIDC provider.                                                                                                                      |
    | `AUTH_OPENID_PROVIDER_USERINFO_ENDPOINT`      | This setting defines the userinfo endpoint URL of the OIDC provider.                                                                                                                  |
    | `AUTH_OPENID_PROVIDER_END_SESSION_ENDPOINT`   | This setting defines the end session endpoint URL of the OIDC provider.                                                                                                               |
    | `AUTH_OPENID_PROVIDER_SIGNATURE_ALG`          | This setting defines the signature algorithm used by the OpenID Connect Provider to sign ID tokens. The value of this setting should be  HS256 or RS256.                              |
    | `AUTH_OPENID_PROVIDER_SIGNATURE_KEY`          | This setting defines the value of the key used by the OP to the sign ID tokens. It should be used only when the AUTH_OPENID_PROVIDER_SIGNATURE_ALG setting is set to RS256.           |
    | `AUTH_OPENID_SCOPES`                          | This setting defines the OpenID Connect scopes to request during authentication.                                                                                                      |
    | `AUTH_OPENID_ID_TOKEN_MAX_AGE`                | This setting defines the amount of time (in seconds) an id_token should be considered valid.                                                                                          |
    | `AUTH_OPENID_ID_TOKEN_INCLUDE_CLAIM`          | This settings defines whether the id_token content can be used to retrieve userinfo claims and scopes in order to create and update the user being authenticated.                     |
    | `AUTH_OPENID_USE_STATE`                       | This setting defines whether or not states should be used when forging authorization requests. States are used to maintain state between the authentication request and the callback. |
    | `AUTH_OPENID_USE_NONCE`                       | This setting defines whether or not nonces should be used when forging authorization requests. Nonces are used to mitigate replay attacks.                                            |
    | `AUTH_OPENID_SHARE_SESSION`                   | Whether or not to share session (controls whether or not the user can exit with a single point).                                                                                      |
    | `AUTH_OPENID_IGNORE_SSL_VERIFICATION`         | Whether to ignore SSL validation (when sending a request to OpenID Server for data).                                                                                                  |
    | `AUTH_OPENID_ALWAYS_UPDATE_USER`              | Whether the user information is always updated (when the user logs in and authenticates successfully every time).                                                                     |

📄 passkey.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/system/authentication/passkey.md

Passkey 认证

1 操作过程

!!! tip "设置 Passkey 认证配置的前提条件如下" - JumpServer 开启 HTTPS 登录,且配置安全的 SSL 证书; - JumpServer 的配置文件中配置了可信任域名,即 DOMAINS; - 个人 PC 或其他设备支持设备生物认证。

!!! tip "" - 点击页面上方的Passkey按钮,即进入 Passkey 设置页面。 au_passkey01

!!! tip "" - 启用 Passkey 认证后,在个人信息页面录入 Passkey 凭证,即可在登录时选择 Passkey进行认证登录。

📄 radius.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/system/authentication/radius.md

Radius 认证

!!! note "注:Radius 认证为 JumpServer 企业版功能。"

!!! tip "提示" - 使用 Radius 的用户作为 JumpServer 登录用户。

1 操作过程

!!! tip "" - 修改 JumpServer 配置文件启用 Radius 认证

```sh
vi /opt/jumpserver/config/config.txt
```
```vim
AUTH_RADIUS=True
RADIUS_SERVER=127.0.0.1
RADIUS_PORT=1812
RADIUS_SECRET=radius_secret
```

!!! tip "" - 修改完成后保存,重启 JumpServer 即可。

2 参数说明

!!! tip "" - Radius 参数说明如下:

| name            | explain                                                    |
| --------------- | ---------------------------------------------------------- |
| `RADIUS_SERVER` | Radius 服务器的IP地址                                       |
| `RADIUS_PORT`   | Radius 服务器的端口                                         |
| `RADIUS_SECRET` | Radius 服务器的预共享秘钥                                   |
| `OTP_IN_RADIUS` | 使用动态密码认证,可以配合 ldap 使用,注意需要关闭 radius 认证 |

!!! tip "" - freeradiusSECRET 在 clients.conf 里面。 - 思科的 SECRET 可以从 web 页面的 RADIUS Authentication Settings 里面的 Shared Secret 获取。 - 华为的 SECRET 可以从 web 页面的 Authentication Options 里面的 Shared Secret 获取。 - 其他厂商的请自行咨询相关厂商工作人员。

!!! tip "" - 例如:

```vim
AUTH_RADIUS=True
RADIUS_SERVER=47.98.186.18
RADIUS_PORT=1812
RADIUS_SECRET=testing123
```

- 动态密码认证:

```vim
AUTH_RADIUS=True
RADIUS_SERVER=47.98.186.18
RADIUS_PORT=1812
RADIUS_SECRET=testing123
OTP_IN_RADIUS=True
```

📄 saml2.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/system/authentication/saml2.md

SAML2 认证

!!! note "注:SAML2 认证为 JumpServer 企业版功能。"

!!! tip "提示" - SAML2 协议的单点登录。

1 配置认证

!!! tip "" - 点击左侧菜单 设置 界面中的 认证设置,点击 SAML2 认证 后面的 启用 按钮。 配置认证 配置证书

!!! warning "注意" - 如果没有可信任的证书,需要手动生成。

```bash
openssl genrsa -out server.key 2048  # 这个生成的是 私钥
openssl req -new -x509 -days 3650 -key server.key -out server.crt -subj "/C=CN/ST=mykey/L=mykey/O=mykey/OU=mykey/CN=domain1/CN=domain2/CN=domain3"  # 这个是证书
```

!!! tip "" - 获取 SP metadata 信息。 - 访问 http://your_jms_url/core/auth/saml2/metadata/ 保存 metadata 内容(可保存成文件,到 idp 中直接导入) 获取 metadata

2 配置 IDP

!!! tip "提示" - 以 keycloak 为例。

!!! tip "" - 新建 realm,Name 自定义,然后点击 Save 保存。 新建 realm

!!! tip "" - 点击左侧 Client,点击右上角 Create 新建 client。 新建 client

!!! tip "" - 导入刚才保存的 SP metadata 文件,然后点击 Save 保存。 导入 metadata

!!! tip "" - 点击 Client 菜单的子菜单 Settings 界面进行配置修改。 - Client Signature Required 修改为 OFF。 - IDP Initiated SSO URL Name 修改为 Target IDP initiated SSO URL 地址中提供的信息。 配置 settings

!!! tip "" - 点击子菜单 Roles 中的 Add Role,其中名称可自定义。 配置 Roles

!!! tip "" - 点击子菜单 Mappers,创建如下属性映射。 配置 Mappers 属性映射

!!! tip "" - 点击子菜单 Scope,设置如下。 配置 Scope

!!! tip "" - 点击左侧菜单 Users,并在右上角新建用户。 配置 Users 添加 User

!!! tip "" - 点击 Credentials 子菜单,设置刚才新建用户的密码。 配置密码

!!! tip "" - 点击左侧菜单 realm settings 的子菜单 general,并点击下图所示位置,获取 IDP 的 Metadata 内容,也可根据官方文档根据 api 获取。 IDPMetadata

3 配置 SAML2

!!! tip "" - 将获取到的 IDP Metadata 放到 JumpServer 的 SAML2 认证设置中,并开启 SAML2 认证即可。 SAML2 参数

📄 slack.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/system/authentication/slack.md

Slack 认证

!!! note "注:Slack 认证为 JumpServer 企业版功能。"

!!! tip "提示" - 使用 Slack 的用户作为 JumpServer 登录用户

1 创建应用

!!! tip "" - 使用 Google 邮箱申请 Slack 账号; - 访问此链接创建对接 JumpServer 的 Slack App [https://api.slack.com/apps] - 点击 Create New App Slack创建应用1

!!! tip "" - 选择 From scrach 创建应用即可。 Slack创建应用2

!!! tip "" - 根据提示输入应用名和工作区,然后点击 Create App 创建应用。 Slack创建应用3

2 添加权限

!!! tip "" - 在应用配置界面找到 OAuth & Permissions 进行 JumpServer 相关配置。 Slack应用配置

!!! tip "" - 找到 Redirect URLs 配置处,将 JumpServer 的域名加入到下方(域名只支持https协议)。 Slack url配置

!!! tip "" - 切换到菜单 Collaborators,添加用户到此应用中,用户方可登录。 Slack添加用户

!!! tip "" - 切换到菜单 Oauth & Permissions 处,更改 Scopes 权限范围配置,增加 chat:write 权限。 Slack权限配置

!!! tip "" - Scopes 权限添加完成后,拉到此菜单最上边,点击 Install to WorkspaceSlack应用安装

3 查看凭据

!!! tip "" - 点击 Install to Workspace ,应用安装到工作区后,会显示机器人使用的 Bot User OAuth TokenSlack tonken获取

!!! tip "" - 切换到菜单 Basic Information ,找到 App CredentialsSlack secret

4 配置 Jumpserver Slack 认证

!!! tip "" - 将上述获取到的 Bot User OAuth TokenClient IDClient Secret 填入到 JumpServer 中即配置完成。 jumpserver配置slack

📄 sso.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/system/authentication/sso.md

SSO 认证

!!! note "注:SSO 认证为 JumpServer 企业版功能。"

!!! tip "提示" - 使用 SSO 对接第三方系统。

1 操作过程

!!! tip "" - 修改 JumpServer 配置文件启用 SSO.

```sh
vi /opt/jumpserver/config/config.txt
```
```vim
AUTH_SSO=True
```

!!! tip "" - 修改完成后保存,重启 JumpServer 即可。

2 使用方法

!!! tip "" - 通过 api 获取任意管理员 token 为其他用户创建免密登录链接。

```sh
curl -X POST https://demo.jumpserver.org/api/v1/authentication/auth/ \
  -H 'Content-Type: application/json' \
  -d '{"username": "admin", "password": "xxxxxx"}'
```
```json
{"token":"702ec7d22ea24a749140a00a98872e40", ...}
```

=== "Token 使用方法"
    ```sh
    curl -X POST https://demo.jumpserver.org/api/v1/authentication/sso/login-url/ \
      -H 'Content-Type: application/json' \
      -H "Authorization: Bearer 702ec7d22ea24a749140a00a98872e40" \
      -d '{"username": "zhangsan", "next": "/luna/"}'
    ```

=== "Private Token 使用方法"
    ```sh
    curl -X POST https://demo.jumpserver.org/api/v1/authentication/sso/login-url/ \
      -H 'Content-Type: application/json' \
      -H "Authorization: Token 937b38011acf499eb474e2fecb424ab3" \
      -d '{"username": "zhangsan", "next": "/luna/"}'
    ```

```json
Respons:
{
    "login_url": "http://demo.jumpserver.org/api/v1/authentication/sso/login/?authkey=779e97cc-cd05-41a7-a3c3-0320896ba309&next=%2Fluna%2F"
}
# 直接访问这个链接即可使用用户的身份免密登录 luna 页面  
# 用户和要登录页面设置: {"username": "zhangsan", "next": "/luna/"}  
# 这里的 zhangsan 是 JumpServer 用户列表里面的用户 username,可以改成其他的用户
```

📄 wechat.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/system/authentication/wechat.md

微信认证

!!! note "注:微信认证为 JumpServer 企业版功能。"

!!! tip "提示" - 使用 企业微信 的用户作为 JumpServer 登录用户。

1 创建企业微信应用

!!! tip "" - 打开 企业微信管理后台,用管理员权限用户登录。 - 选择 工作台,进入 应用管理 页面,选择 创建应用微信应用

!!! tip "" - 在应用的信息设置页面进行相关设置,可见范围 选择可以接收消息通知的部门或个人。 配置应用

2 查看凭据

!!! tip "" - 创建完应用后,可以进入应用查看相关的访问凭证信息,记录 AgentIdSecret 对应的值。 应用信息

!!! tip ""
- 进入 我的企业 页面,在 企业信息 栏里查询 企业ID企业id

3 配置 JumpServer 企业微信认证

!!! tip "" - 将获取到的 企业IDAgentIdSecret 值,填到 JumpServer 企业微信认证里面。 配置认证

4 设置企业微信应用

!!! tip ""
- 在 应用管理 选中对应应用后,滑向页面底部,选中 企业微信授权登陆配置信任

!!! tip ""
- 配置 授权回调域,将 JumpServer 的 url 地址填入企业微信 授权回调域 里面。 配置信任2

5 企业微信账号登陆 JumpServer

!!! tip "" - 用户正常使用账号密码登录 JumpServer 后,在个人信息里面绑定企业微信账号,绑定完成后就可以使用企业微信账号登录 JumpServer。 企业微信登陆

📄 basic.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/system/basic.md

基本设置

1 功能简述

!!! tip "" - 点击页面左侧菜单的基本设置按钮,进入基本设置页面。 - 可以编辑基本信息,包含当前站点 URL,以及导航栏链接的配置。

2 基本信息

!!! tip "" - 在此页面可以配置当前站点 URL(用户通过外部链接,如邮件跳转到堡垒机的 URL,此处可以填写域名或 IP) - 支持配置导航栏链接。 basic_07

📄 component.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/system/component.md

组件设置

1 功能简述

!!! tip "" - 点击页面左侧菜单的组件设置按钮,进入组件设置页面。 - 组件设置页面,可以配置 JumpServer 终端组件相关功能,例如 SSH Client 等连接方式开启、命令存储、录像存储等相关配置。

2 基本设置

!!! tip "" - 基本设置主要对三个方面进行设置:KoKo 组件、Razor 组件和 Magnus 组件。

!!! tip "" - KoKo 组件是服务于类 Unix 资产平台的组件,该组件的功能主要是:命令行的方式纳管 Linux、数据库、K8S 等资产; - 作为 SSH 服务,还可通过2222端口进行 SSH 或者 SFTP 操作资产。 component01

!!! tip "" - Razor 组件是服务于 Windows 系统的组件,主要通过 JumpServer Client 连接 Windows 资产。 - Magnus 组件是服务于数据库资产的组件,主要功能是以数据库代理的方式支持用户通过原生数据库客户端(例如 Navicat、SQLyog 等)对数据库进行直连操作。 component02

!!! tip "" - 详细参数说明:

| 参数     | 说明                  |
| ------- | --------------------- |
| 组件注册 | 是否允许其他外部的组件注册到本地的 Core 组件上。 |
| 启用SSH Client | 开启时连接 Linux 资产时可选择 SSH Client 方式连接,即拉起 JumpServer Client 内置的 Putty 连接 Linux 资产。 |
| 密码认证 | 该选项针对于命令行方式登录 JumpServer 堡垒机,关闭密码认证即不支持密码认证。 |
| 密钥认证 | 该选项针对于命令行方式登录 JumpServer 堡垒机,关闭密钥认证即不支持密钥认证。 |
| 资产列表排序 | 资产列表的排序规则按照"主机名"或者"IP"。 |
| 资产列表每页数量 | 资产列表每一页展示的资产数量。 |
| 启用 Razor 服务 | 是否启用 Razor 服务即使用RDP客户端连接 Windows 资产。 |
| 启用数据库组件 | 是否启用 Magnus 服务即使用外部客户端连接数据库资产。 |

3 组件管理

!!! tip "" - 组件管理页面主要是查看 JumpServer 所有组件的使用状态,页面如下图所示: component03

!!! tip "" - 组件管理页面主要可以查看的信息如下: - 查看组件名,组件名命名时会取组件所在的 hostname 和随机字符串的组合,当有多节点集群或者分布式部署时,可以通过该信息确定组件所在主机,便于排错处理; - 查看 JumpServer 所有组件的 CPU 负载、内存使用率等性能信息;当使用率过高时,会产生监控告警,告警通知在消息订阅中进行配置; - 查看会话,可以看到每个组件上实时的会话数。

!!! tip "" - 点击某个组件的更新按钮或选择多个组件,点击更多操作可进行更新。 - 更新组件的命令存储与录像存储,录像记录默认存放在服务器本地;命令记录默认存放在数据库中,这里可以更改录像与命令记录到外部存储。 component04

4 组件监控

!!! tip "" - 组件监控页面可以查看每个组件的状态,具体信息包含:组件的负载状态与该组件目前在线会话数。 component09

5 服务端点

!!! tip "" - 服务端点页面主要是访问入口的相关设置,服务端点使用户访问服务的地址(端口),当用户在连接资产时,会根据端点规则和资产标签选择服务端点,作为访问入口建立连接,实现分布式连接资产。 - 以下页面为 JumpServer 默认需要开通的端口,2222、3389以及数据库映射端口。 component10

5.1 举例说明

!!! tip "适用场景,例如:" - 某公司在华为云上有两个区域的资产,分别处于北京与上海,需要使用同一套堡垒机对他们进行纳管,会由于网络延迟以及带宽性能的问题造成较大的困难。 - 服务端点此时即可解决,例如:使用北京的一台资产部署一套 JumpServer 系统、上海的一台资产部署一套 JumpServer 系统。 - 两套 JumpServer 系统共用同一个数据库,访问资产时,北京的资产使用北京的 JumpServer 入口进入,上海的资产使用上海的 JumpServer 入口进入,对应区域的云主机指定到对应的节点访问。

!!! tip "" - 创建一个上海区域的 JumpServer 端点。 component11 !!! tip "" - 创建一个北京区域的 JumpServer 端点。 component12 !!! tip "" - 创建好后,服务端点页面截图如下: component13 !!! tip "" - 需要配合端点规则使用,如图将指定 IP 段的流量分配给指定的服务端点连接。 component14

6 端点规则

!!! tip "提示" - 对于服务端点选择策略,目前支持两种: - 1、根据端点规则指定端点(当前页面) - 2、通过资产标签选择端点,标签名固定是 endpoint,值是端点的名称。 - 两种方式优先使用标签匹配,因为 IP 段可能冲突,标签方式是作为规则的补充存在的。

!!! tip "" - 在端点规则中,设置哪些 IP 段,资产将对应访问到哪个服务端点。 component15

📄 function.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/system/function.md

功能设置

1 公告

!!! tip "" - 点击页面上方的公告按钮,即进入公告设置页面。 - 该页面可以自定义是否启用公告功能,并设置公告内容,在 JumpServer 页面全局展示。 fanction_01

!!! tip "" - 启用公告后,公告页面效果如下: basic_05

2 工单

!!! tip "" - 点击页面上方的工单按钮,即进入工单设置页面。 - 在此页面,可以自定义是否启用工单功能,用户可以通过工单功能来申请资源授权。 fanction_02

!!! tip "" - 启用工单后,工单页面效果如下: basic_02

3 任务中心

!!! tip "" - 点击页面上方的任务中心按钮,即进入任务中心设置页面。 - 在此页面,可以自定义是否启用作业中心功能,并且可以配置作业中心命令黑名单,用户可以通过作业中心功能来执行任务作业。 fanction_03

4 账号存储(X-Pack)

!!! note "注:账号存储为 JumpServer 企业版功能。"

!!! tip "" - 点击页面上方的账号存储按钮,即进入账号存储设置页面。 - 在此页面,账号密钥支持对接 HashiCorp Vault 第三方密钥存储系统,用户需要在config.txt配置文件中修改参数VAULT_ENABLEDtrue,然后回到页面进行配置即可。 - 进行数据同步,同步是单向的,只会从本地数据库同步到远端 Vault,同步完成本地数据库不再存储密码,请备份好数据。 - 二次修改 Vault 配置后需重启服务。 fanction_04

5 智能问答

!!! tip "" - 点击页面上方的智能问答按钮,即进入智能问答设置页面。 - 在此页面,智能问答支持对接 ChatGPT 服务,启动 Chat AI 小助手功能让用户在 JumpServer 系统右侧页面进行智能问答。 fanction_05

6 虚拟应用

!!! tip "" - 点击页面上方的虚拟应用按钮,即进入虚拟应用设置页面。 - JumpServer 支持使用 Linux 系统为远程应用功能的运行载体,在此页面开启以 Linux 系统为底层的虚拟应用功能。 fanction_06

📄 index_logo.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/system/index_logo.md

界面设置

!!! note "注:界面设置为 JumpServer 企业版功能。"

1 功能简述

!!! tip "" - 点击页面左侧的界面设置按钮,进入界面设置页面。 - 界面设置主要包含:登录页面标题设置、JumpServer 整体主题颜色设置,JumpServer 相关 Logo 设置、登录页面图片设置、公安联网备案信息设置。 index_logo01

📄 index_overview.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/system/index_overview.md

概览页

1 功能简述

!!! tip "" - 系统设置是 JumpServer 全局设置的操作入口,通过系统设置可以配置 JumpServer 用户认证、远程应用、安全等各类型的系统参数。

2 页面展示

!!! tip "" - 点击首页右上角系统设置按钮,进入系统设置页面。 index_overview_system01

📄 message.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/system/message.md

消息通知

1 邮件设置

!!! tip "" - 点击页面上方的邮件设置按钮,即进入邮件设置页面。 - 邮件设置界面主要配置邮件的发件邮箱信息,用于发送创建用户密码设置邮件、危险命令邮件、授权过期邮件等邮件到 JumpServer 用户邮箱。 notify01

1.1 配置说明

!!! tip "" - 以163邮箱为例说明。 - SMTP 主机是 smtp.163.com。 - SMTP 端口默认是25,使用 SSL 时端口为465/994,使用 TLS 时端口为587。 - SMTP 账号密码是登录邮箱的账号密码或账号授权码。 - 配置邮件服务器与邮件发送后,可添加测试收件人并点击测试连接按钮,如果配置正确,页面出现提示信息,同时 JumpServer 会发送一条测试邮件到 SMTP 账号邮箱。 notify02

2 短信设置(X-Pack)

!!! note "注:短信(阿里云、腾讯云)认证为 JumpServer 企业版功能。"

2.1 功能简述

!!! tip "" - 点击页面上方的短信设置按钮,可以设置短信 MFA 认证方式(目前支持阿里云、腾讯云、华为云、CMPP v2.0 和自定义方式对接) - JumpServer 还支持使用手机短信找回用户密码,管理员需要开启 SMS 服务,且用户信息需要配置手机号。 notify03

2.2 配置说明

!!! tip "" - 选择对应的短信服务商,填入服务商平台认证相关信息,点击测试按钮可测试配置是否正确。 sms02

2.3 用户侧配置

!!! tip "" - 点击用户头像 - 个人信息 - 左侧栏认证设置配置用户个人手机号信息。 sms04

!!! tip "" - 点击用户头像 - 个人信息 - 左侧栏用户信息配置多因子认证为短信认证。 sms03

3 消息订阅

!!! tip "" - 点击页面上方的消息订阅按钮,即进入消息订阅页面。 - 消息订阅界面主要可配置监控告警信息、危险命令告警、批量危险命令告警等信息的接收人。 - 消息订阅模式中默认只拥有站内信,该功能支持与其他平台进行对接(例如企业微信) notify04

3.1 设置消息接收人

!!! tip "" - 点击修改消息接收人按钮,进入消息接收人设置界面。 - 根据步骤① 选择需要接受消息的人,步骤② 加入消息接收人行列,点击步骤③ 确认。 message02

📄 organization.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/system/organization.md

组织管理

!!! note "注:组织管理为 JumpServer 企业版功能。"

1 功能简述

!!! tip "" - 点击页面左侧的组织管理按钮,进入组织管理页面。 - JumpServer 支持按组织的管理方式,方便授权管理员根据公司组织结构创建和查看不同组织环境下的运维审计信息,包括管理员、用户、用户组、资产、网域、账号、标签、权限管理等 organization01

2 创建组织

!!! tip "" - 切换至控制台页面,选中左上角的组织下拉框按钮,进入组织创建页面。 - 先为创建的组织命名;创建组织成功后,组织列表显示新创建的组织信息。 organization02

!!! warning "注意" - 组织内的角色、资产、账户等信息等更新、删除操作,都应切换至各自的组织内进行操作。

📄 remoteapp.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/system/remoteapp.md

远程应用

!!! note "注:社区版只支持 Website 方式。"

1 功能简述

!!! tip "" - 远程应用(RemoteApp)功能是微软在 Windows Server 2008之后,在其系统中集成的一项服务功能,使用户可以通过远程桌面访问远端的桌面与程序,客户端本机无须安装系统与应用程序的情况下也能正常使用远端发布的各种的桌面与应用。 remoteapp03

2 应用发布机

!!! tip "" - RemoteApp 功能需准备应用发布机环境来进行支持。 - 应用发布机是用来运行 Web 页面资产或者使用远程应用 Navicat 连接数据的程序运行主体。

2.1 版本要求

!!! tip "" - 应用发布机为 Windows Server 服务器,具体版本要求如下:

!!! tip ""

| :fontawesome-brands-windows: Windows Server 2016 | :fontawesome-brands-windows: Windows Server 2019 |
| ------------------------------------------------ | ----------------------------------------------- |
| :material-check:                                  | :material-check:                                |

2.2 创建应用发布机

!!! tip "" - 点击应用发布机页面的创建按钮即新建一个应用发布机。 remoteapp04

!!! tip "" - 我们支持通过 WinRM 和 OpenSSH 的协议进行应用发布机的部署(推荐使用 Windows-Server 自带的 WinRM 服务)

=== "WinRM" !!! tip "" - 通过 WinRM 协议部署应用发布机,在创建应用发布机页面新增 WinRM 协议即可。 remoteapp18

!!! tip ""
    - WinRM 配置完成。

=== "OpenSSH" !!! tip "" - 通过 OpenSSH 协议部署应用发布机需要安装 OpenSSH 协议,可以在 JumpServer 页面 - Web终端 - 帮助 - 下载 页面找到 OpenSSH 安装包。 remoteapp01

!!! tip ""
    - OpenSSH 安装包传到应用发布机桌面后,双击进行安装。
![remoteapp02](../../img/remoteapp02.png)

!!! tip ""
    - OpenSSH 配置完成。

!!! tip "" - 详细参数说明:

| 参数     | 说明                  |
| ------- | --------------------- |
| 名称 | 远程应用发布机的名称,识别信息。 |
| IP/主机 | 远程应用发布机的IP信息。 |
| 协议组 | 远程应用发布机支持的协议族以及协议组的端口。 |
| 账号列表 | 远程应用发布机的连接账号信息,例如 `Administrator` 用户。 |
| 自动创建帐号 | 该选项创建的帐号用于连接发布的应用。 |
| 创建帐号数量 | 公用帐号创建的数量。 |
| Core服务地址 | 远程应用发布机的 Agent 与 JumpServer 后端 Core 组件服务的通信地址。 |
| RDS 许可证 | RDS 许可证启用选项。 |
| RDS 许可服务器 | RDS 许可服务器信息。 |
| RDS 授权模式 | 选择"设备"或"用户"设置授权模式。 <br> A.设备:允许一台设备(任何用户使用的)连接到远程应用发布机。 <br> B.用户:授予一个用户从无限数目的客户端计算机或设备访问远程应用发布机。 |
| RDS 单用户单会话 | 选择"禁用"或"启用"设置单用户单会话模式。 <br> A.禁用:允许每个用户可以同时多台客户端电脑连接服务器远程桌面。 <br>  B.启用:禁止每个用户可以同时多台客户端电脑连接服务器远程桌面。 |
| RDS 最大断开时间 | 如果某个会话连接达到了此最大时间,连接即断开。 |
| RDS 远程应用注销时间限制 | 远程应用会话断开后的注销时间。 |

2.3 部署应用发布机

!!! tip "" - 创建应用发布机后需手动执行应用发布机部署,安装 Python、Chrome、Navicat、DBeaver 或自定义远程应用。 - 点击应用发布机名称按钮进入应用发布机详情页中,选择发布机部署页签,点击快速更新模块的初始化部署按钮,初始化应用发布机。 remoteapp05

2.4 查看应用发布机详情

!!! tip "" - 点击应用发布机名称按钮进入应用发布机详情页中。 - 此页面包含应用发布机详情信息,包括:远程应用发布机帐号列表、远程应用、发布机部署记录等。 remoteapp06

!!! tip "" - 详细参数说明:

| 模块     | 说明                  |
| ------- | --------------------- |
| 详情 | 该模块主要包含远程应用发布机的基本信息以及简单的自动化任务,更新硬件信息、测试可连接性等。 |
| 账号列表 | 该模块主要操作远程应用发布机的账号,默认创建初 JumpServer 会创建100个系统用户支持远程应用会话。 |
| 远程应用 | 该模块中包含默认的远程应用与自建的远程应用信息,在该模块可直接对远程应用进行部署。 |
| 发布机部署 | 该模块中主要用于远程应用发布机的初始化部署,以及部署日志的查看。 |
| 活动记录 | 该模块中记录了远程应用发布机的活动记录信息,点击可查看活动详情。 |

3 远程应用

!!! tip "" - 支持 Windows-Server 系统作为远程应用发布机。 - 创建远程应用资源,实现远程访问目标资源,并实现密码代填功能。 - 当前举例访问 JumpServer 页面过程(实现密码代填)

3.1 创建 Website 资产

!!! tip "" - 点击切换至控制台视图资产管理 - 资产列表 页面中。 - 选中 Web 页签,点击创建 Website 资产。 remoteapp08

!!! tip "" - 其中 选择器 参数,需要根据目标 Url 页面中的代码参数中获取。 - 我们通过 F12 打开目标 Url 的开发者工具页面,步骤如下图: remoteapp09

!!! tip "" - 把获取到的参数填写至创建的目标 Website 资产,参考当前页面3.1 标题第一张图片。

3.2 创建资产授权规则

!!! tip "" - 点击切换至权限管理 - 资产授权 页面中。 - 创建新的授权规则,如下图: remoteapp10

3.3 访问 Website 资产

!!! tip "" - 支持通过 Web终端 选中目标 Website 资产访问。 - 支持通过本地客户端方式访问 Website 资产,安装 JumpServer 客户端程序,可在 JumpServer 页面 - Web终端 - 帮助 - 下载 页面找到安装包。 remoteapp11

3.4 页面效果

!!! tip "" - 当前为远程应用页面访问效果图: remoteapp07

4 虚拟应用

!!! tip "" - 支持 Linux 系统作为远程应用发布机。 - 创建远程应用资源,实现远程访问目标资源,并实现密码代填功能。 - 当前举例访问 JumpServer 页面过程(实现密码代填)

4.1 功能启用

!!! tip "" - 点击系统设置 - 功能设置 - 虚拟应用页签启用虚拟应用功能。 remoteapp12

!!! tip "" - 功能启用后,可以在系统设置 - 远程应用模块中看到虚拟应用应用提供者页签。 remoteapp13

4.2 上传应用

!!! tip "" - 点击虚拟应用的页签,上传需要发布的应用,当前举例应用为 Chrome。 remoteapp14

!!! tip "" - 上传虚拟应用后,Panda 组件会同步这个应用配置的镜像,目前同步方式为自动同步,默认每5分钟一次,支持修改时间间隔。 - 点击应用提供者页签中的列表名称后跳转同步状态页。 remoteapp15

4.3 创建 Website 资产

!!! tip "" - 点击切换至控制台视图资产管理 - 资产列表 页面中。 - 选中 Web 页签,点击创建 Website 资产。 remoteapp08

4.4 创建资产授权规则

!!! tip "" - 点击切换至权限管理 - 资产授权 页面中。 - 创建新的授权规则,如下图: remoteapp10

4.5 访问 Website 资产

!!! tip "" - 支持通过 Web终端 选中目标 Website 资产访问(如下图)。 - 支持通过本地客户端方式访问 Website 资产,安装 JumpServer 客户端程序,可在 JumpServer 页面 - Web终端 - 帮助 - 下载 页面找到安装包。 remoteapp16 remoteapp17

5 自定义 Applet

5.1 Applet 介绍

!!! tip "" - Applet 是一个包含 Python 脚本的目录,必须至少包含以下文件:

```sh
├── i18n.yml
├── icon.png
├── main.py
├── manifest.yml
└── setup.yml
```

!!! tip "" - 文件名称作用说明:

| 文件名称 | 说明                  |
| ------- | --------------------- |
| main.py | Python 代填的执行脚本。 |
| icon.png | Applet 的图标 |
| manifest.yml | Applet 的元数据。 |
| setup.yml | 拉起程序的安装描述。 |
| i18n.yml | 对 manifest.yml 的国际化文件。 |

5.2 元数据 manifest.yml

!!! tip "" - manifest.yml 定义了 Applet 的元数据,如名称、作者、版本、支持的协议。

```yml
name: mysql_workbench8 (required)
display_name: MySQL Workbench8
comment: A tool for working with MySQL, to execute SQL and design tables (required)
version: 0.1 (required)
exec_type: python (reserved,暂未使用)
author: Eric (required)
type: general (required)
update_policy: none (暂未使用)
tags: (required)
  - database
protocols: (required)
  - mysql
```

!!! tip "" - 详细字段说明:

| 字段 | 说明                  |
| ------- | --------------------- |
| name | 名称最好是字母数字,不要包含特殊字符。 |
| protocols | 此 Applet 脚本支持的协议。 |
| tags | 一些标签。 |
| type | 主要是 General 或 Web。 |
| i18n.yml | 对 manifest.yml 的国际化文件。 |

5.3 安装条件 setup.yml

!!! tip "" - setup.yml 定义了 Applet 拉起程序的安装方式。

```yml
type: msi # exe, zip, manual
source: https://jms-pkg.oss-cn-beijing.aliyuncs.com/windows-pkgs/mysql-workbench-community-8.0.31-winx64.msi
arguments:
  - /qn
  - /norestart
destination: C:\Program Files\MySQL\MySQL Workbench 8.0 CE
program: C:\Program Files\MySQL\MySQL Workbench 8.0 CE\MySQLWorkbench.exe
md5: d628190252133c06dad399657666974a
```

!!! tip "" - 详细字段说明:

| 字段 | 说明                  |
| ------- | --------------------- |
| type | 是软件安装的方式。 <br> msi:安装软件。 <br> exe:安装软件。 <br> zip:解压安装方式。 <br> manual:手动安装方式。  |
| source | 软件下载地址。 |
| arguments | msi 或者 exe 安装程序需要的参数,使用静默安装。 |
| destination | 程序安装目录地址。 |
| program | 具体的软件地址。 |
| md5 | program 软件的 md5 值,主要用于校验安装是否成功。 |

!!! tip "" - 如果选择 manual 的方式,source 等保持为空,可不校验 MD5 值,需要手动登录 Applet host(应用发布机)上安装软件。

5.4 脚本执行 main.py

!!! tip "" - main.py 是 Python 脚本主程序。 - JumpServer 的 Remoteapp 程序 tinker 将通过调用 python main.py base64_json_data 的方式执行。 - base64_json_data 是 JSON 数据进行 base64 之后的字符串,包含资产、账号等认证信息。数据格式大致如下,依据 api 变化做相应调整:

```py
{
  "app_name": "mysql_workbench8",
  "protocol": "mysql",
  "user": {
    "id": "2647CA35-5CAD-4DDF-8A88-6BD88F39BB30",
    "name": "Administrator",
    "username": "admin"
  },
  "asset": {
    "asset_id": "46EE5F50-F1C1-468C-97EE-560E3436754C",
    "asset_name": "test_mysql",
    "address": "192.168.1.1",
    "protocols": [
      {
        "id": 2,
        "name": "mysql",
        "port": 3306
      }
    ]
  },
  "account": {
    "account_id": "9D5585DE-5132-458C-AABE-89A83C112A83",
    "username": "root",
    "secret": "test"
  },
  "platform": {
    "charset": "UTF-8"
  }
}
```

📄 security.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/system/security.md

安全设置

1 认证安全

!!! tip "" - 点击页面上方的认证安全按钮,进入认证安全页面。 - 认证安全页面主要配置 JumpServer 用户的认证安全配置,比如 MFA 设置以及用户异地登录通知等配置 security01

!!! tip "" - 详细参数说明:

| 参数     | 说明                  |
| ------- | --------------------- |
| 启动登录验证码 | 开启验证码,防止机器人登录。 |
| 启用登录附加码 | 密码和附加码一并发送给第三方认证系统进行校验, 如:有的第三方认证系统,需要密码+6位数字完成认证。 |
| 不活跃用户自动禁用 (天) | 每天检测一次,超过预设时间的不活跃用户自动禁用。 |
| 异地登录通知 | 根据登录 IP 判断是否属常用登录城市,如果不是,会发送异地登录提醒邮件到用户邮箱。 |
| 全局启用MFA认证 | 可以设置禁用 MFA,或所有用户启用 MFA、或仅管理员启用 MFA。 |
| 第三方认证开启 MFA | 支持 OIDC、CAS、SAML2 认证方式的用户进行 MFA 认证。 |
| 用户密码过期时间 | 用户每隔多少天需要强制更新密码,单位:天。 <br> 如果用户在此期间没有更新密码,用户密码将过期失效; <br> 密码过期提醒邮件将在密码过期前5天内由系统(每天)自动发送给用户。 |
| MFA校验有效期 | 查看账号密码校验 MFA 时的 MFA 有效期。 |
| 登录限制 | 用户登录策略的相关配置,见下文。 |
| 密码强弱规则 | 密码强弱规则的相关配置,见下文。 |

2 登录限制

!!! tip "" - 点击页面上方的登录限制按钮,进入登录限制页面。 - 登录限制页面是对用户登录堡垒机的一系列设置。 security02

!!! tip "" - 详细参数说明:

| 参数     | 说明                  |
| ------- | --------------------- |
| 限制用户登录失败次数 | 用户输错密码最多登录失败次数,之后将会被锁定一段时间。 |
| 禁止用户登录间隔 (分) | 当用户登录失败次数达到限制后,那么在此间隔内禁止登录。 |
| 限制 IP 登录失败次数 | 某 IP 最多登录失败次数,之后将会被禁止登录一段时间。 |
| 禁止 IP 登录间隔 (分) | 当用户登录失败次数达到限制后,那么在此间隔内禁止登录。 |
| IP 登录白名单 | 允许登录堡垒机的 IP。 |
| IP 登录黑名单 | 不允许登录堡垒机的 IP。 |
| 已锁定 IP | 查看已被锁定的 IP 列表。 |
| 仅一台设备登录 | 用户在新设备登录后,其他已登录的设备会自动退出。 |
| 仅已存在用户登录 | 如果开启,不存在的用户将不被允许登录; <br> 如果关闭,除本地认证方式外,其他认证方式的用户都允许登录并自动创建用户 (如果用户不存在) |
| 仅从用户来源登录 | 如果开启,用户登录时仅会向来源端进行认证; <br> 如果关闭,用户登录时会按照一定的顺序对所有已开启的认证方式进行顺序认证,只要有一个认证成功就可以直接登录。 |

3 密码安全

!!! tip "" - 点击页面上方的密码安全按钮,进入密码安全页面。 - 密码安全页面是对用户密码规则的一系列设置。 security03

!!! tip "" - 详细参数说明:

| 参数     | 说明                  |
| ------- | --------------------- |
| 用户密码过期时间 (天) | 如果用户在此期间没有更新密码,用户密码将过期失效; <br> 密码过期提醒邮件将在密码过期前5天内由系统 (每天)自动发送给用户。 |
| 不能设置近几次密码 | 用户重置密码时,不能为该用户前几次使用过的密码。 |
| 密码最小长度 | 设置用户密码支持的最小长度。 |
| 管理员密码最小长度 | 设置管理员密码支持的最小长度。 |
| 必须包含大写字符 | 密码中必须包含大写字符。 |
| 必须包含小写字符 | 密码中必须包含小写字符。 |
| 必须包含数字 | 密码中必须包含数字字符。 |
| 必须包含特殊字符 | 密码中必须包含特殊字符,如`#$@%`等。 |

4 会话安全

!!! tip "" - 点击页面上方的会话安全按钮,进入会话安全页面。 - 会话安全页面是对资源会话做的一系列设置。 security04

!!! tip "" - 详细参数说明:

| 参数     | 说明                  |
| ------- | --------------------- |
| 连接最大空闲时间 (分) | 资产在空闲时间达到此配置时会自动断开。 |
| 会话连接最大时间 (时) | 资产的会话时间达到此配置时会自动断开。 |
| 开启水印 | 启用后,Web 会话和录像将包含水印信息。 |
| 会话分享 | 开启后允许用户分享已连接的资产会话给他人,协同工作。 |

📄 storages.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/system/storages.md

存储设置

1 对象存储

!!! tip "" - 录像存储页面可以对 JumpServer 连接资产的会话录像存储的位置进行自定义。 - 目前支持的外部录像存储有亚马逊的 S3 云存储、Ceph、Swift、OSS、Azure、OBS、COS、SFTP。 component05

!!! tip "" - 点击创建按钮,选择对应的存储类型,以 腾讯云COS 存储为例: - 以下图片中的认证信息均在腾讯云控制台页面获取,输入对应的字段后点击提交。

component06

!!! tip "" - 创建完成后,即在组件管理中更新对象存储,将录像存储在 腾讯云COS 存储桶中。 update_component01

!!! warning "注意" - JumpServer 录像存储对接外部存储后,定期清理页面中的会话日志保存时间对录像存储失效。

2 命令存储

!!! tip "" - 命令存储页面可以对 JumpServer 连接资产的会话命令记录存储的位置进行自定义。 - 目前支持的外部命令存储有 Elasticsearch。 component07

!!! tip "" - 点击创建按钮,创建一个新的命令存储,将 JumpServer 连接资产产生的会话存储到外部,减少数据库的存储用量。 - 输入对应的字段点击提交,即创建成功,创建成功需要点击 Elasticsearch 名称 后的 更多 - 测试,来进行验证测试。 - JumpServer 支持使用 Elasticsearch 存储日志并支持根据日期建立索引,索引名为:JumpServer 中配置的索引名+命令记录产生的日期,方便用户根据日期进行查询与管理。 component08

!!! tip "" - 创建完成后,即在组件管理中更新命令存储,将录像存储在 Elasticsearch 中。 update_component02

!!! warning "注意" - JumpServer 命令存储对接外部存储后,定期清理页面中的会话日志保存时间对命令存储失效。

📄 tasks.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/system/tasks.md

系统任务

1 任务列表

!!! tip "" - 点击页面上方的任务列表按钮,进入任务列表页面。 - 该页面可查看所有自动化任务,其中包含账号备份计划,推送账号,检查资产连接性、邮件发送自动化任务等。 - 点击自动化任务名称即可进入该自动化任务的详情页面,在该自动化任务的详情页面可查看任务详情信息,执行历史等信息。 tasks_01

1.2 任务详情

!!! tip "" - 点击自动化任务名称即可进入该自动化任务的详情页面,在该自动化任务的详情页面可查看任务详情信息,执行历史信息。 tasks_02

1.3 任务监控

!!! tip "" - 点击任务列表页面的任务监控按钮,进入任务监控页面。 - 该页面主要查看 JumpSerevr 后端批量任务组件的相关状态。 tasks_03

!!! tip "" - 点击页面上部分的任务状态可查看成功任务的日志或失败任务的日志。 flower01 flower02

2 定期清理

!!! tip "" - 点击页面上方的定期清理按钮,即进入定期清理页面。 - 该页面的配置主要控制本地保存的记录,当录像与日志存储到外部存储中,不受该页面配置影响。 - 定期清理类型有:登录、任务、操作、上传下载日志和数据库记录,可以配置定时清理周期,为服务器存储减轻压力。 regular_clean01

!!! tip "" - 详细参数说明:

| 参数     | 说明                  |
| ------- | --------------------- |
| 登录日志 (天) | 登录日志主要记录记录 JumpServer 用户的登录信息,包括用户名、类型、Agent、登录 IP 地址、登录地点以及登录日期。 |
| 任务日志 (天) | 任务日志主要记录一些批量命令等自动化的任务信息。 |
| 操作日志 (天) | 操作日志主要记录用户对资产的操作动作、操作时间以及操作的资源类型和远端地址。 |
| 上传下载 (天) | 上传下载主要记录用户进行 FTP 上传、下载时所留下的操作记录。 |
| 会话日志 (天) | 会话日志主要记录通过 JumpServer 登录资产产生的会话日志包含录像与命令记录。 |
| 活动记录 (天) | 资源活动记录日志保留时间。 |
| 云同步记录 (天) | 云同步记录主要记录执行云同步任务的信息。 |

📄 tools.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/system/tools.md

系统工具

1 功能简述

!!! tip "" - 点击页面左侧的系统工具按钮,进入系统工具页面。 - 该页面包含了系统工具 Ping、Telnet、Nmap、Tcpdump、Traceroute 等网络检测工具,方便用户检测资产与 JumpServer 服务器之间的网络连接情况。 tools01

📄 file_management.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/user/file_management.md

文件管理

1 批量传输

!!! tip "" - JumpServer 支持对文件进行批量传输,即将本地文件批量的上传到多个JumpServer纳管的资产中。 file_management05

2 文件管理

!!! tip "" - 文件管理是传输文件的一种方式,上传下载默认 SFTP 目录默认为/tmp 路径。 - SFTP 目录与资产平台进行绑定,JumpServer 默认平台的 SFTP 目录无法修改(需联系管理员操作修改) file_management01

2.1 页面使用

!!! tip "" - 点击左侧节点树对应资产,即可进入资产中的 SFTP 目录。 - 当某个资产有且仅有一个账号授权时,点击资产名称即可直接进入该资产对应授权用户的SFTP目录,当某个资产拥有多个账号授权时,需点击资产名称后选择资产对应的账号才能进入对应的 SFTP 目录。 file_management02

!!! tip "" - 进入 SFTP 目录后,即可对文件夹或文件对应操作。 - 操作方式支持两种,第一种方式:直接在右侧页面右击唤出操作菜单;第二种方式:上方黑色部分的按钮进行对应的操作。 file_management03

📄 index_overview.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/user/index_overview.md

概览页

1 功能简述

!!! tip "" - 工作台的概览页面为用户登录后显示首页页面。 - 主要包含的信息:管理员用户设置的公告信息、最近连接的会话信息、个人信息简短介绍、个人最近登录信息、工单审计信息。

2 页面展示

user_index_overview01

📄 my_asset.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/user/my_asset.md

我的资产

1 功能简述

!!! tip "" - 我的资产页面主要包含的是已经授权给当前用户的资产信息。 - 页面左侧为管理员用户授权给当前用户的资产所处的节点树,页面右侧为管理员用户授权给当前用户的所有资产。

!!! tip "" - 页面展示如下: my_asset01

2 资产详情

!!! tip "" - 点击资产名称可以进入资产详情页面,查看资产详细信息。 my_asset02

3 快捷操作

!!! tip "" - 点击资产后方的第一个按钮,可以快速跳转到 Web 终端页面并连接对应资产。 - 点击资产后方的第二个按钮,可以将当前资产添加到收藏夹之中,便于在 Web终 端中连接该资产。 my_asset03

📄 execution_history.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/user/ops/execution_history.md

执行历史

1 功能简述

!!! tip "" - 执行历史页面主要是针对作业中心模块中的任务进行历史记录,可以在该页面查看任务执行的详情和具体输出信息。

!!! tip "" - 页面展示如下: execution_history01

📄 job_management.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/user/ops/job_management.md

作业管理

1 功能简述

!!! tip "" - 作业管理功能主要是针对命令、Playbook 两种作业类型来创建作业任务,作业任务可以定期、手动执行。

!!! tip "" - 页面展示如下: job_management01

2 创建作业任务

!!! tip "" - 以 Playbook 类型作业任务示例。 - 作业任务中的 Playbook 参数需要在左侧页面中的模版管理模块中创建好 Playbook 模版后进行选择。 - 点击切换至作业管理页面中,创建 Playbook 作业任务,如下图: job_management02

3 作业任务运行

!!! tip "" - 点击作业任务名称末尾的更多 - 运行,进行作业任务的运行操作,如下图: job_management03

📄 quick_command.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/user/ops/quick_command.md

快捷命令

1 功能简述

!!! tip "" - 快捷命令页面主要包含的是用户对有权限的资产进行批量命令处理。

!!! tip "" - 页面展示如下: quick_command

!!! tip "" - 详细模块说明:

!!! tip ""

| 序号  |   名称   |                                   说明                                                         |
| :------ | :------- | :------------------------------------------------------------------------------------------------ |
|    1    |   运行 | 运行命令按钮。 |
|    2    |   运行用户  | 填写目标资产运行命令的用户。 |
|    3    |   账号策略  | A.跳过。 <br> B.优先特权账号。 <br> C.仅特权账号。 |
|    4    |   语言  | 目前支持的语言类型有:Shell、PowerShell、Python、 MySQL、PostgreSQL、SQL Server。 |
|    5    |  超时(秒) | 执行命令超时时效,目前支持:10、30、60,单位为秒。 |
|    6    |  打开命令 <br> 保存命令   | 打开`模版管理`模块的命令进行使用。 <br> 保存当前命令至`模版管理`模块。 |

📄 template_management.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/user/ops/template_management.md

模版管理

1 功能简述

!!! tip "" - 模版管理功能主要是针对命令、Playbook 两种类型来创建模版,方便在快捷命令作业管理模块快速使用。

2 创建模版

!!! tip "" - 以 Playbook 类型模版示例(在目标资产创建一个 UID 为4000的用户) - 点击切换至模版管理页面中的Playbook 管理页签,创建 Playbook 模版。 - 先自行创建模版名称,然后点击名称 - 工作空间 页签,更新 main.yml 文件后保存,如下图: template_management01

3 指定 Playbook 模版运行作业任务

!!! tip "" - 参考 作业管理 介绍模块。

📄 api_key.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/user/personal_information/api_key.md

API Key

1 功能简述

!!! tip "" - JumpServer 支持使用 API Key 签名请求头进行认证,每个请求的头部不一致,相对于永久 Token 的认证方式,API Key方式更加安全。 - 点击 API Key 页面中的创建按钮,即可创建访问密钥,创建成功后会显示密钥的 Secret。 api_key01

2 IP 白名单

!!! tip "" - 选中已创建的 API Key,点击更新,支持配置白名单策略对非法的IP请求进行安全拦截,可提升 JumpServer 系统的安全性。 api_key02

📄 authentication_settings.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/user/personal_information/authentication_settings.md

认证设置

1 功能简述

!!! tip "" - 管理员用户在认证设置页面可对本人账号信息进行相应的认证配置。

2 页面功能

!!! tip "" - 页面展示图如下: personal_information01

!!! tip "" - 功能详细说明:

!!! tip ""

| 功能    |                说明                  |
| -------| ------------------------------------ |
| 个人信息设置 | 用户可再次页面设置手机、微信,开启短信 MFA 认证时,使用设置的手机号码接收短信。  |
| 登录密码设置 | 用户可在此页面自行更新当前账户的密码。 |
| SSH公钥设置 | 用户可在此页面自行设置SSH公钥并下载,在使用 SSH 终端登录时使用该公钥。 |

📄 connect_token.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/user/personal_information/connect_token.md

连接令牌

1 功能简述

!!! tip "" - 连接令牌是将身份验证和连接资产结合起来使用的一种认证信息,支持用户一键登录到资产,目前支持的组件包括:KoKo、Lion、Magnus、Razor 等。用户可以自行查看连接令牌信息并使令牌过期。

!!! tip "" - 页面展示如下: connect_token01

2 创建令牌

!!! tip "" - 连接 RDP 协议资产:通过 Web 终端连接 RDP 资产,选择连接方式为“RDP 客户端”,即可创建令牌信息。 - 连接数据库应用:通过 Web 终端连接数据库应用,选择连接方式为“DB Client”,即可创建令牌信息; - 通过调用 API 方式创建。

📄 passkey.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/user/personal_information/passkey.md

Passkey

1 功能简述

!!! tip "" - JumpServer 支持使用 Passkey 进行用户登录验证。 - Passkey 可能涉及到各种应用,包括电脑、手机、蓝牙设备等。 - 点击 Passkey 页面中的 创建 按钮,即可创建访问密钥。 passkey01

📄 preference_settings.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/user/personal_information/preference_settings.md

偏好设置

1 基本设置

!!! tip "" - 选中偏好设置基本按钮,可以对 JumpServer 页面导出文件的加密密码进行设置。 preference_settings01

!!! tip "" - 功能详细说明:

| 功能    |                说明                  |
| -------| ------------------------------------ |
| 文件加密密码 | 从 JumpServer 导出或者下载的文件中会存在敏感信息,此处设置文件的加密密码。此处的文件加密密码仅适用于账号密码批量导出的场景中。 |

2 Luna 配置设置

!!! tip "" - 选中偏好设置Luna 配置设置按钮,可以对 Luna 页面连接资产时的参数进行设置。 preference_settings02

!!! tip "" - 功能详细说明:

| 功能    |                说明                  |
| -------| ------------------------------------ |
| 异步加载资产树 | 支持资产连接页面异步加载资产树。 |
| RDP 分辨率 | 支持修改 RDP 分辨率,默认为 Auto。 |
| 键盘布局 | 支持选择连接 Windows 资产时使用的键盘布局。 |
| RDP 客户端选项 | 在通过 RDP 客户端连接 Windows 资产时,是否开启全屏与磁盘挂载。 |
| RDP 颜色质量 | 支持选择 RDP 远程会话的颜色深度。 |
| RDP 智能大小 | 支持按照客户端主机的窗口大小,来自适应客户端主机与远程主机的画面内容。 |
| 远程应用连接方式 | 支持选择远程应用的连接方式,Web 或者客户端方式。 |
| 字符终端字体大小 | 支持设置终端字体的大小显示。 |
| 字符终端 Backspace AS Ctrl+H | 支持在命令行中是否开启快捷键 Ctrl+H 作为删除键。 |
| 右键快速粘贴 | 支持在命令行中开启右键快速粘贴。 |

3 Koko 配置设置

!!! tip "" - 选中偏好设置Koko 配置设置按钮,可以对 Koko 组件连接资产时的参数进行设置。 preference_settings03

!!! tip "" - 功能详细说明:

| 功能    |                说明                  |
| -------| ------------------------------------ |
| 文件名冲突解决方案 | 当通过 KOKO 组件进行文件上传时,支持对冲突的文件名进行替换或加后缀的操作。 |

📄 temporary_passwd.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/user/personal_information/temporary_passwd.md

临时密码

1 功能简述

!!! tip "" - 我们支持使用临时密码登录 JumpServer。 - 用户可在该页面创建一个临时密码,临时密码有效期为300秒,使用后立刻失效。 temporary_passwd01

📄 user_information.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/user/personal_information/user_information.md

用户信息

1 功能简述

!!! tip "" - 页面可以查看用户的基本信息。 - 该页面可以进行一些认证配置,例如多因子认证、密码、SSH 密钥登信息,同时可设置消息订阅,默认包含站内信和邮件设置,如果配置了企业微信或者钉钉,还可以在此处开启订阅。 account_information01 account_information02

2 页面功能

!!! tip "" - 点击切换至用户信息页面。 - 点击可以进行认证配置和消息订阅操作。 account_information03

📄 user_tickets.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/user/user_tickets.md

工单

!!! note "注:工单为 JumpServer 企业版功能。"

1 功能概述

!!! tip "" - 用户点击申请、申请授权工单信息,流程对应的审批人审批通过后,用户即可获得申请资产的权限或用户登录请求与命令过滤。 admin_tickets01

2 我的申请

!!! tip "" - 我的申请页面主要进行资产授权的申请、查看资产授权工单详情。

2.1 申请工单

!!! tip "" - 在我的申请页面点击申请工单按钮。 - 选择申请资产授权按钮,进入资产授权申请页面如下所示: admin_tickets02

!!! tip "" - 详细参数说明:

| 参数     | 说明                  |
| ------- | --------------------- |
| 标题 | 该工单的标题。 |
| 组织 ID | 该工单所申请的权限以及 JumpServer 用户所处的组织。 |
| 节点 | JumpServer 用户申请的资产,节点指申请整个节点下所有资产的权限。 |
| 资产 | JumpServer 用户申请的资产。 |
| 申请账号 | JumpServer 用户申请的资产所使用的登录账号。 |
| 动作 | JumpServer 用户申请拥有的动作权限。 |
| 开始日期、失效日期 | 用户申请的权限使用的期限。 |

2.2 查看工单

!!! tip "" - 点击创建好的工单标题按钮,可进入工单详情页中。 - 工单详情页中包含该工单的基本信息、申请信息以及审批人同时可以与审批人进行对话。 admin_tickets03

2.3 关闭工单

!!! tip "" - 申请人在审批人未审批前可自行关闭工单,关闭入口位于工单详情页下方。 admin_tickets04

📄 web_terminal.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/guide/user/web_terminal.md

Web 终端

1 功能简述

!!! tip "" - Web 终端页面主要用于资产连接。 - 点击工作台页面的Web 终端按钮或者右上角图标,均可跳转到 Web 终端页面,并在跳转后的页面发起资产访问。

2 Web 终端快捷跳转

!!! tip "" - 快捷跳转按钮如图: web_terminal01

!!! tip "" - 跳转后效果如图: web_terminal02

3 组织切换

!!! tip "" - JumpServer 堡垒机支持在 Web 终端页面按照组织显示授权的资产。 - 在某一个用户在多组织下都拥有资产授权时,可在如图示中按钮切换组织并获取该组织的授权;在需求连接资产时,可以在左侧资产树列表中选择需要访问的资产,也可以通过资产名称或 IP 进行模糊索索,快速找到访问目标,点击即可登录。 web_terminal03

4 资产连接

!!! tip "" - Web 终端页面主要功能即为资产连接,不同类型的资产支持的连接方式也不同。

4.1 Linux 资产连接

!!! tip "" - 在 Web 终端页面选中Linux 资产 - 选择账号 - 选择连接方式后点击登录web_terminal04

!!! tip "" - Web CLI 连接效果如下: web_terminal05

!!! tip "" - Web SFTP 连接效果如下: web_terminal06

4.2 Windows 资产连接

!!! tip "" - 在 Web 终端页面选中Windows 资产 - 选择账号 - 选择连接方式后点击登录web_terminal07

!!! tip "" - Web GUI 连接效果如下: web_terminal08

4.3 数据库资产连接

!!! tip "" - JumpServer 提供多种方式登录数据库,例如命令行的方式 Web CLI,图形化方式 Web GUI,数据库代理直连方式 DB Client,远程应用方式拉起数据库工具后连接。

!!! tip "" - 以 MySQL 为例。 - 在 Web 终端页面选中数据库资产 - 选择账号 - 选择连接方式后点击登录web_terminal09

!!! tip "" - Web CLI 连接效果如下: web_terminal10

!!! tip "" - Web GUI 连接效果如下 (X-Pack): web_terminal11

!!! tip "" - 数据库类型连接支持说明:

!!! tip ""

| 数据库类型\连接方式 | Web CLI | Web GUI | DB Client |
| -------| ------- | ------- | ------- |
| MySQL | :material-check:  | :material-check: | :material-check:  |
| MariaDB | :material-check:  | :material-check: | :material-check:  |
| PostgreSQL | :material-check: (X-Pack) | :material-check: (X-Pack) | :material-check: (X-Pack) |
| Oracle | :material-close: | :material-check: (X-Pack) | :material-check: (X-Pack) |
| SQL Server | :material-check: (X-Pack) | :material-check: (X-Pack) | :material-check: (X-Pack) |
| Redis | :material-check:  | :material-close: | :material-check:  |
| MongoDB | :material-check:  | :material-close: | :material-close: |
| ClickHouse | :material-check: (X-Pack) | :material-close: | :material-close: |
| DB2 | :material-close: | :material-check: (X-Pack) | :material-close: |

5 文件管理

!!! tip "" - 在 Web 终端页面,点击文件管理按钮,选择连接按钮即可进入文件管理模块。 - 具体请查看文件管理模块具体介绍 web_terminal12

6 视图

!!! tip "" - 视图按钮主要用来在连接资产的情况下全屏展示。 web_terminal13

7 语言

!!! tip "" - JumpServer 支持多种语言,包含英语、中文、日语。 - 语言按钮可以切换 JumpServer 系统的显示语言。 web_terminal14

8 设置

!!! tip "" - 设置按钮主要针对于 JumpServer 资产 连接过程中的设置信息,其中包含:基本配置、图形化、命令行。

8.1 基本配置

!!! tip "" - 异步加载资产树:资产连接中是否实时加载资产树。

8.2 图形化

!!! tip "" - RDP分辨率:修改RDP分辨率,默认为Auto。 - RDP客户端选项:RDP客户端连接是否开启全屏与磁盘挂载。 - 远程应用连接方式:选择远程应用的连接方式,Web或者客户端方式。

8.3 命令行

!!! tip "" - 字符终端字体大小:设置终端字体的大小显示。 - 字符终端Backspace As Ctrl+H:在命令行中是否开启快捷键Ctrl+H做为删除键。 - 右键快速粘贴:命令行是否开启右键快速粘贴。

8.4 页面展示

web_terminal15

9 帮助

!!! tip "" - 帮助按钮主要分为三个模块,文档、支持、下载三个模块。

!!! tip "" - 文档与支持跳转链接均可进行修改,修改按钮位于:系统设置 - 其它设置 - 导航栏链接模块。 web_terminal16

!!! tip "" - 下载链接跳转至 JumpServer 系统周边工具下载,包含:JumpServer 客户端、微软 RDP 客户端、JumpServer 离线录像播放器等。 web_terminal17

📄 index.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/index.md

产品介绍

1 JumpServer 是什么?

!!! tip "" JumpServer 是广受欢迎的开源堡垒机,是符合 4A 规范的专业运维安全审计系统。JumpServer 帮助企业以更安全的方式管控和登录所有类型的资产,实现事前授权、事中监察、事后审计,满足等保合规要求。

index_02

!!! tip "" JumpServer 堡垒机支持的资产类型包括:

- SSH  (Linux / Unix / 网络设备 等)
- Windows (Web 方式连接 / 原生 RDP 连接)
- 数据库 (MySQL / MariaDB / Oracle / SQLServer / PostgreSQL / ClickHouse 等)
- NoSQL (Redis / MongoDB 等)
- GPT (ChatGPT 等)
- 云服务 (Kubernetes / VMware vSphere 等)
- Web 站点 (各类系统的 Web 管理后台)
- 应用 (通过 Remote App 连接各类应用)

!!! tip "文档指引" - JumpServer 介绍

     [**产品简介**](https://docs.jumpserver.org/zh/v3/) &emsp;&emsp;&emsp;&emsp;&emsp;  [**安装部署**](installation/setup_linux_standalone/requirements/) &emsp;&emsp;&emsp;&emsp;&emsp;  [**体验环境**](https://demo.jumpserver.org/ ) &emsp;&emsp;&emsp;&emsp;&emsp;  [**企业试用**](https://jinshuju.net/f/kyOYpi) &emsp;&emsp;&emsp;&emsp;&emsp;  [**社区论坛**](https://bbs.fit2cloud.com/c/js/5) &emsp;&emsp;&emsp;&emsp;&emsp; [**20分钟掌握 JumpServer 视频教学**](https://www.bilibili.com/video/BV11AsDegEo8/?from_spmid=main.space-contribution.0.0&plat_id=411&share_from=season&share_medium=android&share_plat=android&share_session_id=b4f8e48e-a702-4117-b312-8674afac5150&share_source=WEIXIN&share_tag=s_i&spmid=united.player-video-detail.0.0&timestamp=1727075002&unique_k=O5Z1B2e)

2 产品特色

!!! tip "" JumpServer 的产品特色包括:

- 开源:零门槛,线上快速获取和安装;
- 分布式:轻松支持大规模并发访问;
- 无插件:仅需浏览器,极致的 Web Terminal 使用体验;
- 多云支持:一套系统,同时管理不同云上面的资产;
- 云端存储:审计录像云端存储,永不丢失;
- 多租户:一套系统,多个子公司和部门同时使用;
- 多应用支持:数据库,Windows 远程应用,Kubernetes。

3 页面展示

!界面展示

4 功能列表

!!! tip "" - JumpServer 堡垒机功能列表

5 应用商店

!!! tip "" JumpServer 的远程应用功能,社区版默认支持 Chrome、DBeaver 应用,企业版支持更丰富的远程应用,可点击 应用商店 来获取更多远程应用。

6 安全说明

!!! tip "" JumpServer 是一款安全产品,请参考 基本安全建议 部署安装。

如果你发现安全问题,可以直接联系我们:

- ibuler@fit2cloud.com
- support@fit2cloud.com
- 400-052-0755

7 商业产品

!!! tip "" - JumpServer 企业版{:target="_blank"} - JumpServer 一体机{:target="_blank"}

8 了解更多

!!! tip "" - 如何向团队介绍 JumpServer? - 新一代堡垒机建设指南{:target="_blank"} - JumpServer 知识库{:target="_blank"} - FIT2CLOUD Bilibili 官方站{:target="_blank"} - FIT2CLOUD 技术博客{:target="_blank"}

📄 download.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/download.md

资源下载

VideoPlayer{:target="_blank"}

!!! tip "" - Jumpserver 离线录像播放器,可以从 JumpServer 页面 帮助菜单 - 工具下载 里下载安装。

| 版本     | Windows :fontawesome-brands-windows: |  macOS :fontawesome-brands-apple: | Linux :fontawesome-brands-linux: |
| ------- | ------------------------------------ | --------------------------------- | -------------------------------- |
| 开源版本 | :material-check:                     | :material-check:                  | :material-close:                 |
| 企业版本 | :material-check:                     | :material-check:                  | :material-close:                 |

Clients{:target="_blank"}

!!! tip "" - JumpServer 客户端默认已经集成到 JumpServer 镜像,可以从 JumpServer 页面 帮助菜单 - 工具下载 里下载安装,开源版本支持 SSH 的本地拉起,企业版本还支持 RDP 拉起。

| 版本     | Windows :fontawesome-brands-windows: |  macOS :fontawesome-brands-apple:   | Linux :fontawesome-brands-linux: |
| ------- | ------------------------------------ | ----------------------------------- | -------------------------------- |
| 开源版本 | :material-check:                     | :material-check:                    | :material-check:                 |
| 企业版本 | :material-check:                     | :material-check:                    | :material-check:                 |

Jmservisor{:target="_blank"}

!!! tip "" - Jumpserver 拉起 Windows Server RemoteApp 功能使用的客户端,用户可以从 JumpServer 页面 帮助菜单 - 工具下载 里下载安装。

| 版本     | :fontawesome-brands-windows: Windows Server 2016 | :fontawesome-brands-windows: Windows Server 2019 | :fontawesome-brands-windows: Windows Server 2022 |
| ------- | ------------------------------------------------ | ----------------------------------------------- | ------------------------------------------------ |
| 开源版本 | :material-check:                                  | :material-check:                                | :material-check:                                 |
| 企业版本 | :material-check:                                  | :material-check:                                | :material-check:                                 |

Installer{:target="_blank"}

!!! tip "" - 无法访问 GitHub 可以使用离线安装包进行安装部署。

| 版本                     | :fontawesome-brands-linux: linux/amd64                                                     | :fontawesome-brands-linux: linux/arm64                                                     | :fontawesome-brands-linux: linux/loong64                                                     |
| ------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------- |
| {{ jumpserver.tag }} | jumpserver-offline-installer-{{ jumpserver.tag }}-amd64.tar.gz | jumpserver-offline-installer-{{ jumpserver.tag }}-arm64.tar.gz | jumpserver-offline-installer-{{ jumpserver.tag }}-loong64.tar.gz |

📄 jmsctl_sh.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/jmsctl_sh.md

命令行工具

1 命令行运维工具 - jmsctl

!!! tip "" - JumpServer 默认内置了命令行运维工具 - jmsctl,通过执行 jmsctl help 命令,可以查看相关的帮助文档。

```sh
JumpServer 部署管理脚本

Usage: 
  ./jmsctl.sh [COMMAND] [ARGS...]
  ./jmsctl.sh --help

Installation Commands: 
  install           安装 JumpServer 服务

Management Commands:
  config            配置工具,执行 jmsctl config --help,查看帮助
  start             启动 JumpServer 服务
  stop              停止 JumpServer 服务
  restart           重启 JumpServer 服务
  status            查看 JumpServer 服务运行状态
  down              脱机 JumpServer 服务
  uninstall         卸载 JumpServer 服务

More Commands: 
  load_image        加载 Docker 镜像
  backup_db         备份 JumpServer 数据库
  restore_db [file] 通过数据库备份文件恢复数据
  raw               执行原始 docker compose 命令
  tail [service]    查看 Service 日志
```

2 配置工具 - jmsctl config

!!! tip "" - JumpServer 默认内置了配置工具 - jmsctl config,通过执行 jmsctl config help 命令,可以查看相关的帮助文档。

```sh
Usage: 
  ./jmsctl.sh config [ARGS...]
  -h, --help

Args: 
  ntp              配置 NTP 同步
  init             初始化 config 配置文件
  port             配置 JumpServer 服务端口
  ssl              配置 Web SSL 
  env              配置 JumpServer 环境变量
```

📄 migration.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/migration.md

迁移文档

!!! warning "注意" - 升级及迁移请保持 SECRET_KEY 与旧版本一致,否则会导致数据库加密数据无法解密。

1 迁移说明

!!! tip "v2.6 版本升级说明" - 统一企业版本与开源版本安装方式,社区版可以无缝切换到企业版。 - 今后只会维护此安装方式,其他安装方式不再提供技术支持。 - 安装完成后配置文件在 /opt/jumpserver/config/config.txt

2 迁移步骤

2.1 数据库备份

!!! tip "" - 在 jumpserver/config.txt 文件中获取数据库信息如下:

```yaml
DB_HOST: 127.0.0.1   # 数据库服务器 IP
DB_PORT: 3306        # 数据库服务器 端口
DB_USER: jumpserver  # 连接数据库的用户
DB_PASSWORD: ******  # 连接数据库用户的密码
DB_NAME: jumpserver  # JumpServer 使用的数据库
# mysqldump -h<DB_HOST> -P<DB_PORT> -u<DB_USER> -p<DB_PASSWORD> <DB_NAME> > /opt/<DB_NAME>.sql
```

!!! tip "" - 选择与自己环境部署方式对应的数据库备份方式:

=== "installer 部署"
    ```sh
    # 记录 SECRET_KEY 和 BOOTSTRAP_TOKEN
    cat /opt/jumpserver/config/config.txt | egrep "SECRET_KEY|BOOTSTRAP_TOKEN"
    ```
    ```sh
    ./jmsctl.sh backup_db
    ```

=== "源码部署"
    ```sh
    cd /opt/koko
    ./koko -s stop
    # 更老的版本使用的 coco guacamole
    # cd /opt/coco
    # ./cocod stop
    # /etc/init.d/guacd stop
    # sh /config/tomcat9/bin/shutdown.sh
    ```
    ```sh
    cd /opt/lion
    ps aux | grep lion | awk '{print $2}' | xargs kill -9
    ```
    ```sh
    cd /opt/jumpserver

    # 记录 SECRET_KEY 和 BOOTSTRAP_TOKEN
    cat config.yml | egrep "SECRET_KEY|BOOTSTRAP_TOKEN"
    ```
    ```sh
    source /opt/py3/bin/activate
    ./jms stop
    ```
    ```sh
    cd /opt
    mv /opt/jumpserver /opt/jumpserver_bak
    ```
    ```sh
    mysqldump -h127.0.0.1 -P3306 -ujumpserver -p jumpserver > /opt/jumpserver.sql
    ```

=== "组件容器化部署"
    ```sh
    docker stop jms_koko jms_lion     
    docker rm jms_koko jms_lion     
    # 更老的版本使用的 coco guacamole
    # docker stop jms_coco jms_guacamole
    # docker rm jms_coco jms_guacamole
    ```
    ```sh
    cd /opt/jumpserver

    # 记录 SECRET_KEY 和 BOOTSTRAP_TOKEN
    cat config.yml | egrep "SECRET_KEY|BOOTSTRAP_TOKEN"
    ```
    ```sh
    source /opt/py3/bin/activate
    ./jms stop
    ```
    ```sh
    cd /opt
    mv /opt/jumpserver /opt/jumpserver_bak
    ```
    ```sh
    mysqldump -h127.0.0.1 -P3306 -ujumpserver -p jumpserver > /opt/jumpserver.sql
    ```

=== "setuptools 脚本部署"
    ```sh
    cd /opt/setuptools

    # 记录 SECRET_KEY 和 BOOTSTRAP_TOKEN
    cat config.conf | egrep "SECRET_KEY|BOOTSTRAP_TOKEN"
    ```
    ```sh
    ./jmsctl.sh stop
    docker rm jms_koko jms_guacamole
    systemctl disable jms_core
    mv /opt/jumpserver /opt/jumpserver_bak
    ```
    ```sh
    mysqldump -h127.0.0.1 -P3306 -ujumpserver -p jumpserver > /opt/jumpserver.sql
    ```

=== "docker 部署"
    ```sh
    docker cp jms_all:/opt/jumpserver /opt/jumpserver_bak

    # 记录 SECRET_KEY 和 BOOTSTRAP_TOKEN
    docker exec -it jms_all env | egrep "SECRET_KEY|BOOTSTRAP_TOKEN"
    ```
    ```sh
    docker exec -it jms_all /bin/bash
    mysqldump -h$DB_HOST -P$DB_PORT -u$DB_USER -p$DB_PASSWORD $DB_NAME > /opt/jumpserver.sql
    exit
    ```
    ```sh
    docker cp jms_all:/opt/jumpserver.sql /opt
    docker stop jms_all
    ```

=== "docker-compose 部署"
    ```sh
    docker cp jms_core:/opt/jumpserver /opt/jumpserver_bak

    # 记录 SECRET_KEY 和 BOOTSTRAP_TOKEN
    docker exec -it jms_core env | egrep "SECRET_KEY|BOOTSTRAP_TOKEN"
    ```
    ```sh
    docker exec -it jms_mysql /bin/bash
    mysqldump -uroot jumpserver > /opt/jumpserver.sql
    exit
    ```
    ```sh
    docker cp jms_mysql:/opt/jumpserver.sql /opt
    cd /opt/Dockerfile
    docker-compose stop
    ```

2.2 修改数据库字符集

!!! tip "" - 如果你不需要或不想处理数据库字符集可以跳过此步骤, 保证迁移前后的数据库字符集一样即可。

```sh
if grep -q 'COLLATE=utf8_bin' /opt/jumpserver.sql; then
    cp /opt/jumpserver.sql /opt/jumpserver_bak.sql
    sed -i 's@ COLLATE=utf8_bin@@g' /opt/jumpserver.sql
    sed -i 's@ COLLATE utf8_bin@@g' /opt/jumpserver.sql
else
    echo "备份数据库字符集正确";
fi
```

2.3 下载 jumpserver-install

!!! tip "" sh cd /opt yum -y install wget wget https://github.com/jumpserver/installer/releases/download/{{ jumpserver.tag }}/jumpserver-installer-{{ jumpserver.tag }}.tar.gz tar -xf jumpserver-installer-{{ jumpserver.tag }}.tar.gz cd jumpserver-installer-{{ jumpserver.tag }}

2.4 编辑临时配置文件

!!! tip ""
sh vi config-example.txt ```vim hl_lines="3 9-10" # 修改下面选项, 其他保持默认 ### 数据持久化目录, 安装完成后请勿随意更改, 可以使用其他目录如: /data/jumpserver VOLUME_DIR=/opt/jumpserver

### 注意: SECRET_KEY 与旧版本不一致, 加密的数据将无法解密

# Core 配置
### 启动后不能再修改,否则密码等等信息无法解密
SECRET_KEY=                           # 从旧版本的配置文件获取后填入 (*)
BOOTSTRAP_TOKEN=                      # 从旧版本的配置文件获取后填入 (*)
LOG_LEVEL=ERROR
# SESSION_COOKIE_AGE=86400
SESSION_EXPIRE_AT_BROWSER_CLOSE=True  # 关闭浏览器后 session 过期
```

2.5 开始部署 JumpServer

!!! tip "" - 选择与自己数据库环境对应的部署方式。

=== "使用新的内置数据库"
    ```sh
    ./jmsctl.sh install
    ```
    ```nginx hl_lines="31 48 57 61 65 69"

           ██╗██╗   ██╗███╗   ███╗██████╗ ███████╗███████╗██████╗ ██╗   ██╗███████╗██████╗
           ██║██║   ██║████╗ ████║██╔══██╗██╔════╝██╔════╝██╔══██╗██║   ██║██╔════╝██╔══██╗
           ██║██║   ██║██╔████╔██║██████╔╝███████╗█████╗  ██████╔╝██║   ██║█████╗  ██████╔╝
      ██   ██║██║   ██║██║╚██╔╝██║██╔═══╝ ╚════██║██╔══╝  ██╔══██╗╚██╗ ██╔╝██╔══╝  ██╔══██╗
      ╚█████╔╝╚██████╔╝██║ ╚═╝ ██║██║     ███████║███████╗██║  ██║ ╚████╔╝ ███████╗██║  ██║
       ╚════╝  ╚═════╝ ╚═╝     ╚═╝╚═╝     ╚══════╝╚══════╝╚═╝  ╚═╝  ╚═══╝  ╚══════╝╚═╝  ╚═╝

                                                                         Version:  {{ jumpserver.tag }}


    1. 检查配置文件
    配置文件位置: /opt/jumpserver/config
    /opt/jumpserver/config/config.txt  [ √ ]
    /opt/jumpserver/config/nginx/lb_rdp_server.conf  [ √ ]
    /opt/jumpserver/config/nginx/lb_ssh_server.conf  [ √ ]
    /opt/jumpserver/config/nginx/cert/server.crt  [ √ ]
    /opt/jumpserver/config/nginx/cert/server.key  [ √ ]
    完成

    2. 备份配置文件
    备份至 /opt/jumpserver/config/backup/config.txt.2021-07-15_22-26-13
    完成

    >>> 安装配置 Docker
    1. 安装 Docker
    开始下载 Docker 程序 ...
    开始下载 Docker Compose 程序 ...
    完成

    2. 配置 Docker
    是否需要自定义 docker 存储目录, 默认将使用目录 /var/lib/docker? (y/n)  (默认为 n): n
    完成

    3. 启动 Docker
    Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /etc/systemd/system/docker.service.
    完成

    >>> 加载 Docker 镜像
    Docker: Pulling from jumpserver/core:{{ jumpserver.tag }}       [ OK ]
    Docker: Pulling from jumpserver/koko:{{ jumpserver.tag }}       [ OK ]
    Docker: Pulling from jumpserver/web:{{ jumpserver.tag }}        [ OK ]
    Docker: Pulling from jumpserver/redis:6-alpine      [ OK ]
    Docker: Pulling from jumpserver/mysql:5             [ OK ]
    Docker: Pulling from jumpserver/lion:{{ jumpserver.tag }}       [ OK ]

    >>> 安装配置 JumpServer
    1. 配置网络
    是否需要支持 IPv6? (y/n)  (默认为 n): n
    完成

    2. 配置加密密钥
    SECRETE_KEY:     YTE2YTVkMTMtMGE3MS00YzI5LWFlOWEtMTc2OWJlMmIyMDE2
    BOOTSTRAP_TOKEN: YTE2YTVkMTMtMGE3
    完成

    3. 配置持久化目录
    是否需要自定义持久化存储, 默认将使用目录 /opt/jumpserver? (y/n)  (默认为 n): n
    完成

    4. 配置 MySQL
    是否使用外部 MySQL? (y/n)  (默认为 n): n
    完成

    5. 配置 Redis
    是否使用外部 Redis? (y/n)  (默认为 n): n
    完成

    6. 配置对外端口
    是否需要配置 JumpServer 对外访问端口? (y/n)  (默认为 n): n
    完成

    7. 初始化数据库
    Creating network "jms_net" with driver "bridge"
    Creating jms_mysql ... done
    Creating jms_redis ... done
    2021-07-15 22:39:52 Collect static files
    2021-07-15 22:39:52 Collect static files done
    2021-07-15 22:39:52 Check database structure change ...
    2021-07-15 22:39:52 Migrate model change to database ...

    475 static files copied to '/opt/jumpserver/data/static'.
    Operations to perform:
      Apply all migrations: acls, admin, applications, assets, audits, auth, authentication, captcha, common, contenttypes, django_cas_ng, django_celery_beat, jms_oidc_rp, notifications, ops, orgs, perms, sessions, settings, terminal, tickets, users
    Running migrations:
      Applying contenttypes.0001_initial... OK
      Applying contenttypes.0002_remove_content_type_name... OK
      Applying auth.0001_initial... OK
      Applying auth.0002_alter_permission_name_max_length... OK
      Applying auth.0003_alter_user_email_max_length... OK
      Applying auth.0004_alter_user_username_opts... OK
      Applying auth.0005_alter_user_last_login_null... OK
      Applying auth.0006_require_contenttypes_0002... OK
      Applying auth.0007_alter_validators_add_error_messages... OK
      Applying auth.0008_alter_user_username_max_length... OK
      ...
      Applying sessions.0001_initial... OK
      Applying terminal.0032_auto_20210302_1853... OK
      Applying terminal.0033_auto_20210324_1008... OK
      Applying terminal.0034_auto_20210406_1434... OK
      Applying terminal.0035_auto_20210517_1448... OK
      Applying terminal.0036_auto_20210604_1124... OK
      Applying terminal.0037_auto_20210623_1748... OK
      Applying tickets.0008_auto_20210311_1113... OK
      Applying tickets.0009_auto_20210426_1720... OK

    >>> 安装完成了
    1. 可以使用如下命令启动, 然后访问
    cd /root/jumpserver-installer-{{ jumpserver.tag }}
    ./jmsctl.sh start

    2. 其它一些管理命令
    ./jmsctl.sh stop
    ./jmsctl.sh restart
    ./jmsctl.sh backup
    ./jmsctl.sh upgrade
    更多还有一些命令, 你可以 ./jmsctl.sh --help 来了解

    3. Web 访问
    http://192.168.100.212:80
    默认用户: admin  默认密码: admin

    4. SSH/SFTP 访问
    ssh -p2222 admin@192.168.100.212
    sftp -P2222 admin@192.168.100.212

    5. 更多信息
    我们的官网: https://www.jumpserver.org/
    我们的文档: https://docs.jumpserver.org/
    ```
    ```sh
    docker exec -it jms_mysql /bin/bash
    # 如果变量 $MARIADB_ROOT_PASSWORD 不存在,请使用 $MYSQL_ROOT_PASSWORD
    mysql -uroot -p$MARIADB_ROOT_PASSWORD
    ```
    ```mysql
    drop database jumpserver;
    create database jumpserver default charset 'utf8';
    exit
    exit
    ```
    ```sh
    # /opt/jumpserver.sql 为旧版本数据库
    ./jmsctl.sh restore_db /opt/jumpserver.sql
    ```
    ```nginx
    开始还原数据库: /opt/jumpserver.sql
    mysql: [Warning] Using a password on the command line interface can be insecure.
    数据库恢复成功!
    ```
    ```sh
    ./jmsctl.sh start
    ```

=== "使用新的外置数据库"
    ```sh
    # 登录外置数据库操作
    mysql -h192.168.100.11 -P3306 -ujumpserver -pweakPassword
    ```
    ```mysql
    create database jumpserver default charset 'utf8';
    create user 'jumpserver'@'%' identified by 'weakPassword';
    grant all on jumpserver.* to 'jumpserver'@'%';
    flush privileges;
    exit
    ```
    ```sh
    ./jmsctl.sh install
    ```
    ```nginx hl_lines="31 48 57 61-66 70-73 77"

           ██╗██╗   ██╗███╗   ███╗██████╗ ███████╗███████╗██████╗ ██╗   ██╗███████╗██████╗
           ██║██║   ██║████╗ ████║██╔══██╗██╔════╝██╔════╝██╔══██╗██║   ██║██╔════╝██╔══██╗
           ██║██║   ██║██╔████╔██║██████╔╝███████╗█████╗  ██████╔╝██║   ██║█████╗  ██████╔╝
      ██   ██║██║   ██║██║╚██╔╝██║██╔═══╝ ╚════██║██╔══╝  ██╔══██╗╚██╗ ██╔╝██╔══╝  ██╔══██╗
      ╚█████╔╝╚██████╔╝██║ ╚═╝ ██║██║     ███████║███████╗██║  ██║ ╚████╔╝ ███████╗██║  ██║
       ╚════╝  ╚═════╝ ╚═╝     ╚═╝╚═╝     ╚══════╝╚══════╝╚═╝  ╚═╝  ╚═══╝  ╚══════╝╚═╝  ╚═╝

                                                                         Version:  {{ jumpserver.tag }}


    1. 检查配置文件
    配置文件位置: /opt/jumpserver/config
    /opt/jumpserver/config/config.txt  [ √ ]
    /opt/jumpserver/config/nginx/lb_rdp_server.conf  [ √ ]
    /opt/jumpserver/config/nginx/lb_ssh_server.conf  [ √ ]
    /opt/jumpserver/config/nginx/cert/server.crt  [ √ ]
    /opt/jumpserver/config/nginx/cert/server.key  [ √ ]
    完成

    2. 备份配置文件
    备份至 /opt/jumpserver/config/backup/config.txt.2021-07-15_22-26-13
    完成

    >>> 安装配置 Docker
    1. 安装 Docker
    开始下载 Docker 程序 ...
    开始下载 Docker Compose 程序 ...
    完成

    2. 配置 Docker
    是否需要自定义 docker 存储目录, 默认将使用目录 /var/lib/docker? (y/n)  (默认为 n): n
    完成

    3. 启动 Docker
    Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /etc/systemd/system/docker.service.
    完成

    >>> 加载 Docker 镜像
    Docker: Pulling from jumpserver/core:{{ jumpserver.tag }}       [ OK ]
    Docker: Pulling from jumpserver/koko:{{ jumpserver.tag }}       [ OK ]
    Docker: Pulling from jumpserver/web:{{ jumpserver.tag }}        [ OK ]
    Docker: Pulling from jumpserver/redis:6-alpine      [ OK ]
    Docker: Pulling from jumpserver/mysql:5             [ OK ]
    Docker: Pulling from jumpserver/lion:{{ jumpserver.tag }}       [ OK ]

    >>> 安装配置 JumpServer
    1. 配置网络
    是否需要支持 IPv6? (y/n)  (默认为 n): n
    完成

    2. 配置加密密钥
    SECRETE_KEY:     YTE2YTVkMTMtMGE3MS00YzI5LWFlOWEtMTc2OWJlMmIyMDE2
    BOOTSTRAP_TOKEN: YTE2YTVkMTMtMGE3
    完成

    3. 配置持久化目录
    是否需要自定义持久化存储, 默认将使用目录 /opt/jumpserver? (y/n)  (默认为 n): n
    完成

    4. 配置 MySQL
    是否使用外部 MySQL? (y/n)  (默认为 n): y
    请输入 MySQL 的主机地址 (无默认值): 192.168.100.11
    请输入 MySQL 的端口 (默认为 3306): 3306
    请输入 MySQL 的数据库 (默认为 jumpserver): jumpserver
    请输入 MySQL 的用户名 (无默认值): jumpserver
    请输入 MySQL 的密码 (无默认值): weakPassword
    完成

    5. 配置 Redis
    是否使用外部 Redis? (y/n)  (默认为 n): y
    请输入 Redis 的主机地址 (无默认值): 192.168.100.11
    请输入 Redis 的端口 (默认为 6379): 6379
    请输入 Redis 的密码 (无默认值): weakPassword
    完成

    6. 配置对外端口
    是否需要配置 JumpServer 对外访问端口? (y/n)  (默认为 n): n
    完成

    7. 初始化数据库
    Creating network "jms_net" with driver "bridge"
    Creating jms_redis ... done
    2021-07-15 22:39:52 Collect static files
    2021-07-15 22:39:52 Collect static files done
    2021-07-15 22:39:52 Check database structure change ...
    2021-07-15 22:39:52 Migrate model change to database ...

    475 static files copied to '/opt/jumpserver/data/static'.
    Operations to perform:
      Apply all migrations: acls, admin, applications, assets, audits, auth, authentication, captcha, common, contenttypes, django_cas_ng, django_celery_beat, jms_oidc_rp, notifications, ops, orgs, perms, sessions, settings, terminal, tickets, users
    Running migrations:
      Applying contenttypes.0001_initial... OK
      Applying contenttypes.0002_remove_content_type_name... OK
      Applying auth.0001_initial... OK
      Applying auth.0002_alter_permission_name_max_length... OK
      Applying auth.0003_alter_user_email_max_length... OK
      Applying auth.0004_alter_user_username_opts... OK
      Applying auth.0005_alter_user_last_login_null... OK
      Applying auth.0006_require_contenttypes_0002... OK
      Applying auth.0007_alter_validators_add_error_messages... OK
      Applying auth.0008_alter_user_username_max_length... OK
      ...
      Applying sessions.0001_initial... OK
      Applying terminal.0032_auto_20210302_1853... OK
      Applying terminal.0033_auto_20210324_1008... OK
      Applying terminal.0034_auto_20210406_1434... OK
      Applying terminal.0035_auto_20210517_1448... OK
      Applying terminal.0036_auto_20210604_1124... OK
      Applying terminal.0037_auto_20210623_1748... OK
      Applying tickets.0008_auto_20210311_1113... OK
      Applying tickets.0009_auto_20210426_1720... OK

    >>> 安装完成了
    1. 可以使用如下命令启动, 然后访问
    cd /root/jumpserver-installer-{{ jumpserver.tag }}
    ./jmsctl.sh start

    2. 其它一些管理命令
    ./jmsctl.sh stop
    ./jmsctl.sh restart
    ./jmsctl.sh backup
    ./jmsctl.sh upgrade
    更多还有一些命令, 你可以 ./jmsctl.sh --help 来了解

    3. Web 访问
    http://192.168.100.212:80
    默认用户: admin  默认密码: admin

    4. SSH/SFTP 访问
    ssh -p2222 admin@192.168.100.212
    sftp -P2222 admin@192.168.100.212

    5. 更多信息
    我们的官网: https://www.jumpserver.org/
    我们的文档: https://docs.jumpserver.org/
    ```
    ```sh
    ./jmsctl.sh start
    ```
    ```nginx
    Creating network "jms_net" with driver "bridge"
    Creating jms_core      ... done
    Creating jms_celery    ... done
    Creating jms_koko      ... done
    Creating jms_magnus    ... done
    Creating jms_web       ... done
    ```

=== "使用旧的外置数据库"
    ```sh
    # 如果之前使用的数据库符合版本要求, 可以直接使用 (注意备份)
    ./jmsctl.sh install
    ```
    ```nginx hl_lines="31 48 57 61-66 70-73 77"

           ██╗██╗   ██╗███╗   ███╗██████╗ ███████╗███████╗██████╗ ██╗   ██╗███████╗██████╗
           ██║██║   ██║████╗ ████║██╔══██╗██╔════╝██╔════╝██╔══██╗██║   ██║██╔════╝██╔══██╗
           ██║██║   ██║██╔████╔██║██████╔╝███████╗█████╗  ██████╔╝██║   ██║█████╗  ██████╔╝
      ██   ██║██║   ██║██║╚██╔╝██║██╔═══╝ ╚════██║██╔══╝  ██╔══██╗╚██╗ ██╔╝██╔══╝  ██╔══██╗
      ╚█████╔╝╚██████╔╝██║ ╚═╝ ██║██║     ███████║███████╗██║  ██║ ╚████╔╝ ███████╗██║  ██║
       ╚════╝  ╚═════╝ ╚═╝     ╚═╝╚═╝     ╚══════╝╚══════╝╚═╝  ╚═╝  ╚═══╝  ╚══════╝╚═╝  ╚═╝

                                                                         Version:  {{ jumpserver.tag }}


    1. 检查配置文件
    配置文件位置: /opt/jumpserver/config
    /opt/jumpserver/config/config.txt  [ √ ]
    /opt/jumpserver/config/nginx/lb_rdp_server.conf  [ √ ]
    /opt/jumpserver/config/nginx/lb_ssh_server.conf  [ √ ]
    /opt/jumpserver/config/nginx/cert/server.crt  [ √ ]
    /opt/jumpserver/config/nginx/cert/server.key  [ √ ]
    完成

    2. 备份配置文件
    备份至 /opt/jumpserver/config/backup/config.txt.2021-07-15_22-26-13
    完成

    >>> 安装配置 Docker
    1. 安装 Docker
    开始下载 Docker 程序 ...
    开始下载 Docker Compose 程序 ...
    完成

    2. 配置 Docker
    是否需要自定义 docker 存储目录, 默认将使用目录 /var/lib/docker? (y/n)  (默认为 n): n
    完成

    3. 启动 Docker
    Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /etc/systemd/system/docker.service.
    完成

    >>> 加载 Docker 镜像
    Docker: Pulling from jumpserver/core:{{ jumpserver.tag }}       [ OK ]
    Docker: Pulling from jumpserver/koko:{{ jumpserver.tag }}       [ OK ]
    Docker: Pulling from jumpserver/web:{{ jumpserver.tag }}        [ OK ]
    Docker: Pulling from jumpserver/redis:6-alpine      [ OK ]
    Docker: Pulling from jumpserver/mysql:5             [ OK ]
    Docker: Pulling from jumpserver/lion:{{ jumpserver.tag }}       [ OK ]

    >>> 安装配置 JumpServer
    1. 配置网络
    是否需要支持 IPv6? (y/n)  (默认为 n): n
    完成

    2. 配置加密密钥
    SECRETE_KEY:     YTE2YTVkMTMtMGE3MS00YzI5LWFlOWEtMTc2OWJlMmIyMDE2
    BOOTSTRAP_TOKEN: YTE2YTVkMTMtMGE3
    完成

    3. 配置持久化目录
    是否需要自定义持久化存储, 默认将使用目录 /opt/jumpserver? (y/n)  (默认为 n): n
    完成

    4. 配置 MySQL
    是否使用外部 MySQL? (y/n)  (默认为 n): y
    请输入 MySQL 的主机地址 (无默认值): 192.168.100.11
    请输入 MySQL 的端口 (默认为 3306): 3306
    请输入 MySQL 的数据库 (默认为 jumpserver): jumpserver
    请输入 MySQL 的用户名 (无默认值): jumpserver
    请输入 MySQL 的密码 (无默认值): weakPassword
    完成

    5. 配置 Redis
    是否使用外部 Redis? (y/n)  (默认为 n): y
    请输入 Redis 的主机地址 (无默认值): 192.168.100.11
    请输入 Redis 的端口 (默认为 6379): 6379
    请输入 Redis 的密码 (无默认值): weakPassword
    完成

    6. 配置对外端口
    是否需要配置 JumpServer 对外访问端口? (y/n)  (默认为 n): n
    完成

    7. 初始化数据库
    Creating network "jms_net" with driver "bridge"
    Creating jms_redis ... done
    2021-07-15 22:39:52 Collect static files
    2021-07-15 22:39:52 Collect static files done
    2021-07-15 22:39:52 Check database structure change ...
    2021-07-15 22:39:52 Migrate model change to database ...

    475 static files copied to '/opt/jumpserver/data/static'.
    Operations to perform:
      Apply all migrations: acls, admin, applications, assets, audits, auth, authentication, captcha, common, contenttypes, django_cas_ng, django_celery_beat, jms_oidc_rp, notifications, ops, orgs, perms, sessions, settings, terminal, tickets, users
    Running migrations:
      Applying contenttypes.0001_initial... OK
      Applying contenttypes.0002_remove_content_type_name... OK
      Applying auth.0001_initial... OK
      Applying auth.0002_alter_permission_name_max_length... OK
      Applying auth.0003_alter_user_email_max_length... OK
      Applying auth.0004_alter_user_username_opts... OK
      Applying auth.0005_alter_user_last_login_null... OK
      Applying auth.0006_require_contenttypes_0002... OK
      Applying auth.0007_alter_validators_add_error_messages... OK
      Applying auth.0008_alter_user_username_max_length... OK
      ...
      Applying sessions.0001_initial... OK
      Applying terminal.0032_auto_20210302_1853... OK
      Applying terminal.0033_auto_20210324_1008... OK
      Applying terminal.0034_auto_20210406_1434... OK
      Applying terminal.0035_auto_20210517_1448... OK
      Applying terminal.0036_auto_20210604_1124... OK
      Applying terminal.0037_auto_20210623_1748... OK
      Applying tickets.0008_auto_20210311_1113... OK
      Applying tickets.0009_auto_20210426_1720... OK

    >>> 安装完成了
    1. 可以使用如下命令启动, 然后访问
    cd /root/jumpserver-installer-{{ jumpserver.tag }}
    ./jmsctl.sh start

    2. 其它一些管理命令
    ./jmsctl.sh stop
    ./jmsctl.sh restart
    ./jmsctl.sh backup
    ./jmsctl.sh upgrade
    更多还有一些命令, 你可以 ./jmsctl.sh --help 来了解

    3. Web 访问
    http://192.168.100.212:80
    默认用户: admin  默认密码: admin

    4. SSH/SFTP 访问
    ssh -p2222 admin@192.168.100.212
    sftp -P2222 admin@192.168.100.212

    5. 更多信息
    我们的官网: https://www.jumpserver.org/
    我们的文档: https://docs.jumpserver.org/
    ```
    ```sh
    ./jmsctl.sh start
    ```
    ```nginx
    Creating network "jms_net" with driver "bridge"
    Creating jms_core      ... done
    Creating jms_celery    ... done
    Creating jms_koko      ... done
    Creating jms_magnus    ... done
    Creating jms_web       ... done
    ```

📄 network_port.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/network_port.md

网络端口说明

1 网络端口列表

!!! tip "" - JumpServer 作为符合 4A 规范的专业运维安全审计系统,其正常运行需要开放如下网络端口,管理员可根据实际环境中 JumpServer 组件部署的方案,在网络和主机侧开放相关端口。

端口 作用 说明
22 SSH 安装、升级及管理使用
80 Web HTTP 服务 通过 HTTP 协议访问 JumpServer 前端页面
443 Web HTTPS 服务 通过 HTTPS 协议访问 JumpServer 前端页面
3306 数据库服务 MySQL 服务使用
6379 数据库服务 Redis 服务使用
3389 Razor 服务端口 RDP Client 方式连接 Windows 资产
2222 SSH Client SSH Client 方式使用终端工具连接 JumpServer,比如 Xshell、PuTTY、MobaXterm 等终端工具
33061 Magnus MySQL 服务端口 DB Client 方式连接 MySQL 数据库资产
33062 Magnus MariaDB 服务端口 DB Client 方式连接 MariaDB 数据库资产
54320 Magnus PostgreSQL 服务端口 DB Client 方式连接 PostgreSQL 数据库资产
63790 Magnus Redis 服务端口 DB Client 方式连接 Redis 数据库资产
30000-30100 Magnus Oracle 服务端口 DB Client 方式连接 Oracle 数据库资产,该端口范围可自定义

2 防火墙常用命令

!!! tip "" - 确认 firewall 的状态为 running sh firewall-cmd --state sh running

!!! tip "" - 临时开放端口(规则立即生效,重启失效) sh firewall-cmd --zone=public --add-port=80/tcp firewall-cmd --zone=public --add-port=2222/tcp firewall-cmd --add-rich-rule="rule family="ipv4" source address="172.17.0.1/16" port protocol="tcp" port="8080" accept"

!!! tip "" - 临时删除端口(规则立即生效,重启失效) sh firewall-cmd --zone=public --remove-port=80/tcp firewall-cmd --zone=public --remove-port=2222/tcp firewall-cmd --remove-rich-rule="rule family="ipv4" source address="172.17.0.1/16" port protocol="tcp" port="8080" accept"

!!! tip "" - 永久放行端口(需要 reload 才能生效) sh firewall-cmd --zone=public --add-port=80/tcp --permanent firewall-cmd --zone=public --add-port=2222/tcp --permanent firewall-cmd --add-rich-rule="rule family="ipv4" source address="172.17.0.1/16" port protocol="tcp" port="8080" accept" --permanent firewall-cmd --reload

!!! tip "" - 永久删除端口(需要 reload 才能生效) sh firewall-cmd --zone=public --remove-port=80/tcp --permanent firewall-cmd --zone=public --remove-port=2222/tcp --permanent firewall-cmd --remove-rich-rule="rule family="ipv4" source address="172.17.0.1/16" port protocol="tcp" port="8080" accept" --permanent firewall-cmd --reload

!!! tip "" - 查看端口生效规则 sh firewall-cmd --list-all sh public (active) target: default icmp-block-inversion: no interfaces: ens32 sources: services: dhcpv6-client ssh ports: 80/tcp 2222/tcp protocols: masquerade: no forward-ports: source-ports: icmp-blocks: rich rules: rule family="ipv4" source address="172.17.0.1/16" port port="8080" protocol="tcp" accept

📄 1.0.0-1.4.3.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/previous_version_upgrade/1.0.0-1.4.3.md

1.0.0-1.4.3 升级到 1.4.4

!!! warning "注意" - 升级及迁移请保持 SECRET_KEY 与旧版本一致,否则会导致数据库加密数据无法解密。 - 更新前请一定要做好备份 数据库 和 JumpServer 源代码的工作。

1 备份数据库

!!! tip "" sh cp -r /opt/jumpserver /opt/jumpserver_bak mysqldump -uroot -p jumpserver > /opt/jumpserver.sql

2 升级步骤

!!! warning "注意,请务必认真详细阅读每一个文字并理解后才能操作升级事宜。" - 请先检查自己各组件的当前版本。 - 不支持从 0.x 版本升级到 1.x 版本。 - 本文档仅针对 1.0.x - 1.4.3 的版本升级教程。 - 从 1.4.x 版本开始,mysql 版本需要大于等于 5.7 - 更新配置文件需要把对应旧版本的设置复制到新的配置文件。

2.1 停止 core

!!! tip "" sh cd /opt/jumpserver source /opt/py3/bin/activate ./jms stop

!!! tip "" - 自行替换 /opt 为你实际安装目录。

2.2 切换 1.4.4 分支

!!! tip "" sh git fetch git checkout 1.4.4

??? question "如果执行 git pull 提示 error,请按照提示自行处理" - 提示 error: Your local changes to the following file would be overwritten by merge

```sh
git reset --hard
git pull
```

??? tip "如果你的代码不是从 github 仓库获取的,请通过这里的隐藏帮助来进行迁移" 1. 备份数据库 sh mysqldump -uroot -p jumpserver --ignore-table=jumpserver.django_migrations > /opt/jumpserver.sql 2. 下载代码 sh mv /opt/jumpserver /opt/jumpserver_bak cd /opt git clone https://github.com/jumpserver/jumpserver.git cd jumpserver git checkout 1.4.4 3. 还原文件 sh cd /opt/jumpserver_bak for d in $(ls);do if [ -d $d ] && [ -d $d/migrations ];then cp ${d}/migrations/*.py /opt/jumpserver/apps/${d}/migrations/ fi done

2.3 更新依赖

!!! tip "" sh cd /opt/jumpserver pip install -r requirements/requirements.txt

??? question "确保已经载入 py3 虚拟环境,中间如果遇到报错一般是依赖包没装全,可以通过 搜索引擎 解决" - 国内可以使用镜像加速。

```sh
pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
```

2.4 处理升级

!!! tip "" sh cd utils sh make_migrations.sh

??? question "如果执行 sh make_migrations.sh 有错误,请参考此处进行处理" - You have an error in your SQL syntax; check the manual than corresponds to your MySql server version for the right syntax to use near '(6) NOT NULL'

```vim
# 这是因为你的数据库版本不对,从 1.4.x 版本开始 mysql 版本需要大于等于 5.7
# 请升级数据库后重新操作
```

!!! warning "注意" - 升级前版本小于 1.1.0 需要执行此步骤。

```sh
sh 2018_04_11_migrate_permissions.sh
```

!!! warning "注意" - 升级前版本小于 1.4.0 需要执行此步骤。

```sh
sh 2018_07_15_set_win_protocol_to_ssh.sh
```

2.5 启动 core

!!! tip "" sh cd /opt/jumpserver ./jms start

!!! tip "" - 确定启动没有错误。

!!! tip "" - 请接着根据 1.4.4 升级到 1.4.5 的文档升级到1.4.5,否则无法正常使用

📄 1.4.4.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/previous_version_upgrade/1.4.4.md

1.4.4 版本升级到 1.4.5

!!! warning "注意" - 升级及迁移请保持 SECRET_KEY 与旧版本一致,否则会导致数据库加密数据无法解密。 - 更新前请一定要做好备份 数据库 和 JumpServer 源代码的工作。

1 备份数据库

!!! tip "" sh cp -r /opt/jumpserver /opt/jumpserver_1.4.4_bak mysqldump -uroot -p jumpserver > /opt/jumpserver_1.4.4.sql

2 升级步骤

!!! warning "注意,请务必认真详细阅读每一个文字并理解后才能操作升级事宜" - 请先检查自己各组件的当前版本。 - 本文档仅适合 1.4.4 的版本升级教程。 - 从 1.4.x 版本开始,mysql 版本需要大于等于 5.7 - 更新配置文件需要把对应旧版本的设置复制到新的配置文件。

2.1 停止 core

!!! tip "" sh cd /opt/jumpserver source /opt/py3/bin/activate ./jms stop

!!! tip "" - 自行替换 /opt 为你实际安装目录。

2.2 更新代码

!!! tip "" sh cd /opt/jumpserver git fetch git checkout 1.4.5 git pull

??? question "如果执行 git pull 提示 error,请按照提示自行处理" - 提示 error: Your local changes to the following file would be overwritten by merge

```sh
git reset --hard
git pull
```

2.3 更新依赖

!!! tip "" sh pip install -r requirements/requirements.txt

2.4 处理升级

!!! tip "" sh cd utils vi 1.4.4_to_1.4.5_migrations.sh ```vim #!/bin/bash #

# 修改数据库信息为你使用的 jumpserver 数据库, 可从 config.py 或 config.yml 里面查询

host=127.0.0.1    # 修改为你使用的数据库
port=3306
username=root     # 账号
db=jumpserver     # 数据库名称

echo "备份原来的 migrations"
mysqldump -u${username} -h${host} -P${port} -p ${db} django_migrations > django_migrations.sql.bak
ret=$?

if [ ${ret} == "0" ];then
    echo "开始使用新的migrations文件"
    mysql -u${username} -h${host} -P${port} -p ${db} < django_migrations.sql
else
    echo "Not valid"
fi
```
```sh
sh 1.4.4_to_1.4.5_migrations.sh
```

2.5 启动 core

!!! tip "" sh cd /opt/jumpserver ./jms start

!!! tip "" - 确定启动没有错误。

!!! tip "" - 请接着根据 升级文档 升级到最新版本,否则无法正常使用。

📄 mariadb-mysql.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/previous_version_upgrade/mariadb-mysql.md

数据库迁移

!!! warning "注意" - 迁移前请一定要做好备份。 - 从 v2.5 开始,要求 MySQL >= 5.7 - 推荐使用外置 数据库,方便日后扩展升级。

1 数据库要求

!!! tip "" - 针对 MySQL/MariaDB 和 Redis 的版本要求如下:

!!! tip "" | DB | Version | Cache | Version | | :------ | :------ | :---- | :------ | | MySQL | >= 5.7 | Redis | >= 6.0 | | MariaDB | >= 10.6 | - | - |

2 操作过程

!!! tip "备份数据库" === "手动部署" sh cd /opt/koko ./koko -s stop # 更老的版本使用的 coco # cd /opt/coco # ./cocod stop sh /etc/init.d/guacd stop sh /config/tomcat9/bin/shutdown.sh sh cd /opt/jumpserver source /opt/py3/bin/activate ./jms stop sh cd /opt mv /opt/jumpserver /opt/jumpserver_bak sh mysqldump -h127.0.0.1 -P3306 -ujumpserver -p jumpserver > /opt/jumpserver.sql

=== "组件容器化"
    ```sh
    docker stop jms_koko jms_lion     
    docker rm jms_koko jms_lion     
    # 更老的版本使用的 coco
    # docker stop jms_coco
    # docker rm jms_coco
    ```
    ```sh
    cd /opt/jumpserver
    source /opt/py3/bin/activate
    ./jms stop
    ```
    ```sh
    cd /opt
    mv /opt/jumpserver /opt/jumpserver_bak
    ```
    ```sh
    mysqldump -h127.0.0.1 -P3306 -ujumpserver -p jumpserver > /opt/jumpserver.sql
    ```

=== "setuptools"
    ```sh
    cd /opt/setuptools
    ./jmsctl.sh stop
    docker rm jms_koko jms_lion     
    systemctl disable jms_core
    mv /opt/jumpserver /opt/jumpserver_bak
    ```
    ```sh
    mysqldump -h127.0.0.1 -P3306 -ujumpserver -p jumpserver > /opt/jumpserver.sql
    ```

=== "docker 部署"
    ```sh
    docker cp jms_all:/opt/jumpserver /opt/jumpserver_bak
    docker exec -it jms_all env | egrep "SECRET_KEY|BOOTSTRAP_TOKEN"
    ```
    ```sh
    docker exec -it jms_all /bin/bash
    mysqldump -h$DB_HOST -P$DB_PORT -u$DB_USER -p$DB_PASSWORD $DB_NAME > /opt/jumpserver.sql
    exit
    ```
    ```sh
    docker cp jms_all:/opt/jumpserver.sql /opt
    docker stop jms_all
    ```

=== "docker-compose"
    ```sh
    docker cp jms_core:/opt/jumpserver /opt/jumpserver_bak
    docker exec -it jms_core env | egrep "SECRET_KEY|BOOTSTRAP_TOKEN"
    ```
    ```sh
    docker exec -it jms_mysql /bin/bash
    mysqldump -uroot jumpserver > /opt/jumpserver.sql
    exit
    ```
    ```sh
    docker cp jms_mysql:/opt/jumpserver.sql /opt
    cd /opt/Dockerfile
    docker-compose stop
    ```
=== "jumpserver-installer"
    ```sh
    cd /opt/jumpserver-installer-{{ jumpserver.tag }}
    ./jmsctl.sh stop
    ```
    ```sh
    ./jmsctl.sh backup_db

    # 如果是 gz 格式的需要先解压: gunzip /opt/jumpserver/db_backup/jumpserver-2021-01-22_19:28:24.sql.gz
    mv /opt/jumpserver/db_backup/jumpserver-2021-01-22_19:28:24.sql /opt/jumpserver.sql
    ```

!!! tip "修改数据库字符集" sh if grep -q 'COLLATE=utf8_bin' /opt/jumpserver.sql; then cp /opt/jumpserver.sql /opt/jumpserver_bak.sql sed -i 's@COLLATE=utf8_bin@@g' /opt/jumpserver.sql sed -i 's@COLLATE utf8_bin@@g' /opt/jumpserver.sql else echo "备份数据库字符集正确"; fi

!!! tip "迁移到新服务器" - 将导出的 /opt/jumpserver.sql 拷贝要新的服务器上面。 - 下面以迁移到其他 CentOS7 服务器为例,实际操作过程中请自行替换对应的命令。

=== "迁移到 MariaDB 10.6"
    ```sh
    vi /etc/yum.repos.d/MariaDB.repo
    ```
    ```vim
    [mariadb]
    name = MariaDB
    baseurl = http://mirrors.ustc.edu.cn/mariadb/yum/10.6/centos7-amd64
    gpgkey=http://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB
    gpgcheck=1
    ```
    ```sh
    yum clean all
    ```
    ```sh
    yum -y install MariaDB-server
    systemctl enable mariadb
    systemctl start mariadb
    ```
    ```sh
    mysql -uroot
    ```
    ```mysql
    create database jumpserver default charset 'utf8';
    create user 'jumpserver'@'%' identified by 'rBi41SrDqlX4zsx9e1L0cqTP';
    grant all on jumpserver.* to 'jumpserver'@'%';
    flush privileges;
    use jumpserver;
    source /opt/jumpserver.sql;
    exit;
    mysql_upgrade -uroot
    ```

=== "迁移到 MySQL 5.7"
    ```sh
    yum -y localinstall http://mirrors.ustc.edu.cn/mysql-repo/mysql57-community-release-el7.rpm
    yum -y install mysql-community-server mysql-community-devel
    ```
    ```sh
    sed -i "s@--initialize @--initialize-insecure @g" /usr/bin/mysqld_pre_systemd
    systemctl enable mysqld
    systemctl start mysqld
    ```
    ```sh
    mysql -uroot
    ```
    ```mysql
    create database jumpserver default charset 'utf8';
    set global validate_password_policy=LOW;
    create user 'jumpserver'@'%' identified by 'rBi41SrDqlX4zsx9e1L0cqTP';
    grant all on jumpserver.* to 'jumpserver'@'%';
    flush privileges;
    use jumpserver;
    source /opt/jumpserver.sql;
    exit;
    mysql_upgrade -uroot
    ```

=== "迁移到 MySQL 8.0"
    ```bash
    yum -y localinstall http://mirrors.ustc.edu.cn/mysql-repo/mysql80-community-release-el7.rpm
    yum -y install mysql-community-server mysql-community-devel
    ```
    ```sh
    if ! grep -q "sql_mode=" /etc/my.cnf; then
      echo "sql_mode=''" >> /etc/my.cnf
    fi
    ```
    ```sh
    sed -i "s@--initialize @--initialize-insecure @g" /usr/bin/mysqld_pre_systemd
    systemctl enable mysqld
    systemctl start mysqld
    ```
    ```sh
    mysql -uroot
    ```
    ```mysql
    create database jumpserver default charset 'utf8';
    set global validate_password.policy=LOW;
    create user 'jumpserver'@'%' identified with mysql_native_password by 'rBi41SrDqlX4zsx9e1L0cqTP';
    grant all on jumpserver.* to 'jumpserver'@'%';
    flush privileges;
    use jumpserver;
    source /opt/jumpserver.sql;
    exit;
    ```

=== "迁移到 Docker 容器"
    ```sh
    vi /opt/jumpserver/config/config.txt
    ```
    ```vim
    ## MySQL数据库配置
    DB_ENGINE=mysql
    DB_HOST=mysql
    DB_PORT=3306
    DB_USER=root
    DB_PASSWORD=rBi41SrDqlX4zsx9e1L0cqTP
    DB_NAME=jumpserver
    ```
    ```sh
    cd /opt/jumpserver-installerer-{{ jumpserver.tag }}
    ./jmsctl.sh start
    ```
    ```sh
    ./jmsctl.sh stop
    ```
    ```sh
    docker exec -it jms_mysql /bin/bash
    # 如果变量 $MARIADB_ROOT_PASSWORD 不存在,请使用 $MYSQL_ROOT_PASSWORD
    mysql -uroot -p$MARIADB_ROOT_PASSWORD
    ```
    ```mysql
    drop database jumpserver;
    create database jumpserver default charset 'utf8';
    exit
    exit
    ```
    ```sh
    ./jmsctl.sh restore_db /opt/jumpserver.sql
    ```

- 启动 jms_core 看 jumpserver.log 是否有报错。

!!! question "启动报错 Cannot add foreign key constraint" sh if grep -q 'COLLATE=utf8_bin' /opt/jumpserver.sql; then cp /opt/jumpserver.sql /opt/jumpserver_bak.sql sed -i 's@COLLATE=utf8_bin@@g' /opt/jumpserver.sql sed -i 's@COLLATE utf8_bin@@g' /opt/jumpserver.sql else echo "备份数据库字符集正确"; fi sh drop database jumpserver; create database jumpserver default charset 'utf8'; source /opt/jumpserver.sql;

📄 proxy.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/proxy.md

反向代理

!!! info "反向代理 JumpServer 要求说明" - rdp 协议复制粘贴需要部署可信任的 ssl 证书。 - 通过 https 协议访问就能在 rdp 资产里面使用复制粘贴。 - 遵循 Mozilla SSL Configuration Generator{:target="_blank"} 建议。

1 Nginx SSL 部署

!!! tip "请准备好 ssl 证书 (注意需要使用 pem 格式证书)" - 将证书放到 /opt/jumpserver/config/nginx/cert 里面。 - 修改配置文件前需要先关闭 JumpServer 服务。

!!! tip "" sh # 关闭 JumpServer 服务 ./jmsctl.sh stop sh # 编辑 JumpServer 主配置文件 vi /opt/jumpserver/config/config.txt ```vim ...

## Nginx 配置
HTTP_PORT=80
SSH_PORT=2222
RDP_PORT=3389

## HTTPS 配置
HTTPS_PORT=443               # 对外 https 端口, 默认 443
SERVER_NAME=www.domain.com   # 你的 https 域名
SSL_CERTIFICATE=xxx.pem      # /opt/jumpserver/config/nginx/cert 目录下你的证书文件
SSL_CERTIFICATE_KEY=xxx.key  # /opt/jumpserver/config/nginx/cert 目录下你的 key 文件
```
```sh
# 启动 JumpServer 服务
./jmsctl.sh start
```

??? warning "如果需要自定义 Nginx 配置文件, 可以参考此处" sh vi /opt/jumpserver/config/nginx/lb_http_server.conf ```nginx hl_lines="10 16 18-19 25 29" # Todo: May be can auto discovery upstream http_server { sticky name=jms_route; server web:80; # server HOST2:80; # 多节点 }

server {
  listen 80;
  server_name demo.jumpserver.org;  # 自行修改成你自己的域名
  return 301 https://$server_name$request_uri;
}

server {
  listen 443 ssl http2;
  server_name demo.jumpserver.org;      # 自行修改成你自己的域名
  server_tokens off;
  ssl_certificate cert/server.crt;      # 修改 server.crt 为你的证书 (pem, crt 格式均可), 不要改路径 certs/
  ssl_certificate_key cert/server.key;  # 修改 server.crt 为你的证书密钥文件, 不要改路径 certs/
  ssl_session_timeout 1d;
  ssl_session_cache shared:MozSSL:10m;
  ssl_session_tickets off;
  ssl_protocols TLSv1.1 TLSv1.2;

  ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
  ssl_prefer_server_ciphers off;
  add_header Strict-Transport-Security "max-age=63072000" always;

  client_max_body_size 5000m;  # 上传文件大小限制

  location / {
    proxy_pass http://http_server;
    proxy_buffering off;
    proxy_request_buffering off;
    proxy_http_version 1.1;
    proxy_set_header Host $host;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $http_connection;
    proxy_set_header X-Forwarded-For $remote_addr;

    proxy_ignore_client_abort on;
    proxy_connect_timeout 600;
    proxy_send_timeout 600;
    proxy_read_timeout 600;
    send_timeout 6000;
  }
}
```

2 多层 Nginx 反向代理

!!! tip "提示" - 适合上层还有统一对外出口的反向代理服务器 - 属于多层 nginx 反向代理 - 每一层都需要设置 websocket 长连接

!!! tip "" sh # 编辑配置文件 vi /etc/nginx/conf.d/jumpserver.conf ```vim hl_lines="4 6 10" server {

    listen 80;
    server_name demo.jumpserver.org;  # 自行修改成你的域名

    client_max_body_size 4096m;  # 上传文件大小限制

    location / {
            # 这里的 ip 是后端 JumpServer nginx 的 ip
            proxy_pass http://192.168.244.144;
            proxy_http_version 1.1;
            proxy_buffering off;
            proxy_request_buffering off;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-For $remote_addr;
    }
}
```

!!! tip "推荐部署 ssl 使用更安全的 https 协议访问" - 遵循 Mozilla SSL Configuration Generator 建议。

```vim hl_lines="3 8-10 13 18 21"
server {
    listen 80;
    server_name demo.jumpserver.org;  # 自行修改成你的域名
    return 301 https://$server_name$request_uri;
}
server {
    listen 443 ssl http2;
    server_name          demo.jumpserver.org;  # 自行修改成你的域名
    ssl_certificate      sslkey/1_jumpserver.org_bundle.crt;  # 自行设置证书
    ssl_certificate_key  sslkey/2_jumpserver.org_bundle.key;  # 自行设置证书
    ssl_session_timeout 1d;
    ssl_session_cache shared:MozSSL:10m;
    ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
    ssl_prefer_server_ciphers off;
    ssl_protocols TLSv1.1 TLSv1.2;
    add_header Strict-Transport-Security "max-age=63072000" always;

    client_max_body_size 4096m;  # 录像及文件上传大小限制
    location / {
        # 这里的 ip 是后端 JumpServer nginx 的 ip
        proxy_pass http://192.168.244.144;
        proxy_http_version 1.1;
        proxy_buffering off;
        proxy_request_buffering off;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $remote_addr;
    }
}
```

!!! warning "" - 二级代理可以参考 (https://github.com/jumpserver/docs/pull/213/files)

3 其他 SLB

!!! tip "提示" - 需要注意 websocket 长连接设置即可。 - 需要注意 session 问题。

📄 mysql_ssl.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/security_setup/mysql_ssl.md

数据库 SSL 连接

1 操作过程

1.1 准备数据库 CA 文件

!!! tip "" - 准备好数据库 CA 文件, 当前不支持私钥认证。

```bash
mkdir -p /opt/jumpserver/config/certs
cp db_ca.pem /opt/jumpserver/config/certs/db_ca.pem
```

- 测试 MySQL 连接无误。

```bash
# . /opt/jumpserver/config/config.txt
# mysql --ssl-ca=/opt/jumpserver/config/certs/db_ca.pem -h$DB_HOST -P$DB_PORT -U$DB_USER -p$DB_PASSWORD $DB_NAME
```

1.2 编辑配置文件

!!! tip "" - 打开配置文件。

```bash
vi /opt/jumpserver/config/config.txt
```

- 在配置文件配置使用 DB SSL。

```vim
DB_USE_SSL=True
```

1.3 重启 JumpServer 服务

!!! tip "" bash cd /opt/jumpserver-installer-{{ jumpserver.tag }} ./jmsctl.sh down ./jmsctl.sh start

!!! warning "其他方式部署的 JumpServer 请将数据库证书 db_ca.pem 放到 /opt/jumpserver/data/certs 后重启即可"

📄 redis_ssl.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/security_setup/redis_ssl.md

Redis SSL 连接

1 操作过程

1.1 准备数据库 CA 文件

=== "方式一" !!! tip "" - 准备好 Redis ca 文件 (云服务商一般只提供 ca 文件)

    ```bash
    mkdir -p /opt/jumpserver/config/certs/certs
    cp redis_ca.crt /opt/jumpserver/config/certs/redis_ca.crt
    ```

    - 测试 redis 连接无误。

    ```bash
    # . /opt/jumpserver/config/config.txt
    # redis-cli --tls --cacert /opt/jumpserver/config/certs/redis_ca.crt -h $REDIS_HOST -p $REDIS_PORT -a $REDIS_PASSWORD info
    ```

=== "方式二" !!! tip "" - 准备好 Redis ca 文件、私钥和证书 (自签证书)

    ```bash
    mkdir -p /opt/jumpserver/config/certs
    cp redis_ca.crt /opt/jumpserver/config/certs/redis_ca.crt
    cp redis_client.crt /opt/jumpserver/config/certs/redis_client.crt
    cp redis_client.key /opt/jumpserver/config/certs/redis_client.key
    ```

    - 测试 redis 连接无误。

    ```bash
    # . /opt/jumpserver/config/config.txt
    # redis-cli --tls --cacert /opt/jumpserver/config/certs/redis_ca.crt --cert /opt/jumpserver/config/certs/redis_client.crt --key /opt/jumpserver/config/certs/redis_client.key -h $REDIS_HOST -p $REDIS_PORT -a $REDIS_PASSWORD info
    ```

1.2 编辑配置文件

!!! tip "" - 打开配置文件。

```bash
vi /opt/jumpserver/config/config.txt

```

- 在配置文件配置使用 Redis SSL。

```vim
REDIS_USE_SSL=True
```

1.3 重启 JumpServer 服务

!!! tip "" bash cd /opt/jumpserver-installer-{{ jumpserver.tag }} ./jmsctl.sh down ./jmsctl.sh start

!!! warning "其他方式部署的 JumpServer 请将 Redis SSL 证书放到各组件 data/certs 目录重启即可" - /opt/jumpserver/data/certs - /opt/koko/data/certs - /opt/lion/data/certs

📄 helm_online_install.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/setup_kubernetes/helm_online_install.md

在线安装

??? info "可以使用由 华为云 提供的容器镜像服务" | 区域 | 镜像仓库地址 | Kubernetes values.yaml | OS/ARCH | | :----------- | :----------------------------------- | --------------------------------------------------- | -------------- | | 华北-北京一 | swr.cn-north-1.myhuaweicloud.com | imageRegistry: swr.cn-north-1.myhuaweicloud.com | linux/amd64 | | 华南-广州 | swr.cn-south-1.myhuaweicloud.com | imageRegistry: swr.cn-south-1.myhuaweicloud.com | linux/amd64 |

1 环境要求

2 安装部署

2.1 添加 JumpServer 的 Helm 源地址

!!! tip "" sh helm repo add jumpserver https://jumpserver.github.io/helm-charts helm repo list

!!! tip "" | Name | Description | Value | | :------------------------ | :---------------------------------------------- | :---------------------- | | global.imageRegistry | Global Docker image registry | docker.io | | global.imageOwner | Global Docker image owner | jumpserver | | global.imagePullSecrets | Global Docker registry secret names as an array | [] | | global.storageClass | Global StorageClass for Persistent Volume(s) | "" | | externalDatabase.engine | External database engine | postgresql | | externalDatabase.host | External database host | localhost | | externalDatabase.port | External database port | 5432 | | externalDatabase.user | External database user | postgres | | externalDatabase.password | External database password | "" | | externalDatabase.database | External database name | jumpserver | | externalRedis.host | External Redis host | localhost | | externalRedis.port | External Redis port | 6379 | | externalRedis.password | External Redis password | "" | | ingress.enabled | Enable ingress | true | | ingress.hosts | Ingress hosts | ["test.jumpserver.org"] | | core.config.secretKey | Core secret key | "" | | core.config.bootstrapToken| Core bootstrap token | "" | | core.env.DOMAINS | CSRF_TRUSTED_ORIGINS | "test.jumpserver.org |

2.2 编辑 JumpServer values.yaml 文件

!!! tip "" sh vi values.yaml

2.3 安装 JumpServer

!!! tip "" sh helm install jms-k8s jumpserver/jumpserver -n default -f values.yaml

2.4 卸载 JumpServer

!!! tip "" sh helm uninstall jms-k8s -n default

📄 helm_online_upgrade.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/setup_kubernetes/helm_online_upgrade.md

在线升级

!!! warning "升级到 v4 前需要先升级到 v3 最新版本,否则升级将会直接失败"

!!! tip "" - 请先手动备份好数据库, 然后继续操作。 - values.yaml 从 https://github.com/jumpserver/helm-charts/blob/main/charts/jumpserver/values.yaml 获取指定版本的配置文件。 - 不想使用 values.yaml 可以使用 --set key=value 的方式传参

!!! tip "" sh helm repo update helm upgrade jms-k8s jumpserver/jumpserver -n default -f values.yaml

📄 elasticsearch_install.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/setup_linux_lb/elasticsearch_install.md

部署 Elasticsearch 服务

!!! tip "提示" - 集群部署请参考 (https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html)

1 准备工作

1.1 环境信息

!!! tip "" - Elasticsearch 服务器信息如下:

```sh 
192.168.100.51
```

2 安装配置 Docker 环境

2.1 安装 Docker

!!! tip "" sh yum install -y yum-utils device-mapper-persistent-data lvm2 yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo sed -i 's+download.docker.com+mirrors.aliyun.com/docker-ce+' /etc/yum.repos.d/docker-ce.repo yum makecache fast yum -y install docker-ce

2.2 配置 Docker

!!! tip "" sh mkdir /etc/docker/ vi /etc/docker/daemon.json json { "live-restore": true, "registry-mirrors": ["https://hub-mirror.c.163.com", "https://bmtrgdvx.mirror.aliyuncs.com", "http://f1361db2.m.daocloud.io"], "log-driver": "json-file", "log-opts": {"max-file": "3", "max-size": "10m"} }

2.3 启动 Docker

!!! tip "" sh systemctl enable docker systemctl start docker

3 安装配置 Elasticsearch

3.1 下载 Elasticsearch 镜像

!!! tip "" sh docker pull docker.elastic.co/elasticsearch/elasticsearch:7.17.6 vim 7a0437f04f83: Pull complete 7718d2f58c47: Pull complete cc5c16bd8bb9: Pull complete e3d829b4b297: Pull complete 1ad944c92c79: Pull complete 373fb8fbaf74: Pull complete 5908d3eb2989: Pull complete Digest: sha256:81c126e4eddbc5576285670cb3e23d7ef7892ee5e757d6d9ba870b6fe99f1219 Status: Downloaded newer image for docker.elastic.co/elasticsearch/elasticsearch:7.17.6 docker.elastic.co/elasticsearch/elasticsearch:7.17.6

3.2 Elasticsearch 持久化数据目录创建

!!! tip "" sh mkdir -p /opt/jumpserver/elasticsearch/data /opt/jumpserver/elasticsearch/logs

3.3 启动 Elasticsearch 服务

!!! tip "" vim ## 请自行修改账号密码并牢记,丢失后可以删掉容器后重新用新密码创建,数据不会丢失 # 9200 # Web 访问端口 # 9300 # 集群通信 # discovery.type=single-node # 单节点 # bootstrap.memory_lock="true" # 锁定物理内存, 不使用 swap # xpack.security.enabled="true" # 开启安全模块 # TAKE_FILE_OWNERSHIP="true" # 自动修改挂载文件夹的所属用户 # ES_JAVA_OPTS="-Xms512m -Xmx512m" # JVM 内存大小, 推荐设置为主机内存的一半 # elastic # Elasticsearch 账号 # ELASTIC_PASSWORD=KXOeyNgDeTdpeu9q # Elasticsearch 密码 sh docker run --name jms_es -d -p 9200:9200 -p 9300:9300 -e cluster.name=docker-cluster -e discovery.type=single-node -e network.host=0.0.0.0 -e bootstrap.memory_lock="true" -e xpack.security.enabled="true" -e TAKE_FILE_OWNERSHIP="true" -e ES_JAVA_OPTS="-Xms512m -Xmx512m" -e ELASTIC_PASSWORD=KXOeyNgDeTdpeu9q -v /opt/jumpserver/elasticsearch/data:/usr/share/elasticsearch/data -v /opt/jumpserver/elasticsearch/logs:/usr/share/elasticsearch/logs --restart=always docker.elastic.co/elasticsearch/elasticsearch:7.17.6

3.4 在 JumpServer 中配置 Elasticsearch

!!! tip "" - 访问 JumpServer Web 页面并使用管理员账号进行登录。 - 点击左侧菜单栏的 [终端管理],在页面的上方选择 [存储配置],在 [命令存储] 下方选择 [创建] 选择 [Elasticsearch] - 根据下方的说明进行填写,保存后在 [终端管理] 页面对所有组件进行 [更新],命令存储选择 [jms-es],提交。

| 选项            | 参考值                                               | 说明                   |
| :-------------  | :-------------------------------------------------  | :--------------------- |
| 名称 (Name)     | jms-es                                              | 标识, 不可重复          |
| 类型 (Type)     | Elasticsearch                                       | 固定, 不可更改          |
| 主机 (Hosts)    | http://elastic:KXOeyNgDeTdpeu9q@192.168.100.51:9200 | http://es_host:es_port |
| 索引 (Index)    | jumpserver                                          | 索引                   |
| 忽略证书认证    |                                                     | https 自签 ssl 需要勾选 |
| 默认存储        |                                                     | 新组件将自动使用该存储   |

📄 haproxy_install.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/setup_linux_lb/haproxy_install.md

部署 HAProxy 服务

1 准备工作

1.1 环境信息

!!! tip "" - HAProxy 服务器信息如下:

```sh 
192.168.100.100
```

1.2 安装依赖

!!! tip "" sh yum -y install epel-release

2 安装配置 HAProxy

2.1 安装 HAProxy

!!! tip "" sh yum install -y haproxy

2.2 配置 HAProxy

!!! tip "" sh # 打开 HAProxy 的配置文件 vi /etc/haproxy/haproxy.cfg ```nginx global # to have these messages end up in /var/log/haproxy.log you will # need to: # # 1) configure syslog to accept network log events. This is done # by adding the '-r' option to the SYSLOGD_OPTIONS in # /etc/sysconfig/syslog # # 2) configure local2 events to go to the /var/log/haproxy.log # file. A line like the following can be added to # /etc/sysconfig/syslog # # local2.* /var/log/haproxy.log # log 127.0.0.1 local2

    chroot      /var/lib/haproxy
    pidfile     /var/run/haproxy.pid
    maxconn     4000
    user        haproxy
    group       haproxy
    daemon

    # turn on stats unix socket
    stats socket /var/lib/haproxy/stats

#---------------------------------------------------------------------
# common defaults that all the 'listen' and 'backend' sections will
# use if not designated in their block
#---------------------------------------------------------------------
defaults
    log                     global
    option                  dontlognull
    option                  redispatch
    retries                 3
    timeout http-request    10s
    timeout queue           1m
    timeout connect         10s
    timeout client          1m
    timeout server          1m
    timeout http-keep-alive 10s
    timeout check           10s
    maxconn                 3000

listen stats
    bind *:8080
    mode http
    stats enable
    stats uri /haproxy                      # 监控页面, 请自行修改. 访问地址为 http://192.168.100.100:8080/haproxy
    stats refresh 5s
    stats realm haproxy-status
    stats auth admin:KXOeyNgDeTdpeu9q       # 账户密码, 请自行修改. 访问 http://192.168.100.100:8080/haproxy 会要求输入

#---------------------------------------------------------------------
# check  检活参数说明
# inter  间隔时间, 单位: 毫秒
# rise   连续成功的次数, 单位: 次
# fall   连续失败的次数, 单位: 次
# 例: inter 2s rise 2 fall 3
# 表示 2 秒检查一次状态, 连续成功 2 次服务正常, 连续失败 3 次服务异常
#
# server 服务参数说明
# server 192.168.100.21 192.168.100.21:80 weight 1 cookie web01
# 第一个 192.168.100.21 做为页面展示的标识, 可以修改为其他任意字符串
# 第二个 192.168.100.21:80 是实际的后端服务端口
# weight 为权重, 多节点时安装权重进行负载均衡
# cookie 用户侧的 cookie 会包含此标识, 便于区分当前访问的后端节点
# 例: server db01 192.168.100.21:3306 weight 1 cookie db_01
#---------------------------------------------------------------------

listen jms-web
    bind *:80                               # 监听 80 端口
    mode http

    # redirect scheme https if !{ ssl_fc }  # 重定向到 https
    # bind *:443 ssl crt /opt/ssl.pem       # https 设置

    option httpchk GET /api/health/         # Core 检活接口

    stick-table type ip size 200k expire 30m
    stick on src

    balance leastconn
    server 192.168.100.21 192.168.100.21:80 weight 1 cookie web01 check inter 2s rise 2 fall 3  # JumpServer 服务器
    server 192.168.100.22 192.168.100.22:80 weight 1 cookie web02 check inter 2s rise 2 fall 3
    server 192.168.100.23 192.168.100.23:80 weight 1 cookie web03 check inter 2s rise 2 fall 3
    server 192.168.100.24 192.168.100.24:80 weight 1 cookie web03 check inter 2s rise 2 fall 3

listen jms-ssh
    bind *:2222
    mode tcp

    option tcp-check

    fullconn 500
    balance source
    server 192.168.100.21 192.168.100.21:2222 weight 1 check inter 2s rise 2 fall 3 send-proxy
    server 192.168.100.22 192.168.100.22:2222 weight 1 check inter 2s rise 2 fall 3 send-proxy
    server 192.168.100.23 192.168.100.23:2222 weight 1 check inter 2s rise 2 fall 3 send-proxy
    server 192.168.100.24 192.168.100.24:2222 weight 1 check inter 2s rise 2 fall 3 send-proxy

listen jms-koko
    mode http

    option httpclose
    option forwardfor
    option httpchk GET /koko/health/ HTTP/1.1\r\nHost:\ 192.168.100.100  # KoKo 检活接口, host 填写 HAProxy 的 ip 地址

    cookie SERVERID insert indirect
    hash-type consistent
    fullconn 500
    balance leastconn
    server 192.168.100.21 192.168.100.21:80 weight 1 cookie web01 check inter 2s rise 2 fall 3
    server 192.168.100.22 192.168.100.22:80 weight 1 cookie web02 check inter 2s rise 2 fall 3
    server 192.168.100.23 192.168.100.23:80 weight 1 cookie web03 check inter 2s rise 2 fall 3
    server 192.168.100.24 192.168.100.24:80 weight 1 cookie web03 check inter 2s rise 2 fall 3

listen jms-lion
    mode http

    option httpclose
    option forwardfor
    option httpchk GET /lion/health/ HTTP/1.1\r\nHost:\ 192.168.100.100  # Lion 检活接口, host 填写 HAProxy 的 ip 地址

    cookie SERVERID insert indirect
    hash-type consistent
    fullconn 500
    balance leastconn
    server 192.168.100.21 192.168.100.21:80 weight 1 cookie web01 check inter 2s rise 2 fall 3
    server 192.168.100.22 192.168.100.22:80 weight 1 cookie web02 check inter 2s rise 2 fall 3
    server 192.168.100.23 192.168.100.23:80 weight 1 cookie web03 check inter 2s rise 2 fall 3
    server 192.168.100.24 192.168.100.24:80 weight 1 cookie web03 check inter 2s rise 2 fall 3

listen jms-magnus
    bind *:30000
    mode tcp

    option tcp-check

    fullconn 500
    balance source
    server 192.168.100.21 192.168.100.21:30000 weight 1 check inter 2s rise 2 fall 3 send-proxy
    server 192.168.100.22 192.168.100.22:30000 weight 1 check inter 2s rise 2 fall 3 send-proxy
    server 192.168.100.23 192.168.100.23:30000 weight 1 check inter 2s rise 2 fall 3 send-proxy
    server 192.168.100.24 192.168.100.24:30000 weight 1 check inter 2s rise 2 fall 3 send-proxy
```

2.3 配置 SELinux

!!! tip "" sh setsebool -P haproxy_connect_any 1

2.4 启动 HAProxy

!!! tip "" sh systemctl enable haproxy systemctl start haproxy

3 配置防火墙

!!! tip "" sh firewall-cmd --permanent --zone=public --add-port=80/tcp firewall-cmd --permanent --zone=public --add-port=443/tcp firewall-cmd --permanent --zone=public --add-port=2222/tcp firewall-cmd --permanent --zone=public --add-port=33060/tcp firewall-cmd --permanent --zone=public --add-port=33061/tcp firewall-cmd --reload

📄 installation_node01.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/setup_linux_lb/installation_node01.md

部署 JumpServer 01 节点

1 准备工作

1.1 环境信息

!!! tip "" - JumpServer_Node_01 服务器信息如下:

```sh 
192.168.100.21
```

2 配置 NFS

2.1 安装 NFS 依赖包

!!! tip "" sh yum -y install nfs-utils showmount -e 192.168.100.11

2.2 挂载 NFS 目录

!!! tip "" sh # 将 Core 持久化目录挂载到 NFS, 默认 /opt/jumpserver/core/data, 请根据实际情况修改 # JumpServer 持久化目录定义相关参数为 VOLUME_DIR, 在安装 JumpServer 过程中会提示 mkdir /opt/jumpserver/core/data mount -t nfs 192.168.100.11:/data /opt/jumpserver/core/data

2.3 配置 NFS 共享目录开机自动挂载

!!! tip "" sh # 可以写入到 /etc/fstab, 重启自动挂载. 注意: 设置后如果 nfs 损坏或者无法连接该服务器将无法启动 echo "192.168.100.11:/data /opt/jumpserver/core/data nfs defaults 0 0" >> /etc/fstab

3 安装 JumpServer

3.1 下载 jumpserver-install 软件包

!!! tip "" sh cd /opt yum -y install wget wget https://github.com/jumpserver/installer/releases/download/{{ jumpserver.tag }}/jumpserver-installer-{{ jumpserver.tag }}.tar.gz tar -xf jumpserver-installer-{{ jumpserver.tag }}.tar.gz cd jumpserver-installer-{{ jumpserver.tag }}

3.2 修改临时配置文件

!!! tip "" sh vi config-example.txt ```vim hl_lines="6 11-15 18-23 26-29 32" # 修改下面选项, 其他保持默认, 请勿直接复制此处内容 ### 注意: SECRET_KEY 和要其他 JumpServer 服务器一致, 加密的数据将无法解密

# 安装配置
### 注意持久化目录 VOLUME_DIR, 如果上面 NFS 挂载其他目录, 此处也要修改. 如: NFS 挂载到 /data/jumpserver/core/data, 则 VOLUME_DIR=/data/jumpserver
VOLUME_DIR=/opt/jumpserver


# Core 配置
### 启动后不能再修改,否则密码等等信息无法解密, 请勿直接复制下面的字符串
SECRET_KEY=kWQdmdCQKjaWlHYpPhkNQDkfaRulM6YnHctsHLlSPs8287o2kW    # 要其他 JumpServer 服务器一致 (*)
BOOTSTRAP_TOKEN=KXOeyNgDeTdpeu9q                                 # 要其他 JumpServer 服务器一致 (*)
LOG_LEVEL=ERROR                                                  # 日志等级
# SESSION_COOKIE_AGE=86400
SESSION_EXPIRE_AT_BROWSER_CLOSE=True                             # 关闭浏览器 session 过期

# MySQL 配置

DB_HOST=192.168.100.11
DB_PORT=3306
DB_USER=jumpserver
DB_PASSWORD=KXOeyNgDeTdpeu9q
DB_NAME=jumpserver

# Redis 配置

REDIS_HOST=192.168.100.11
REDIS_PORT=6379
REDIS_PASSWORD=KXOeyNgDeTdpeu9q

# KoKo Lion 配置
SHARE_ROOM_TYPE=redis                                            # KoKo Lion 使用 redis 共享
REUSE_CONNECTION=False                                           # Koko 禁用连接复用
```

3.3 执行脚本安装 JumpServer 服务

!!! tip "" sh ./jmsctl.sh install ```nginx hl_lines="31 48 57 61-66 70-73 77"

       ██╗██╗   ██╗███╗   ███╗██████╗ ███████╗███████╗██████╗ ██╗   ██╗███████╗██████╗
       ██║██║   ██║████╗ ████║██╔══██╗██╔════╝██╔════╝██╔══██╗██║   ██║██╔════╝██╔══██╗
       ██║██║   ██║██╔████╔██║██████╔╝███████╗█████╗  ██████╔╝██║   ██║█████╗  ██████╔╝
  ██   ██║██║   ██║██║╚██╔╝██║██╔═══╝ ╚════██║██╔══╝  ██╔══██╗╚██╗ ██╔╝██╔══╝  ██╔══██╗
  ╚█████╔╝╚██████╔╝██║ ╚═╝ ██║██║     ███████║███████╗██║  ██║ ╚████╔╝ ███████╗██║  ██║
   ╚════╝  ╚═════╝ ╚═╝     ╚═╝╚═╝     ╚══════╝╚══════╝╚═╝  ╚═╝  ╚═══╝  ╚══════╝╚═╝  ╚═╝

                                                                     Version:  {{ jumpserver.tag }}


1. 检查配置文件
配置文件位置: /opt/jumpserver/config
/opt/jumpserver/config/config.txt  [ √ ]
/opt/jumpserver/config/nginx/lb_rdp_server.conf  [ √ ]
/opt/jumpserver/config/nginx/lb_ssh_server.conf  [ √ ]
/opt/jumpserver/config/nginx/cert/server.crt  [ √ ]
/opt/jumpserver/config/nginx/cert/server.key  [ √ ]
完成

2. 备份配置文件
备份至 /opt/jumpserver/config/backup/config.txt.2021-07-15_22-26-13
完成

>>> 安装配置 Docker
1. 安装 Docker
开始下载 Docker 程序 ...
开始下载 Docker Compose 程序 ...
完成

2. 配置 Docker
是否需要自定义 docker 存储目录, 默认将使用目录 /var/lib/docker? (y/n)  (默认为 n): n
完成

3. 启动 Docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /etc/systemd/system/docker.service.
完成

>>> 加载 Docker 镜像
Docker: Pulling from jumpserver/core:{{ jumpserver.tag }}       [ OK ]
Docker: Pulling from jumpserver/koko:{{ jumpserver.tag }}       [ OK ]
Docker: Pulling from jumpserver/web:{{ jumpserver.tag }}        [ OK ]
Docker: Pulling from jumpserver/redis:6-alpine      [ OK ]
Docker: Pulling from jumpserver/mysql:5             [ OK ]
Docker: Pulling from jumpserver/lion:{{ jumpserver.tag }}       [ OK ]

>>> 安装配置 JumpServer
1. 配置网络
是否需要支持 IPv6? (y/n)  (默认为 n): n
完成

2. 配置加密密钥
SECRETE_KEY:     YTE2YTVkMTMtMGE3MS00YzI5LWFlOWEtMTc2OWJlMmIyMDE2
BOOTSTRAP_TOKEN: YTE2YTVkMTMtMGE3
完成

3. 配置持久化目录
是否需要自定义持久化存储, 默认将使用目录 /opt/jumpserver? (y/n)  (默认为 n): n
完成

4. 配置 MySQL
是否使用外部 MySQL? (y/n)  (默认为 n): y
请输入 MySQL 的主机地址 (无默认值): 192.168.100.11
请输入 MySQL 的端口 (默认为3306): 3306
请输入 MySQL 的数据库(事先做好授权) (默认为jumpserver): jumpserver
请输入 MySQL 的用户名 (无默认值): jumpserver
请输入 MySQL 的密码 (无默认值): KXOeyNgDeTdpeu9q
完成

5. 配置 Redis
是否使用外部 Redis? (y/n)  (默认为 n): y
请输入 Redis 的主机地址 (无默认值): 192.168.100.11
请输入 Redis 的端口 (默认为6379): 6379
请输入 Redis 的密码 (无默认值): KXOeyNgDeTdpeu9q
完成

6. 配置对外端口
是否需要配置 JumpServer 对外访问端口? (y/n)  (默认为 n): n
完成

7. 初始化数据库
Creating network "jms_net" with driver "bridge"
Creating jms_redis ... done
2021-07-15 22:39:52 Collect static files
2021-07-15 22:39:52 Collect static files done
2021-07-15 22:39:52 Check database structure change ...
2021-07-15 22:39:52 Migrate model change to database ...

475 static files copied to '/opt/jumpserver/data/static'.
Operations to perform:
  Apply all migrations: acls, admin, applications, assets, audits, auth, authentication, captcha, common, contenttypes, django_cas_ng, django_celery_beat, jms_oidc_rp, notifications, ops, orgs, perms, sessions, settings, terminal, tickets, users
Running migrations:
  Applying contenttypes.0001_initial... OK
  Applying contenttypes.0002_remove_content_type_name... OK
  Applying auth.0001_initial... OK
  Applying auth.0002_alter_permission_name_max_length... OK
  Applying auth.0003_alter_user_email_max_length... OK
  Applying auth.0004_alter_user_username_opts... OK
  Applying auth.0005_alter_user_last_login_null... OK
  Applying auth.0006_require_contenttypes_0002... OK
  Applying auth.0007_alter_validators_add_error_messages... OK
  Applying auth.0008_alter_user_username_max_length... OK
  ...
  Applying sessions.0001_initial... OK
  Applying terminal.0032_auto_20210302_1853... OK
  Applying terminal.0033_auto_20210324_1008... OK
  Applying terminal.0034_auto_20210406_1434... OK
  Applying terminal.0035_auto_20210517_1448... OK
  Applying terminal.0036_auto_20210604_1124... OK
  Applying terminal.0037_auto_20210623_1748... OK
  Applying tickets.0008_auto_20210311_1113... OK
  Applying tickets.0009_auto_20210426_1720... OK

>>> 安装完成了
1. 可以使用如下命令启动, 然后访问
cd /root/jumpserver-installer-{{ jumpserver.tag }}
./jmsctl.sh start

2. 其它一些管理命令
./jmsctl.sh stop
./jmsctl.sh restart
./jmsctl.sh backup
./jmsctl.sh upgrade
更多还有一些命令, 你可以 ./jmsctl.sh --help 来了解

3. Web 访问
http://192.168.100.212:80
默认用户: admin  默认密码: admin

4. SSH/SFTP 访问
ssh -p2222 admin@192.168.100.212
sftp -P2222 admin@192.168.100.212

5. 更多信息
我们的官网: https://www.jumpserver.org/
我们的文档: https://docs.jumpserver.org/
```

3.4 启动 JumpServer 服务

!!! tip "" sh ./jmsctl.sh start nginx Creating network "jms_net" with driver "bridge" Creating jms_core ... done Creating jms_celery ... done Creating jms_lion ... done Creating jms_koko ... done Creating jms_magnus ... done Creating jms_web ... done

📄 installation_node02.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/setup_linux_lb/installation_node02.md

部署 JumpServer 02 节点

1 准备工作

1.1 环境信息

!!! tip "" - JumpServer_Node_02 服务器信息如下:

```sh 
192.168.100.22
```

2 配置 NFS

2.1 安装 NFS 依赖包

!!! tip "" sh yum -y install nfs-utils showmount -e 192.168.100.11

2.2 挂载 NFS 目录

!!! tip "" sh # 将 Core 持久化目录挂载到 NFS, 默认 /opt/jumpserver/core/data, 请根据实际情况修改 # JumpServer 持久化目录定义相关参数为 VOLUME_DIR, 在安装 JumpServer 过程中会提示 mkdir /opt/jumpserver/core/data mount -t nfs 192.168.100.11:/data /opt/jumpserver/core/data

2.3 配置 NFS 共享目录开机自动挂载

!!! tip "" sh # 可以写入到 /etc/fstab, 重启自动挂载. 注意: 设置后如果 nfs 损坏或者无法连接该服务器将无法启动 echo "192.168.100.11:/data /opt/jumpserver/core/data nfs defaults 0 0" >> /etc/fstab

3 安装 JumpServer

3.1 下载 jumpserver-install 软件包

!!! tip "" sh cd /opt yum -y install wget wget https://github.com/jumpserver/installer/releases/download/{{ jumpserver.tag }}/jumpserver-installer-{{ jumpserver.tag }}.tar.gz tar -xf jumpserver-installer-{{ jumpserver.tag }}.tar.gz cd jumpserver-installer-{{ jumpserver.tag }}

3.2 修改临时配置文件

!!! tip "" sh vi config-example.txt ```vim hl_lines="6 11-15 18-23 26-29 32" # 修改下面选项, 其他保持默认, 请勿直接复制此处内容 ### 注意: SECRET_KEY 和要其他 JumpServer 服务器一致, 加密的数据将无法解密

# 安装配置
### 注意持久化目录 VOLUME_DIR, 如果上面 NFS 挂载其他目录, 此处也要修改. 如: NFS 挂载到 /data/jumpserver/core/data, 则 VOLUME_DIR=/data/jumpserver
VOLUME_DIR=/opt/jumpserver


# Core 配置
### 启动后不能再修改,否则密码等等信息无法解密, 请勿直接复制下面的字符串
SECRET_KEY=kWQdmdCQKjaWlHYpPhkNQDkfaRulM6YnHctsHLlSPs8287o2kW    # 要其他 JumpServer 服务器一致 (*)
BOOTSTRAP_TOKEN=KXOeyNgDeTdpeu9q                                 # 要其他 JumpServer 服务器一致 (*)
LOG_LEVEL=ERROR                                                  # 日志等级
# SESSION_COOKIE_AGE=86400
SESSION_EXPIRE_AT_BROWSER_CLOSE=True                             # 关闭浏览器 session 过期

# MySQL 配置

DB_HOST=192.168.100.11
DB_PORT=3306
DB_USER=jumpserver
DB_PASSWORD=KXOeyNgDeTdpeu9q
DB_NAME=jumpserver

# Redis 配置

REDIS_HOST=192.168.100.11
REDIS_PORT=6379
REDIS_PASSWORD=KXOeyNgDeTdpeu9q

# KoKo Lion 配置
SHARE_ROOM_TYPE=redis                                            # KoKo Lion 使用 redis 共享
REUSE_CONNECTION=False                                           # Koko 禁用连接复用
```

3.3 执行脚本安装 JumpServer 服务

!!! tip "" sh ./jmsctl.sh install

3.4 启动 JumpServer 服务

!!! tip "" sh ./jmsctl.sh start nginx Creating network "jms_net" with driver "bridge" Creating jms_core ... done Creating jms_celery ... done Creating jms_lion ... done Creating jms_koko ... done Creating jms_magnus ... done Creating jms_web ... done

📄 installation_node03.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/setup_linux_lb/installation_node03.md

部署 JumpServer 03 节点

1 准备工作

1.1 环境信息

!!! tip "" - JumpServer_Node_03 服务器信息如下:

```sh 
192.168.100.23
```

2 配置 NFS

2.1 安装 NFS 依赖包

!!! tip "" sh yum -y install nfs-utils showmount -e 192.168.100.11

2.2 挂载 NFS 目录

!!! tip "" sh # 将 Core 持久化目录挂载到 NFS, 默认 /opt/jumpserver/core/data, 请根据实际情况修改 # JumpServer 持久化目录定义相关参数为 VOLUME_DIR, 在安装 JumpServer 过程中会提示 mkdir /opt/jumpserver/core/data mount -t nfs 192.168.100.11:/data /opt/jumpserver/core/data

2.3 配置 NFS 共享目录开机自动挂载

!!! tip "" sh # 可以写入到 /etc/fstab, 重启自动挂载. 注意: 设置后如果 nfs 损坏或者无法连接该服务器将无法启动 echo "192.168.100.11:/data /opt/jumpserver/core/data nfs defaults 0 0" >> /etc/fstab

3 安装 JumpServer

3.1 下载 jumpserver-install 软件包

!!! tip "" sh cd /opt yum -y install wget wget https://github.com/jumpserver/installer/releases/download/{{ jumpserver.tag }}/jumpserver-installer-{{ jumpserver.tag }}.tar.gz tar -xf jumpserver-installer-{{ jumpserver.tag }}.tar.gz cd jumpserver-installer-{{ jumpserver.tag }}

3.2 修改临时配置文件

!!! tip "" sh vi config-example.txt ```vim hl_lines="6 11-15 18-23 26-29 32" # 修改下面选项, 其他保持默认, 请勿直接复制此处内容 ### 注意: SECRET_KEY 和要其他 JumpServer 服务器一致, 加密的数据将无法解密

# 安装配置
### 注意持久化目录 VOLUME_DIR, 如果上面 NFS 挂载其他目录, 此处也要修改. 如: NFS 挂载到 /data/jumpserver/core/data, 则 VOLUME_DIR=/data/jumpserver
VOLUME_DIR=/opt/jumpserver


# Core 配置
### 启动后不能再修改,否则密码等等信息无法解密, 请勿直接复制下面的字符串
SECRET_KEY=kWQdmdCQKjaWlHYpPhkNQDkfaRulM6YnHctsHLlSPs8287o2kW    # 要其他 JumpServer 服务器一致 (*)
BOOTSTRAP_TOKEN=KXOeyNgDeTdpeu9q                                 # 要其他 JumpServer 服务器一致 (*)
LOG_LEVEL=ERROR                                                  # 日志等级
# SESSION_COOKIE_AGE=86400
SESSION_EXPIRE_AT_BROWSER_CLOSE=True                             # 关闭浏览器 session 过期

# MySQL 配置

DB_HOST=192.168.100.11
DB_PORT=3306
DB_USER=jumpserver
DB_PASSWORD=KXOeyNgDeTdpeu9q
DB_NAME=jumpserver

# Redis 配置

REDIS_HOST=192.168.100.11
REDIS_PORT=6379
REDIS_PASSWORD=KXOeyNgDeTdpeu9q

# KoKo Lion 配置
SHARE_ROOM_TYPE=redis                                            # KoKo Lion 使用 redis 共享
REUSE_CONNECTION=False                                           # Koko 禁用连接复用
```

3.3 执行脚本安装 JumpServer 服务

!!! tip "" sh ./jmsctl.sh install

3.4 启动 JumpServer 服务

!!! tip "" sh ./jmsctl.sh start nginx Creating network "jms_net" with driver "bridge" Creating jms_core ... done Creating jms_celery ... done Creating jms_lion ... done Creating jms_koko ... done Creating jms_magnus ... done Creating jms_web ... done

📄 installation_node04.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/setup_linux_lb/installation_node04.md

部署 JumpServer 04 节点

1 准备工作

1.1 环境信息

!!! tip "" - JumpServer_Node_04 服务器信息如下:

```sh
192.168.100.24
```

2 配置 NFS

2.1 安装 NFS 依赖包

!!! tip "" sh yum -y install nfs-utils showmount -e 192.168.100.11

2.2 挂载 NFS 目录

!!! tip "" sh # 将 Core 持久化目录挂载到 NFS, 默认 /opt/jumpserver/core/data, 请根据实际情况修改 # JumpServer 持久化目录定义相关参数为 VOLUME_DIR, 在安装 JumpServer 过程中会提示 mkdir /opt/jumpserver/core/data mount -t nfs 192.168.100.11:/data /opt/jumpserver/core/data

2.3 配置 NFS 共享目录开机自动挂载

!!! tip "" sh # 可以写入到 /etc/fstab, 重启自动挂载. 注意: 设置后如果 nfs 损坏或者无法连接该服务器将无法启动 echo "192.168.100.11:/data /opt/jumpserver/core/data nfs defaults 0 0" >> /etc/fstab

3 安装 JumpServer

3.1 下载 jumpserver-install 软件包

!!! tip "" sh cd /opt yum -y install wget wget https://github.com/jumpserver/installer/releases/download/{{ jumpserver.tag }}/jumpserver-installer-{{ jumpserver.tag }}.tar.gz tar -xf jumpserver-installer-{{ jumpserver.tag }}.tar.gz cd jumpserver-installer-{{ jumpserver.tag }}

3.2 修改临时配置文件

!!! tip "" sh vi config-example.txt ```vim hl_lines="6 11-15 18-23 26-29 32" # 修改下面选项, 其他保持默认, 请勿直接复制此处内容 ### 注意: SECRET_KEY 和要其他 JumpServer 服务器一致, 加密的数据将无法解密

# 安装配置
### 注意持久化目录 VOLUME_DIR, 如果上面 NFS 挂载其他目录, 此处也要修改. 如: NFS 挂载到 /data/jumpserver/core/data, 则 VOLUME_DIR=/data/jumpserver
VOLUME_DIR=/opt/jumpserver


# Core 配置
### 启动后不能再修改,否则密码等等信息无法解密, 请勿直接复制下面的字符串
SECRET_KEY=kWQdmdCQKjaWlHYpPhkNQDkfaRulM6YnHctsHLlSPs8287o2kW    # 要其他 JumpServer 服务器一致 (*)
BOOTSTRAP_TOKEN=KXOeyNgDeTdpeu9q                                 # 要其他 JumpServer 服务器一致 (*)
LOG_LEVEL=ERROR                                                  # 日志等级
# SESSION_COOKIE_AGE=86400
SESSION_EXPIRE_AT_BROWSER_CLOSE=True                             # 关闭浏览器 session 过期

# MySQL 配置

DB_HOST=192.168.100.11
DB_PORT=3306
DB_USER=jumpserver
DB_PASSWORD=KXOeyNgDeTdpeu9q
DB_NAME=jumpserver

# Redis 配置

REDIS_HOST=192.168.100.11
REDIS_PORT=6379
REDIS_PASSWORD=KXOeyNgDeTdpeu9q

# KoKo Lion 配置
SHARE_ROOM_TYPE=redis                                            # KoKo Lion 使用 redis 共享
REUSE_CONNECTION=False                                           # Koko 禁用连接复用
```

3.3 执行脚本安装 JumpServer 服务

!!! tip "" sh ./jmsctl.sh install

3.4 启动 JumpServer 服务

!!! tip "" sh ./jmsctl.sh start nginx Creating network "jms_net" with driver "bridge" Creating jms_core ... done Creating jms_celery ... done Creating jms_lion ... done Creating jms_koko ... done Creating jms_magnus ... done Creating jms_web ... done

📄 linux_lb_upgrade.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/setup_linux_lb/linux_lb_upgrade.md

注意事项

1 关于集群模式的环境升级

!!! warning "更新前请一定要做好备份工作" - 升级前请关闭所有 JumpServer 节点。 - 在任意一个 JumpServer 节点按照升级文档完成升级操作。 - 仔细检查该节点升级过程确保无异常。 - 然后按照升级文档对其他 JumpServer 节点升级即可。

!!! tip "" - 从飞致云社区 下载最新的 linux/amd64 离线包{:target="_blank"}, 并上传到部署服务器的 /opt 目录。

!!! tip "" sh cd /opt tar -xf jumpserver-offline-installer-{{ jumpserver.tag }}-amd64.tar.gz cd jumpserver-offline-installer-{{ jumpserver.tag }}-amd64 sh # 额外节点可以设置 SKIP_BACKUP_DB=1 跳过数据库备份, 第一个升级节点不要跳过备份 export SKIP_BACKUP_DB=1 ./jmsctl.sh upgrade ./jmsctl.sh start

📄 minio_install.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/setup_linux_lb/minio_install.md

部署 MinIO 服务

!!! tip "提示" - 集群部署请参考 (http://docs.minio.org.cn/docs/master/minio-erasure-code-quickstart-guide)

1 准备工作

1.1 环境信息

!!! tip "" - MinIO 服务器信息如下:

```sh 
192.168.100.41
```

2 安装配置 Docker 环境

2.1 安装 Docker

!!! tip "" sh yum install -y yum-utils device-mapper-persistent-data lvm2 yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo sed -i 's+download.docker.com+mirrors.aliyun.com/docker-ce+' /etc/yum.repos.d/docker-ce.repo yum makecache fast yum -y install docker-ce

2.2 配置 Docker

!!! tip "" sh mkdir /etc/docker/ vi /etc/docker/daemon.json json { "live-restore": true, "registry-mirrors": ["https://hub-mirror.c.163.com", "https://bmtrgdvx.mirror.aliyuncs.com", "http://f1361db2.m.daocloud.io"], "log-driver": "json-file", "log-opts": {"max-file": "3", "max-size": "10m"} }

2.3 启动 Docker

!!! tip "" sh systemctl enable docker systemctl start docker

3 安装配置 MinIO

3.1 下载 MinIO 镜像

!!! tip "" sh docker pull minio/minio:latest vim latest: Pulling from minio/minio a591faa84ab0: Pull complete 76b9354adec6: Pull complete f9d8746550a4: Pull complete 890b1dd95baa: Pull complete 3a8518c890dc: Pull complete 8053f0501aed: Pull complete 506c41cb8532: Pull complete Digest: sha256:e7a725edb521dd2af07879dad88ee1dfebd359e57ad8d98104359ccfbdb92024 Status: Downloaded newer image for minio/minio:latest docker.io/minio/minio:latest

3.2 MinIO 持久化数据目录创建

!!! tip "" sh mkdir -p /opt/jumpserver/minio/data /opt/jumpserver/minio/config

3.3 启动 MinIO 服务

!!! tip "" vim ## 请自行修改账号密码并牢记,丢失后可以删掉容器后重新用新密码创建,数据不会丢失 # 9000 # api 访问端口 # 9001 # console 访问端口 # MINIO_ROOT_USER=minio # minio 账号 # MINIO_ROOT_PASSWORD=KXOeyNgDeTdpeu9q # minio 密码 sh docker run --name jms_minio -d -p 9000:9000 -p 9001:9001 -e MINIO_ROOT_USER=minio -e MINIO_ROOT_PASSWORD=KXOeyNgDeTdpeu9q -v /opt/jumpserver/minio/data:/data -v /opt/jumpserver/minio/config:/root/.minio --restart=always minio/minio:latest server /data --console-address ":9001"

3.5 在 MinIO 中创建 Buckets

!!! tip "" - 访问 http://192.168.100.41:9000,输入刚才设置的 MinIO 账号密码登录。 - 点击左侧菜单的 Buckets,选择 Create Bucket 创建桶,Bucket Name 输入 jumpserver,然后点击 Save 保存。

3.6 在 JumpServer 中配置 MinIO

!!! tip "" - 访问 JumpServer Web 页面并使用管理员账号进行登录。 - 点击左侧菜单栏的 [终端管理],在页面的上方选择 [存储配置],在 [录像存储] 下方选择 [创建] 选择 [Ceph] - 根据下方的说明进行填写,保存后在 [终端管理] 页面对所有组件进行 [更新],录像存储选择 [jms-mino],提交。

| 选项            | 参考值                      | 说明                |
| :-------------  | :------------------------- | :------------------ |
| 名称 (Name)     | jms-minio                  | 标识, 不可重复       |
| 类型 (Type)     | Ceph                       | 固定, 不可更改       |
| 桶名称 (Bucket) | jumpserver                 | Bucket Name         |
| Access key      | minio                      | MINIO_ROOT_USER     |
| Secret key      | KXOeyNgDeTdpeu9q           | MINIO_ROOT_PASSWORD |
| 端点 (Endpoint) | http://192.168.100.41:9000 | minio 服务访问地址   |
| 默认存储        |                            | 新组件将自动使用该存储 |

📄 mysql_install.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/setup_linux_lb/mysql_install.md

部署 MySQL 服务

1 准备工作

1.1 环境信息

!!! tip "" - MySQL 服务器信息如下:

```sh 
192.168.100.11
```

1.2 设置 Repo

!!! tip "" sh yum -y localinstall http://mirrors.ustc.edu.cn/mysql-repo/mysql57-community-release-el7.rpm

2 安装配置 MySQL

2.1 Yum 方式安装 MySQL

!!! tip "" sh yum install -y mysql-community-server

2.1 配置 MySQL

!!! tip "" sh if [ ! "$(cat /usr/bin/mysqld_pre_systemd | grep -v ^\# | grep initialize-insecure )" ]; then sed -i "s@--initialize @--initialize-insecure @g" /usr/bin/mysqld_pre_systemd fi

2.2 启动 MySQL

!!! tip "" sh systemctl enable mysqld systemctl start mysqld

2.3 配置数据库授权

!!! tip "" sh mysql -uroot ```mysql hl_lines="13 16 19 22 25 28" Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.7.32 MySQL Community Server (GPL)

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database jumpserver default charset 'utf8';
Query OK, 1 row affected (0.00 sec)

mysql> set global validate_password_policy=LOW;
Query OK, 0 rows affected (0.00 sec)

mysql> create user 'jumpserver'@'%' identified by 'KXOeyNgDeTdpeu9q';
Query OK, 0 rows affected (0.00 sec)

mysql> grant all on jumpserver.* to 'jumpserver'@'%';
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye
```

3 配置防火墙

!!! tip "" sh firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.100.0/24" port protocol="tcp" port="3306" accept" firewall-cmd --reload

📄 nfs_install.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/setup_linux_lb/nfs_install.md

部署 NFS 服务

1 NFS 服务器端安装与配置

1.1 环境信息

!!! tip "" - NFS 服务器信息如下:

```sh
192.168.100.11
```

1.2 安装依赖

!!! tip "" sh yum -y install epel-release

1.3 安装 NFS 依赖包

!!! tip "" sh yum -y install nfs-utils rpcbind

1.4 启动 NFS

!!! tip "" sh systemctl enable rpcbind nfs-server nfs-lock nfs-idmap systemctl start rpcbind nfs-server nfs-lock nfs-idmap

1.5 配置防火墙

!!! tip "" sh firewall-cmd --add-service=nfs --permanent --zone=public firewall-cmd --add-service=mountd --permanent --zone=public firewall-cmd --add-service=rpc-bind --permanent --zone=public firewall-cmd --reload

1.6 配置 NFS

!!! tip "" ```sh mkdir /data chmod 777 -R /data

vi /etc/exports
```
```vim
# 设置 NFS 访问权限, /data 是刚才创建的将被共享的目录, 192.168.100.* 表示整个 192.168.100.* 的资产都有括号里面的权限
# 也可以写具体的授权对象 /data 192.168.100.30(rw,sync,no_root_squash) 192.168.100.31(rw,sync,no_root_squash)
/data 192.168.100.*(rw,sync,all_squash,anonuid=0,anongid=0)
```

1.7 让 exports 配置生效

!!! tip "" sh exportfs -a

📄 redis_install.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/setup_linux_lb/redis_install.md

部署 Redis 服务

1 准备工作

1.1 环境信息

!!! tip "" - Redis 服务器信息如下:

```sh 
192.168.100.11
```

1.2 设置 Repo

!!! tip "" sh yum -y install epel-release https://repo.ius.io/ius-release-el7.rpm

2 安装配置 Redis

2.1 Yum 方式安装 Redis

!!! tip "" sh yum install -y redis6

2.2 配置 Redis

!!! tip "" sh sed -i "s/bind 127.0.0.1/bind 0.0.0.0/g" /etc/redis.conf sed -i "561i maxmemory-policy allkeys-lru" /etc/redis.conf sed -i "481i requirepass KXOeyNgDeTdpeu9q" /etc/redis.conf

2.3 启动 Redis

!!! tip "" sh systemctl enable redis systemctl start redis

3 配置防火墙

!!! tip "" sh firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.100.0/24" port protocol="tcp" port="6379" accept" firewall-cmd --reload

📄 requirements.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/setup_linux_lb/requirements.md

准备工作

1 整体部署说明

!!! tip "环境说明" - 除 JumpServer 自身组件外,其他组件的高可用请参考对应的官方文档进行部署。 - 按照此方式部署后,后续只需要根据需要扩容 JumpServer 节点然后添加节点到 HAProxy 即可。 - 如果已经有 HLB 或者 SLB 可以跳过 HAProxy 部署,第三方 LB 要注意 session 和 websocket 问题。 - 如果已经有 云存储 (S3/Ceph/Swift/OSS/Azure) 可以跳过 MinIO 部署,MySQL、Redis 也一样。 - 生产环境中,应该使用 Ceph 等替代 NFS,或者部署高可用的 NFS 防止单点故障。

1.1 数据库要求

!!! tip ""

| 名称    | 版本 | 默认字符集  | 默认字符编码  | TLS/SSL          |
| :------ | :------ | :--------------- | :----------------- | :--------------- |
| MySQL   | >= 5.7  | utf8             | utf8_general_ci    | :material-check: |
| MariaDB | >= 10.6 | utf8mb3          | utf8mb3_general_ci | :material-check: |

| Name    | Version | Sentinel         | Cluster            | TLS/SSL          |
| :------ | :------ | :--------------- | :----------------- | :--------------- |
| Redis   | >= 6.0  | :material-check: | :material-close:   | :material-check: |

1.2 服务器要求

!!! tip ""

| 服务名称   |      IP 地址        |  端口                   |     使用涉及组件/服务     |   最小化硬件配置    |   标准化硬件配置     |
| ------------- | ---------------- | ----------------------- | ---------------- | ---------------------- | ----------------------- |
| NFS           |  192.168.100.11  |  -                      | Core             | 2Core/8GB RAM/100G HDD | 4Core/16GB RAM/1T   SSD |
| MySQL         |  192.168.100.11  | 3306                    | Core             | 2Core/8GB RAM/90G  HDD | 4Core/16GB RAM/1T   SSD |
| Redis         |  192.168.100.11  | 6379                    | Core, Koko, Lion | 2Core/8GB RAM/90G  HDD | 4Core/16GB RAM/1T   SSD |
| HAProxy       |  192.168.100.100 | 80,443,2222,33060,33061 | All              | 2Core/4GB RAM/60G  HDD | 4Core/8GB  RAM/60G  SSD |
| JumpServer 01 |  192.168.100.21  | 80,2222,33060,33061     | HAProxy          | 2Core/8GB RAM/60G  HDD | 4Core/8GB  RAM/90G  SSD |
| JumpServer 02 |  192.168.100.22  | 80,2222,33060,33061     | HAProxy          | 2Core/8GB RAM/60G  HDD | 4Core/8GB  RAM/90G  SSD |
| JumpServer 03 |  192.168.100.23  | 80,2222,33060,33061     | HAProxy          | 2Core/8GB RAM/60G  HDD | 4Core/8GB  RAM/90G  SSD |
| JumpServer 04 |  192.168.100.24  | 80,2222,33060,33061     | HAProxy          | 2Core/8GB RAM/60G  HDD | 4Core/8GB  RAM/90G  SSD |
| MinIO         |  192.168.100.41  | 9000,9001               | Core, KoKo, Lion | 2Core/4GB RAM/100G HDD | 4Core/8GB  RAM/1T   SSD |
| Elasticsearch |  192.168.100.51  | 9200,9300               | Core, KoKo       | 2Core/4GB RAM/100G HDD | 4Core/8GB  RAM/1T   SSD |

1.3 组件容器健康检查

!!! tip ""

| 服务名称   | 健康检查                   | 实例                                   |
| ------------- | ------------------------------ | ----------------------------------------- |
| Core          | http://core:8080/api/health/   | https://demo.jumpserver.org/api/health/   |
| KoKo          | http://koko:5000/koko/health/  | https://demo.jumpserver.org/koko/health/  |
| Lion          | http://lion:8081/lion/health/  | https://demo.jumpserver.org/lion/health/  |

2 部署顺序

!!! tip "" 1.部署 NFS 服务

2.部署 MySQL 服务

3.部署 Redis 服务

4.部署 JumpServer 01 节点

5.部署 JumpServer 02 节点

6.部署 JumpServer 03 节点

7.部署 JumpServer 04 节点

8.部署 HAProxy 服务

9.部署 MinIO 服务

10.部署 Elasticsearch 服务

📄 1panel_install.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/setup_linux_standalone/1panel_install.md

1Panel安装

1. 安装 1Panel

!!! tip "" - 关于 1Panel 的安装部署与基础功能介绍,请参考 1Panel 官方文档 。 - 在完成了 1Panel 的安装部署后,根据提示网址打开浏览器进入 1Panel,如下界面。

1panel页面

2. 安装数据库

!!! tip "" - 在安装 JumpServer 之前,需要先在 1Panel 上安装所需的软件 MySQL 和 Redis。

2.1 安装 MySQL 数据库

!!! tip "" - 点击页面左侧的应用商店模块,其中选择 MySQL 点击安装,选择 5.7.xx 版本 。

安装 MySQL 数据库_01

安装 MySQL 数据库_02

!!! tip "" - 详细参数说明:

!!! tip ""

| 参数    |             说明              |
| ------- | ---------------------------- |
| 名称 | 创建的 MySQL 应用名称。 |
| 版本 | 创建的 MySQL 应用版本。 |
| root用户密码 | 安装 MySQL 应用的 root 用户密码。 |
| 端口 | MySQL 应用的服务端口。 |
| 容器名称 | MySQL 应用的容器名称。 |
| 端口外部访问 | 允许端口外部访问回放开防火墙端口。 |
| CPU 限制 | MySQL 应用可以使用的 CPU 核心数。 |
| 内存限制 | MySQL 应用可以使用的内存大小。 |
| 编辑 compose 文件 | 支持自定义 compose 文件启动容器。 |

2.2 安装 Redis 数据库

!!! tip "" - 点击页面左侧的应用商店模块,其中选择 Redis 点击安装。

安装 Redis 数据库

!!! tip "" - 详细参数说明:

!!! tip ""

| 参数    |             说明              |
| ------- | ---------------------------- |
| 名称 | 创建的 Redis 应用名称。 |
| 版本 | 创建的 Redis 应用版本。 |
| 密码 | 安装 Redis 应用的 root 用户密码。 |
| 端口 | MySQL 应用的服务端口。 |
| 容器名称 | MySQL 应用的容器名称。 |
| 端口外部访问 | 允许端口外部访问回放开防火墙端口。 |
| CPU 限制 | MySQL 应用可以使用的 CPU 核心数。 |
| 内存限制 | MySQL 应用可以使用的内存大小。 |
| 编辑 compose 文件 | 支持自定义 compose 文件启动容器。 |

2.3 数据库状态检查

!!! tip "" - 点击页面左侧的应用商店模块,切换至已安装的应用列表,检查 MySQL 和 Redis 服务状态变为已启动。

数据库状态检查

3. 安装 JumpServer

!!! tip "" - 点击页面左侧的应用商店模块,其中选择 JumpServer 点击安装。

安装 JumpServer

!!! tip "" - 在应用详情页选择最新的 JumpServer 版本进行安装,并进行相关参数设置。

安装 JumpServer

!!! tip "" - 详细参数说明:

!!! tip ""

| 参数    |             说明              |
| ------- | ---------------------------- |
| 名称 | 创建的 JumpServer 应用名称。 |
| 版本 | 创建的 JumpServer 应用版本。 |
| 加密签名 | JumpServer 的 SECRET_KEY,保持默认即可,迁移环境请保存该 SECRET_KEY。 |
| 认证令牌 | JumpServer 的 BOOTSTRAP_TOKEN,保持默认即可,迁移环境请保存该 BOOTSTRAP_TOKEN。 |
| 调试模式 | 支持开启调试模式。 |
| 日志级别 | 日志级别,支持配置 DEBUG、INFO、WARNING、ERROR、CRITICAL 级别。 |
| 数据库服务 | JumpServer 应用使用的 MySQL 数据库应用,支持下拉选择已安装的 MySQL 数据库应用,1Panel 会自动配置 JumpServer 使用该数据库。 |
| 数据库名 | JumpServer 应用使用的数据库名称,1Panel 会在选中的数据库中自动创建这个数据库。 |
| 数据库用户密码 | JumpServer 应用使用的数据库用户密码,1Panel 会在选中的数据库中自动为上一步创建的用户配置该密码。 |
| 缓存服务服务 | JumpServer 应用使用的 Redis 数据库应用,支持下拉选择已安装的 Redis 数据库应用,1Panel 会自动配置 JumpServer 使用该数据库。 |
| 缓存服务服务密码 | JumpServer 应用使用的 Redis 数据库密码,1Panel 会在选中的数据库中自动创建配置该密码。 |
| Web 端口 | 通过 HTTP 协议访问 JumpServer 前端页面。 |
| SSH 端口 | SSH Client 方式使用终端工具连接 JumpServer,比如 Xshell、PuTTY、MobaXterm 等终端工具。 |
| Magnus MySQL 端口 | DB Client 方式连接 MySQL 数据库资产。 |
| Magnus Mariadb 端口 | DB Client 方式连接 MariaDB 数据库资产。 |
| DOMAINS | 定义可信任的访问 IP, 请根据实际情况修改, 如果是公网 IP 请改成对应的公网 IP。 |
| 容器名称 | JumpServer 应用的容器名称。 |
| 端口外部访问 | 允许端口外部访问回放开防火墙端口。 |
| CPU 限制 | JumpServer 应用可以使用的 CPU 核心数。 |
| 内存限制 | JumpServer 应用可以使用的内存大小。 |
| 编辑 compose 文件 | 支持自定义 compose 文件启动容器。 |

!!! tip "" - 点击页面左侧的应用商店模块,切换至已安装的应用列表,检查 JumpServer 服务状态变为已启动。

检查 JumpServer

4. 访问 JumpServer

!!! info "安装成功后,通过浏览器访问登录 JumpServer" sh 地址: http://<1Panel 服务器 IP 地址>:<JumpServer 服务运行端口> 用户名: admin 密码: admin

访问 JumpServer

📄 offline_install.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/setup_linux_standalone/offline_install.md

离线安装

!!! info "安装所需命令, 参考 环境要求 手动安装"

OS/Arch Architecture Linux Kernel Offline Name
linux/amd64 x86_64 >= 4.0 jumpserver-ce-{{ jumpserver.tag }}-x86_64.tar.gz

1. 安装部署

!!! warning "" - 离线安装目前只支持 linux/amd64 架构, 其他架构请参考 在线安装

=== "linux/amd64" !!! tip "" 从飞致云社区 下载最新的 linux/amd64 离线包{:target="_blank"}, 并上传到部署服务器的 /opt 目录

!!! tip ""
    ```sh
    cd /opt
    tar -xf jumpserver-ce-{{ jumpserver.tag }}-x86_64.tar.gz
    cd jumpserver-ce-{{ jumpserver.tag }}-x86_64
    ```
    ```sh
    # 根据需要修改配置文件模板, 如果不清楚用途可以跳过修改
    cat config-example.txt
    ```
    ```vim
    # JumpServer configuration file example.
    #
    # If you don't understand the purpose, you can skip modifying this configuration file, the system will automatically fill in
    # Complete parameter documentation https://docs.jumpserver.org/zh/v3/guide/env/

    ################################# Image Configuration #################################
    #
    # The connection to docker.io in China will timeout or the download speed will be slow, enable this option to use Huawei Cloud image acceleration
    # Replace the old version DOCKER_IMAGE_PREFIX
    #
    # DOCKER_IMAGE_MIRROR=1

    # Image pull policy Always, IfNotPresent
    # Always means that the latest image will be pulled every time, IfNotPresent means that the image will be pulled only if it does not exist locally
    #
    # IMAGE_PULL_POLICY=Always

    ############################## Installation Configuration #############################
    #
    # JumpServer database persistence directory, by default, recordings, task logs are in this directory
    # Please modify according to the actual situation, the database file (.sql) and configuration file backed up during the upgrade will also be saved to this directory
    #
    VOLUME_DIR=/data/jumpserver

    # Encryption key, please ensure that SECRET_KEY is consistent with the old environment when migrating, do not use special strings
    # (*) Warning: Keep this value secret.
    # (*) Do not disclose SECRET_KEY to anyone
    #
    SECRET_KEY=

    # The token used by the component to register with core, please keep BOOTSTRAP_TOKEN consistent with the old environment when migrating,
    # Do not use special strings
    # (*) Warning: Keep this value secret.
    # (*) Do not disclose BOOTSTRAP_TOKEN to anyone
    #
    BOOTSTRAP_TOKEN=

    # Log level INFO, WARN, ERROR
    #
    LOG_LEVEL=ERROR

    # The network segment used by the JumpServer container, please do not conflict with the existing network, modify according to the actual situation
    #
    DOCKER_SUBNET=192.168.250.0/24

    # ipv6 nat, no need to enable under normal circumstances
    # If the host does not support ipv6, enabling this option will prevent the real client ip address from being obtained
    #
    USE_IPV6=0
    DOCKER_SUBNET_IPV6=fc00:1010:1111:200::/64

    ################################# DB Configuration ####################################
    # For external databases, you need to enter the correct database information, the system will automatically handle the built-in database
    # (*) The password part must not contain single quotes and double quotes
    #
    DB_ENGINE=postgresql
    DB_HOST=postgresql
    DB_PORT=5432
    DB_USER=postgres
    DB_PASSWORD=
    DB_NAME=jumpserver

    # If external MySQL needs to enable TLS/SSL connection, refer to https://docs.jumpserver.org/zh/v3/installation/security_setup/mysql_ssl/
    #
    # DB_USE_SSL=true

    ################################# Redis Configuration #################################
    # For external Redis, please enter the correct Redis information, the system will automatically handle the built-in Redis
    # (*) The password part must not contain single quotes and double quotes
    #
    REDIS_HOST=redis
    REDIS_PORT=6379
    REDIS_PASSWORD=

    # If you are using external Redis Sentinel, please manually fill in the following content
    #
    # 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

    # If external Redis needs to enable TLS/SSL connection, refer to https://docs.jumpserver.org/zh/v3/installation/security_setup/redis_ssl/
    #
    # REDIS_USE_SSL=true

    ################################# Access Configuration ################################
    # The service port provided to the outside, if it conflicts with the existing service, please modify it yourself
    #
    HTTP_PORT=80

    ################################# HTTPS Configuration #################################
    # Refer to https://docs.jumpserver.org/zh/v3/installation/proxy/ for configuration
    #
    # HTTPS_PORT=443
    # SERVER_NAME=your_domain_name
    # SSL_CERTIFICATE=your_cert
    # SSL_CERTIFICATE_KEY=your_cert_key
    #

    # Nginx file upload and download size limit
    #
    CLIENT_MAX_BODY_SIZE=4096m

    ################################# Component Configuration #############################
    # Component registration use, by default, register to the core container, the cluster environment needs to be modified to the cluster vip address
    #
    CORE_HOST=http://core:8080
    PERIOD_TASK_ENABLED=true

    # Core Session definition,
    # SESSION_COOKIE_AGE indicates how many seconds the session expires after idling,
    # SESSION_EXPIRE_AT_BROWSER_CLOSE=true means that the session expires as soon as the browser is closed
    #
    # SESSION_COOKIE_AGE=86400
    SESSION_EXPIRE_AT_BROWSER_CLOSE=false

    # Trusted DOMAINS definition,
    # Define the trusted access IP, please modify according to the actual situation, if it is a public IP, please change to the corresponding public IP,
    # DOMAINS="demo.jumpserver.org:443"
    # DOMAINS="172.17.200.191:80"
    # DOMAINS="demo.jumpserver.org:443,172.17.200.191:80"
    DOMAINS=

    # Configure the components that do not need to be started, by default all components will be started, if you do not need a certain component, you can set {component name}_ENABLED to 0 to turn it off
    # CORE_ENABLED=0
    # CELERY_ENABLED=0
    # KOKO_ENABLED=0
    # LION_ENABLED=0
    # CHEN_ENABLED=0
    # WEB_ENABLED=0

    # Lion enables font smoothing to optimize the experience
    #
    JUMPSERVER_ENABLE_FONT_SMOOTHING=true

    ################################# XPack Configuration #################################
    # XPack package, invalid setting in open source version
    #
    SSH_PORT=2222
    RDP_PORT=3389
    XRDP_PORT=3390
    MAGNUS_MYSQL_PORT=33061
    MAGNUS_MARIADB_PORT=33062
    MAGNUS_REDIS_PORT=63790
    MAGNUS_POSTGRESQL_PORT=54320
    MAGNUS_SQLSERVER_PORT=14330
    MAGNUS_ORACLE_PORTS=30000-30030

    ################################## Other Configuration ################################
    # The terminal uses the host HOSTNAME as the identifier, automatically generated during the first installation
    #
    SERVER_HOSTNAME=${HOSTNAME}

    # Use built-in SLB, if the client IP address obtained by the Web page is not correct, please set USE_LB to 0
    # When USE_LB is set to 1, use the configuration proxy_set_header X-Forwarded-For $remote_addr
    # When USE_LB is set to 0, use the configuration proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
    USE_LB=1

    # The current running version number of JumpServer, automatically generated after installation and upgrade
    #
    TZ=Asia/Shanghai
    CURRENT_VERSION=
    ```
    ```sh
    # 安装
    ./jmsctl.sh install

    # 启动
    ./jmsctl.sh start
    ```

!!! info "安装完成后 JumpServer 配置文件路径为: /opt/jumpserver/config/config.txt"

!!! tip ""
    ```sh
    cd jumpserver-ce-{{ jumpserver.tag }}-x86_64

    # 启动
    ./jmsctl.sh start

    # 停止
    ./jmsctl.sh down

    # 卸载
    ./jmsctl.sh uninstall

    # 帮助
    ./jmsctl.sh -h
    ```

2. 环境访问

!!! info "安装成功后,通过浏览器访问登录 JumpServer" sh 地址: http://<JumpServer服务器IP地址>:<服务运行端口> 用户名: admin 密码: ChangeMe

登录页面

📄 offline_upgrade.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/setup_linux_standalone/offline_upgrade.md

离线升级

!!! warning "升级到 v4 前需要先升级到 v3 最新版本,否则升级将会直接失败"

OS/Arch Architecture Linux Kernel Offline Name
linux/amd64 x86_64 >= 4.0 jumpserver-ce-{{ jumpserver.tag }}-x86_64.tar.gz

1. 升级部署

!!! warning "" - 离线升级目前只支持 linux/amd64 架构,其他架构升级请参考 在线升级

=== "linux/amd64" !!! tip "" 从飞致云社区 下载最新的 linux/amd64 离线包{:target="_blank"}, 并上传到部署服务器的 /opt 目录。

!!! tip ""
    ```sh
    cd /opt
    tar -xf jumpserver-ce-{{ jumpserver.tag }}-x86_64.tar.gz
    cd jumpserver-ce-{{ jumpserver.tag }}-x86_64
    ```
    ```sh
    ./jmsctl.sh upgrade
    ./jmsctl.sh start
    ```

📄 online_install.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/setup_linux_standalone/online_install.md

在线安装

!!! info "安装所需命令, 参考 环境要求 手动安装"

OS/Arch Architecture Linux Kernel Offline Name
linux/amd64 x86_64 >= 4.0 jumpserver-installer-{{ jumpserver.tag }}.tar.gz

??? info "可以使用由 华为云 提供的容器镜像服务, 如果是用于生产环境, 推荐使用离线安装方式进行部署" | 区域 | 镜像仓库地址 | /opt/jumpserver/config/config.txt | Kubernetes values.yaml | OS/ARCH | | :----------- | :----------------------------------- | --------------------------------- | --------------------------------------------------- | -------------- | | 华北-北京一 | swr.cn-north-1.myhuaweicloud.com | DOCKER_IMAGE_MIRROR=1 | imageRegistry: swr.cn-north-1.myhuaweicloud.com | linux/amd64 | | 华南-广州 | swr.cn-south-1.myhuaweicloud.com | DOCKER_IMAGE_MIRROR=1 | imageRegistry: swr.cn-south-1.myhuaweicloud.com | linux/amd64 |

1. 安装部署

=== "中国大陆" !!! tip "" sh cd /opt wget https://resource.fit2cloud.com/jumpserver/installer/releases/download/{{ jumpserver.tag }}/jumpserver-installer-{{ jumpserver.tag }}.tar.gz tar -xf jumpserver-installer-{{ jumpserver.tag }}.tar.gz cd jumpserver-installer-{{ jumpserver.tag }}

=== "其他地区" !!! tip "" sh cd /opt wget https://github.com/jumpserver/installer/releases/download/{{ jumpserver.tag }}/jumpserver-installer-{{ jumpserver.tag }}.tar.gz tar -xf jumpserver-installer-{{ jumpserver.tag }}.tar.gz cd jumpserver-installer-{{ jumpserver.tag }}

!!! tip "" sh # 根据需要修改配置文件模板, 如果不清楚用途可以跳过修改 cat config-example.txt ```vim # JumpServer configuration file example. # # If you don't understand the purpose, you can skip modifying this configuration file, the system will automatically fill in # Complete parameter documentation https://docs.jumpserver.org/zh/v3/guide/env/

################################# Image Configuration #################################
#
# The connection to docker.io in China will timeout or the download speed will be slow, enable this option to use Huawei Cloud image acceleration
# Replace the old version DOCKER_IMAGE_PREFIX
#
# DOCKER_IMAGE_MIRROR=1

# Image pull policy Always, IfNotPresent
# Always means that the latest image will be pulled every time, IfNotPresent means that the image will be pulled only if it does not exist locally
#
# IMAGE_PULL_POLICY=Always

############################## Installation Configuration #############################
#
# JumpServer database persistence directory, by default, recordings, task logs are in this directory
# Please modify according to the actual situation, the database file (.sql) and configuration file backed up during the upgrade will also be saved to this directory
#
VOLUME_DIR=/data/jumpserver

# Encryption key, please ensure that SECRET_KEY is consistent with the old environment when migrating, do not use special strings
# (*) Warning: Keep this value secret.
# (*) Do not disclose SECRET_KEY to anyone
#
SECRET_KEY=

# The token used by the component to register with core, please keep BOOTSTRAP_TOKEN consistent with the old environment when migrating,
# Do not use special strings
# (*) Warning: Keep this value secret.
# (*) Do not disclose BOOTSTRAP_TOKEN to anyone
#
BOOTSTRAP_TOKEN=

# Log level INFO, WARN, ERROR
#
LOG_LEVEL=ERROR

# The network segment used by the JumpServer container, please do not conflict with the existing network, modify according to the actual situation
#
DOCKER_SUBNET=192.168.250.0/24

# ipv6 nat, no need to enable under normal circumstances
# If the host does not support ipv6, enabling this option will prevent the real client ip address from being obtained
#
USE_IPV6=0
DOCKER_SUBNET_IPV6=fc00:1010:1111:200::/64

################################# DB Configuration ####################################
# For external databases, you need to enter the correct database information, the system will automatically handle the built-in database
# (*) The password part must not contain single quotes and double quotes
#
DB_ENGINE=postgresql
DB_HOST=postgresql
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=
DB_NAME=jumpserver

# If external MySQL needs to enable TLS/SSL connection, refer to https://docs.jumpserver.org/zh/v3/installation/security_setup/mysql_ssl/
#
# DB_USE_SSL=true

################################# Redis Configuration #################################
# For external Redis, please enter the correct Redis information, the system will automatically handle the built-in Redis
# (*) The password part must not contain single quotes and double quotes
#
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_PASSWORD=

# If you are using external Redis Sentinel, please manually fill in the following content
#
# 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

# If external Redis needs to enable TLS/SSL connection, refer to https://docs.jumpserver.org/zh/v3/installation/security_setup/redis_ssl/
#
# REDIS_USE_SSL=true

################################# Access Configuration ################################
# The service port provided to the outside, if it conflicts with the existing service, please modify it yourself
#
HTTP_PORT=80

################################# HTTPS Configuration #################################
# Refer to https://docs.jumpserver.org/zh/v3/installation/proxy/ for configuration
#
# HTTPS_PORT=443
# SERVER_NAME=your_domain_name
# SSL_CERTIFICATE=your_cert
# SSL_CERTIFICATE_KEY=your_cert_key
#

# Nginx file upload and download size limit
#
CLIENT_MAX_BODY_SIZE=4096m

################################# Component Configuration #############################
# Component registration use, by default, register to the core container, the cluster environment needs to be modified to the cluster vip address
#
CORE_HOST=http://core:8080
PERIOD_TASK_ENABLED=true

# Core Session definition,
# SESSION_COOKIE_AGE indicates how many seconds the session expires after idling,
# SESSION_EXPIRE_AT_BROWSER_CLOSE=true means that the session expires as soon as the browser is closed
#
# SESSION_COOKIE_AGE=86400
SESSION_EXPIRE_AT_BROWSER_CLOSE=false

# Trusted DOMAINS definition,
# Define the trusted access IP, please modify according to the actual situation, if it is a public IP, please change to the corresponding public IP,
# DOMAINS="demo.jumpserver.org:443"
# DOMAINS="172.17.200.191:80"
# DOMAINS="demo.jumpserver.org:443,172.17.200.191:80"
DOMAINS=

# Configure the components that do not need to be started, by default all components will be started, if you do not need a certain component, you can set {component name}_ENABLED to 0 to turn it off
# CORE_ENABLED=0
# CELERY_ENABLED=0
# KOKO_ENABLED=0
# LION_ENABLED=0
# CHEN_ENABLED=0
# WEB_ENABLED=0

# Lion enables font smoothing to optimize the experience
#
JUMPSERVER_ENABLE_FONT_SMOOTHING=true

################################# XPack Configuration #################################
# XPack package, invalid setting in open source version
#
SSH_PORT=2222
RDP_PORT=3389
XRDP_PORT=3390
MAGNUS_MYSQL_PORT=33061
MAGNUS_MARIADB_PORT=33062
MAGNUS_REDIS_PORT=63790
MAGNUS_POSTGRESQL_PORT=54320
MAGNUS_SQLSERVER_PORT=14330
MAGNUS_ORACLE_PORTS=30000-30030

################################## Other Configuration ################################
# The terminal uses the host HOSTNAME as the identifier, automatically generated during the first installation
#
SERVER_HOSTNAME=${HOSTNAME}

# Use built-in SLB, if the client IP address obtained by the Web page is not correct, please set USE_LB to 0
# When USE_LB is set to 1, use the configuration proxy_set_header X-Forwarded-For $remote_addr
# When USE_LB is set to 0, use the configuration proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
USE_LB=1

# The current running version number of JumpServer, automatically generated after installation and upgrade
#
TZ=Asia/Shanghai
CURRENT_VERSION=
```
```sh
# 安装
./jmsctl.sh install

# 启动
./jmsctl.sh start
```

!!! info "安装完成后 JumpServer 配置文件路径为: /opt/jumpserver/config/config.txt"

!!! tip "" ```sh cd /opt/jumpserver-installer-{{ jumpserver.tag }}

# 启动
./jmsctl.sh start

# 停止
./jmsctl.sh down

# 卸载
./jmsctl.sh uninstall

# 帮助
./jmsctl.sh -h
```

2. 环境访问

!!! info "安装成功后,通过浏览器访问登录 JumpServer" sh 地址: http://<JumpServer服务器IP地址>:<服务运行端口> 用户名: admin 密码: ChangeMe 登录页面

📄 online_upgrade.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/setup_linux_standalone/online_upgrade.md

在线升级

!!! warning "升级到 v4 前需要先升级到 v3 最新版本,否则升级将会直接失败"

OS/Arch Architecture Linux Kernel Offline Name
linux/amd64 x86_64 >= 4.0 jumpserver-installer-{{ jumpserver.tag }}.tar.gz

1. 升级部署

=== "中国大陆" !!! tip "" sh cd /opt wget https://resource.fit2cloud.com/jumpserver/installer/releases/download/{{ jumpserver.tag }}/jumpserver-installer-{{ jumpserver.tag }}.tar.gz tar -xf jumpserver-installer-{{ jumpserver.tag }}.tar.gz cd jumpserver-installer-{{ jumpserver.tag }} === "其他地区" !!! tip "" sh cd /opt wget https://github.com/jumpserver/installer/releases/download/{{ jumpserver.tag }}/jumpserver-installer-{{ jumpserver.tag }}.tar.gz tar -xf jumpserver-installer-{{ jumpserver.tag }}.tar.gz cd jumpserver-installer-{{ jumpserver.tag }}

!!! tip "" ```sh ./jmsctl.sh upgrade

# 启动 JumpServer 服务
./jmsctl.sh start
```

📄 requirements.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/setup_linux_standalone/requirements.md

环境要求

1. 操作系统

!!! tip "" - 支持主流 Linux 发行版本(基于 Debian / RedHat,包括国产操作系统) - Gentoo / Arch Linux 请通过源码安装

操作系统 架构 Linux 内核 软件要求 最小化硬件配置
linux/amd64 x86_64 >= 4.0 wget curl tar gettext iptables python 2Core/8GB RAM/60G HDD
linux/arm64 aarch64 >= 4.0 wget curl tar gettext iptables python 2Core/8GB RAM/60G HDD

=== "Debian / Ubuntu" !!! tip "" sh apt-get update apt-get install -y wget curl tar gettext iptables

=== "RedHat / CentOS" !!! tip "" sh yum update yum install -y wget curl tar gettext iptables

2 数据库

!!! tip "JumpServer 需要使用 PostgreSQL、MySQL 或 MariaDB 存储数据,使用 Redis 缓存数据"

名称 版本 默认字符集 默认字符编码 TLS/SSL
PostgreSQL >= 9.6 UTF8 en_US.utf8 :material-check:
MySQL >= 5.7 utf8 utf8_general_ci :material-check:
MariaDB >= 10.6 utf8mb3 utf8mb3_general_ci :material-check:
名称 版本 Sentinel Cluster TLS/SSL
Redis >= 6.0 :material-check: :material-close: :material-check:

!!! tip "创建数据库 SQL 参考"

=== "PostgreSQL" !!! tip "" pgsql create database jumpserver with encoding='UTF8'; pgsql postgres=# \l List of databases Name | Owner | Encoding | Locale Provider | Collate | Ctype | ICU Locale | ICU Rules | Access privileges --------------+------------+----------+-----------------+------------+------------+------------+-----------+----------------------- jumpserver | postgres | UTF8 | libc | en_US.utf8 | en_US.utf8 | | | (1 rows)

=== "MySQL" !!! tip "" mysql create database jumpserver default charset 'utf8'; mysql mysql> show create database jumpserver; +------------+---------------------------------------------------------------------+ | Database | Create Database | +------------+---------------------------------------------------------------------+ | jumpserver | CREATE DATABASE `jumpserver` /*!40100 DEFAULT CHARACTER SET utf8 */ | +------------+---------------------------------------------------------------------+ 1 row in set (0.00 sec)

=== "MariaDB" !!! tip "" mysql create database jumpserver default charset 'utf8'; mysql MariaDB> show create database jumpserver; +------------+-----------------------------------------------------------------------+ | Database | Create Database | +------------+-----------------------------------------------------------------------+ | jumpserver | CREATE DATABASE `jumpserver` /*!40100 DEFAULT CHARACTER SET utf8mb3*/ | +------------+-----------------------------------------------------------------------+ 1 row in set (0.001 sec)

📄 core_install.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/source_install/core_install.md

Core 环境部署

1 Core 组件简述

!!! tip "" - Core 是 JumpServer 的核心组件,由 Django 二次开发而来,内置了 Gunicorn Celery Beat Flower Daphne 服务。

1.1 环境要求

!!! tip ""

| Name    | Core                     | Python |
| :------ | :----------------------- | :----- |
| Version | {{ jumpserver.tag }}     | 3.9    |

1.2 下载源代码

!!! tip "" - 可以从 Github 网站上获取最新的 [Release][core_release] 副本。这些版本是最新代码的稳定快照,从项目网站下载的源将采用 .tar.gz 存档的形式,通过命令行中提取该存档:

!!! tip "" bash cd /opt mkdir /opt/jumpserver-{{ jumpserver.tag }} wget -O /opt/jumpserver-{{ jumpserver.tag }}.tar.gz https://github.com/jumpserver/jumpserver/archive/refs/tags/{{ jumpserver.tag }}.tar.gz tar -xf jumpserver-{{ jumpserver.tag }}.tar.gz -C /opt/jumpserver-{{ jumpserver.tag }} --strip-components 1 cd jumpserver-{{ jumpserver.tag }} rm -f apps/common/utils/ip/geoip/GeoLite2-City.mmdb apps/common/utils/ip/ipip/ipipfree.ipdb wget https://download.jumpserver.org/files/ip/GeoLite2-City.mmdb -O apps/common/utils/ip/geoip/GeoLite2-City.mmdb wget https://download.jumpserver.org/files/ip/ipipfree.ipdb -O apps/common/utils/ip/ipip/ipipfree.ipdb

```bash
ls -l requirements/
```
```vim
requirements/           # 对应操作系统需要的依赖包
├── apk_pkg.sh          # Alpine
├── deb_pkg.sh          # 基于 Debian 的发行版(如: Ubuntu)
├── issues.txt          # macOS 一些问题及解决方案
├── mac_pkg.sh          # macOS
├── requirements.txt    # python
└── rpm_pkg.sh          # 基于 RedHat 的发行版(如: CentOS)
```

!!! tip "" === "Ubuntu 20.04" bash apt-get install -y pkg-config libxmlsec1-dev libpq-dev libffi-dev libxml2 libxslt-dev libldap2-dev libsasl2-dev sshpass mariadb-client bash-completion g++ make sshpass

    !!! warning "如果你安装的是 MySQL, 将 mariadb 开发包自行替换成 mysql, 或者不要将 数据库 和 Core 部署在一起"
    ```bash
    apt-get install -y libmariadb-dev
    ```

1.3 安装 Python3

!!! tip "" - 从 Python 网站获取部署 Python3 的方法,请根据 环境要求,通过命令行中判断是否安装完成:

!!! tip "" bash apt-get install -y python3.9 python3.9-dev python3.9-venv bash python3.9 python Python 3.9.5 (default, Nov 23 2021, 15:27:38) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>>

1.4 安装 Python 依赖

!!! tip "" - 为 JumpServer 项目单独创建 python3 虚拟环境。

```bash
python3.9 -m venv /opt/py3
source /opt/py3/bin/activate
```

- 每次运行项目都需要先执行 `source /opt/py3/bin/activate` 载入此环境。

```bash
poetry install
```

- 修改配置文件。

```bash
cp config_example.yml config.yml
vi config.yml
```
```yaml
# SECURITY WARNING: keep the secret key used in production secret!
# 加密秘钥 生产环境中请修改为随机字符串,请勿外泄, 可使用命令生成
# $ cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 48;echo
SECRET_KEY: ****************  # 必填项, 长度推荐 50 位以上

# SECURITY WARNING: keep the bootstrap token used in production secret!
# 预共享Token koko 和 lion 用来注册服务账号,不在使用原来的注册接受机制
# $ cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 24;echo
BOOTSTRAP_TOKEN: ***********  # 必填项, 长度推荐 20 位以上

# Development env open this, when error occur display the full process track, Production disable it
# DEBUG 模式 开启DEBUG后遇到错误时可以看到更多日志
DEBUG: true                   # 开发建议打开 DEBUG, 生产环境应该关闭

# DEBUG, INFO, WARNING, ERROR, CRITICAL can set. See https://docs.djangoproject.com/en/1.10/topics/logging/
# 日志级别
LOG_LEVEL: DEBUG              # 开发建议设置 DEBUG, 生产环境推荐使用 ERROR
# LOG_DIR:

# Session expiration setting, Default 24 hour, Also set expired on on browser close
# 浏览器Session过期时间,默认24小时, 也可以设置浏览器关闭则过期
# SESSION_COOKIE_AGE: 86400
SESSION_EXPIRE_AT_BROWSER_CLOSE: true  # 浏览器关闭 session 过期

# Database setting, Support sqlite3, mysql, postgres ....
# 数据库设置
# See https://docs.djangoproject.com/en/1.10/ref/settings/#databases

# SQLite setting:
# 使用单文件sqlite数据库
# DB_ENGINE: sqlite3
# DB_NAME:
# MySQL or postgres setting like:
# 使用Mysql作为数据库
DB_ENGINE: mysql
DB_HOST: 127.0.0.1       # 自行配置 数据库相关
DB_PORT: 3306
DB_USER: jumpserver
DB_PASSWORD: ********
DB_NAME: jumpserver

# When Django start it will bind this host and port
# ./manage.py runserver 127.0.0.1:8080
# 运行时绑定端口, 将会使用 0.0.0.0:8080 0.0.0.0:8070 端口
HTTP_BIND_HOST: 0.0.0.0
HTTP_LISTEN_PORT: 8080
WS_LISTEN_PORT: 8070

# Use Redis as broker for celery and web socket
# Redis配置
REDIS_HOST: 127.0.0.1    # 自行配置 Redis 相关
REDIS_PORT: 6379
REDIS_PASSWORD: ********
# REDIS_DB_CELERY: 3
# REDIS_DB_CACHE: 4

# Use OpenID Authorization
# 使用 OpenID 进行认证设置
# AUTH_OPENID: False # True or False
# BASE_SITE_URL: None
# AUTH_OPENID_CLIENT_ID: client-id
# AUTH_OPENID_CLIENT_SECRET: client-secret
# AUTH_OPENID_PROVIDER_ENDPOINT: https://op-example.com/
# AUTH_OPENID_PROVIDER_AUTHORIZATION_ENDPOINT: https://op-example.com/authorize
# AUTH_OPENID_PROVIDER_TOKEN_ENDPOINT: https://op-example.com/token
# AUTH_OPENID_PROVIDER_JWKS_ENDPOINT: https://op-example.com/jwks
# AUTH_OPENID_PROVIDER_USERINFO_ENDPOINT: https://op-example.com/userinfo
# AUTH_OPENID_PROVIDER_END_SESSION_ENDPOINT: https://op-example.com/logout
# AUTH_OPENID_PROVIDER_SIGNATURE_ALG: HS256
# AUTH_OPENID_PROVIDER_SIGNATURE_KEY: None
# AUTH_OPENID_SCOPES: "openid profile email"
# AUTH_OPENID_ID_TOKEN_MAX_AGE: 60
# AUTH_OPENID_ID_TOKEN_INCLUDE_CLAIMS: True
# AUTH_OPENID_USE_STATE: True
# AUTH_OPENID_USE_NONCE: True
# AUTH_OPENID_SHARE_SESSION: True
# AUTH_OPENID_IGNORE_SSL_VERIFICATION: True
# AUTH_OPENID_ALWAYS_UPDATE_USER: True

# Use Radius authorization
# 使用Radius来认证
# AUTH_RADIUS: false
# RADIUS_SERVER: localhost
# RADIUS_PORT: 1812
# RADIUS_SECRET:

# CAS 配置
# AUTH_CAS': False,
# CAS_SERVER_URL': "http://host/cas/",
# CAS_ROOT_PROXIED_AS': 'http://jumpserver-host:port',  
# CAS_LOGOUT_COMPLETELY': True,
# CAS_VERSION': 3,

# LDAP/AD settings
# LDAP 搜索分页数量
# AUTH_LDAP_SEARCH_PAGED_SIZE: 1000
#
# 定时同步用户
# 启用 / 禁用
# AUTH_LDAP_SYNC_IS_PERIODIC: True
# 同步间隔 (单位: 时) (优先)
# AUTH_LDAP_SYNC_INTERVAL: 12
# Crontab 表达式
# AUTH_LDAP_SYNC_CRONTAB: * 6 * * *
#
# LDAP 用户登录时仅允许在用户列表中的用户执行 LDAP Server 认证
# AUTH_LDAP_USER_LOGIN_ONLY_IN_USERS: False
#
# LDAP 认证时如果日志中出现以下信息将参数设置为 0 (详情参见:https://www.python-ldap.org/en/latest/faq.html)
# In order to perform this operation a successful bind must be completed on the connection
# AUTH_LDAP_OPTIONS_OPT_REFERRALS: -1

# OTP settings
# OTP/MFA 配置
# OTP_VALID_WINDOW: 0
# OTP_ISSUER_NAME: Jumpserver

# Perm show single asset to ungrouped node
# 是否把未授权节点资产放入到 未分组 节点中
# PERM_SINGLE_ASSET_TO_UNGROUP_NODE: False
#
# 同一账号仅允许在一台设备登录
# USER_LOGIN_SINGLE_MACHINE_ENABLED: False
#
# 启用定时任务
# PERIOD_TASK_ENABLE: True
#
# 启用二次复合认证配置
# LOGIN_CONFIRM_ENABLE: False
#
# Windows 登录跳过手动输入密码
# WINDOWS_SKIP_ALL_MANUAL_PASSWORD: False
```

- 处理国际化。

```bash
rm -f apps/locale/zh/LC_MESSAGES/django.mo apps/locale/zh/LC_MESSAGES/djangojs.mo
python apps/manage.py compilemessages
```

1.5 启动 Core

!!! tip "" - 后台运行可以加 -d,./jms start -d

```bash
./jms start
```

[core_release]: https://github.com/jumpserver/jumpserver/releases/tag/{{ jumpserver.tag }}

[lina_release]: https://github.com/jumpserver/lina/releases/tag/{{ jumpserver.tag }}

[luna_release]: https://github.com/jumpserver/luna/releases/tag/{{ jumpserver.tag }} [koko_release]: https://github.com/jumpserver/koko/releases/tag/{{ jumpserver.tag }}

[koko_release]: https://github.com/jumpserver/koko/releases/tag/{{ jumpserver.tag }}

[lion_release]: https://github.com/jumpserver/lion-release/releases/tag/{{ jumpserver.tag }}

[wisp_release]: https://github.com/jumpserver/wisp/releases/tag/{{ jumpserver.wisp }}

[magnus_release]: https://github.com/jumpserver/magnus-release/releases/tag/{{ jumpserver.tag }} [lina-{{ jumpserver.tag }}]: https://github.com/jumpserver/lina/releases/download/{{ jumpserver.tag }}/lina-{{ jumpserver.tag }}.tar.gz [luna-{{ jumpserver.tag }}]: https://github.com/jumpserver/luna/releases/download/{{ jumpserver.tag }}/luna-{{ jumpserver.tag }}.tar.gz [koko-{{ jumpserver.tag }}-linux-amd64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-linux-amd64.tar.gz [koko-{{ jumpserver.tag }}-linux-arm64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-linux-arm64.tar.gz [koko-{{ jumpserver.tag }}-linux-loong64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-linux-loong64.tar.gz [koko-{{ jumpserver.tag }}-darwin-amd64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-darwin-amd64.tar.gz [koko-{{ jumpserver.tag }}-darwin-arm64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-darwin-arm64.tar.gz [lion-{{ jumpserver.tag }}-linux-amd64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-linux-amd64.tar.gz [lion-{{ jumpserver.tag }}-linux-arm64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-linux-arm64.tar.gz [lion-{{ jumpserver.tag }}-linux-loong64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-linux-loong64.tar.gz [lion-{{ jumpserver.tag }}-darwin-amd64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-darwin-amd64.tar.gz [lion-{{ jumpserver.tag }}-windows-amd64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-windows-amd64.tar.gz [magnus-{{ jumpserver.tag }}-linux-amd64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-linux-amd64.tar.gz [magnus-{{ jumpserver.tag }}-linux-arm64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-linux-arm64.tar.gz [magnus-{{ jumpserver.tag }}-linux-loong64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-linux-loong64.tar.gz [magnus-{{ jumpserver.tag }}-darwin-amd64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-darwin-amd64.tar.gz [magnus-{{ jumpserver.tag }}-darwin-arm64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-darwin-arm64.tar.gz [wisp-{{ jumpserver.wisp }}-linux-amd64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-linux-amd64.tar.gz [wisp-{{ jumpserver.wisp }}-linux-arm64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-linux-arm64.tar.gz [wisp-{{ jumpserver.wisp }}-linux-loong64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-linux-loong64.tar.gz [wisp-{{ jumpserver.wisp }}-darwin-amd64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-darwin-amd64.tar.gz [wisp-{{ jumpserver.wisp }}-darwin-arm64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-darwin-arm64.tar.gz [wisp-{{ jumpserver.wisp }}-windows-amd64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-windows-amd64.tar.gz

📄 koko_install.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/source_install/koko_install.md

KoKo 环境部署

1 KoKo 组件简述

!!! tip "" Koko 是 Go 版本的 coco,重构了 coco 的 SSH/SFTP 服务和 Web Terminal 服务。

1.1 环境要求

!!! tip ""

| Name    | KoKo                     | Go   | Node  | Redis Client |
| :------ | :----------------------- | :--  | :---- | :----------- |
| Version | {{ jumpserver.tag }}     | 1.18 | 16.5  | >= 6.0       |

1.2 选择部署方式

!!! tip "" === "源代码部署"

    - 下载源代码。
    - 从项目网站下载 Source code.tar.gz 源代码,通过命令行中提取该存档:

    ```bash
    cd /opt
    mkdir /opt/koko-{{ jumpserver.tag }}
    wget -O /opt/koko-{{ jumpserver.tag }}.tar.gz https://github.com/jumpserver/koko/archive/refs/tags/{{ jumpserver.tag }}.tar.gz
    tar -xf koko-{{ jumpserver.tag }}.tar.gz -C /opt/koko-{{ jumpserver.tag }} --strip-components 1
    ```

    - 安装 Node。
    - 从 [Node][node] 官方网站参考文档部署 Node.js,请根据 [环境要求](#_10),通过命令行中判断是否安装完成。

    ```bash
    node -v
    ```
    `v16.5`

    - 安装 Client 依赖。

    === "Ubuntu 20.04"
        ```bash
        apt-get update
        apt install software-properties-common
        add-apt-repository -y ppa:redislabs/redis
        apt-get install -y mariadb-client bash-completion redis-tools
        cd /opt
        mkdir /opt/kubectl-aliases
        wget http://download.jumpserver.org/public/kubectl_aliases.tar.gz -O kubectl_aliases.tar.gz
        tar -xf kubectl_aliases.tar.gz -C /opt/kubectl-aliases
        ```

    - 安装 Go。
    - [Go][go] 官方网站参考文档部署 golang,请根据 [环境要求](#_14),通过命令行中判断是否安装完成:

    === "Ubuntu 20.04"
        ```bash
        cd /opt
        wget https://golang.google.cn/dl/go1.18.7.linux-amd64.tar.gz
        tar -xf go1.18.7.linux-amd64.tar.gz -C /usr/local/
        chown -R root:root /usr/local/go
        export PATH=/usr/local/go/bin:$PATH
        echo 'export PATH=/usr/local/go/bin:$PATH' >> ~/.bashrc
        ```

    ```bash
    go version
    ```
    `go version go1.18.7 linux/amd64`

    - 编译。

    | OS    | Arch  | Command     |
    | :---- | :---- | :---------- |
    | Linux | amd64 | make linux  |
    | macOS | amd64 | make darwin |

    ```bash
    cd /opt/koko-{{ jumpserver.tag }}
    make
    cp build/koko-{{ jumpserver.tag }}-linux-amd64.tar.gz /opt
    ```

    !!! tip "构建完成后, 生成在 build 目录下"

=== "使用 Release"

    - 下载 Release 文件。
    - 从 [Github][koko] 网站上获取最新的 [Release][koko_release] 副本。这些版本是最新代码的稳定快照。

    | OS     | Arch    | Name                                                                                              |
    | :----- | :------ | :------------------------------------------------------------------------------------------------ |
    | Linux  | amd64   | [koko-{{ jumpserver.tag }}-linux-amd64.tar.gz][koko-{{ jumpserver.tag }}-linux-amd64]     |
    | Linux  | arm64   | [koko-{{ jumpserver.tag }}-linux-arm64.tar.gz][koko-{{ jumpserver.tag }}-linux-arm64]     |
    | linux  | loong64 | [koko-{{ jumpserver.tag }}-linux-loong64.tar.gz][koko-{{ jumpserver.tag }}-linux-loong64] |
    | Darwin | amd64   | [koko-{{ jumpserver.tag }}-darwin-amd64.tar.gz][koko-{{ jumpserver.tag }}-darwin-amd64]   |
    | Darwin | arm64   | [koko-{{ jumpserver.tag }}-darwin-arm64.tar.gz][koko-{{ jumpserver.tag }}-darwin-arm64]   |

    === "Linux/amd64"
        ```bash
        cd /opt
        wget https://download.jumpserver.org/public/kubectl-linux-amd64.tar.gz -O kubectl.tar.gz
        tar -xf kubectl.tar.gz
        mv kubectl /usr/local/bin/rawkubectl
        wget https://download.jumpserver.org/public/helm-v3.9.0-linux-amd64.tar.gz
        tar -xf helm-v3.9.0-linux-amd64.tar.gz
        mv linux-amd64/helm /usr/local/bin/rawhelm
        chmod 755 /usr/local/bin/rawkubectl /usr/local/bin/rawhelm
        chown root:root /usr/local/bin/rawkubectl /usr/local/bin/rawhelm
        rm -rf linux-amd64
        wget https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-linux-amd64.tar.gz
        tar -xf koko-{{ jumpserver.tag }}-linux-amd64.tar.gz -C /opt
        cd koko-{{ jumpserver.tag }}-linux-amd64
        mv kubectl /usr/local/bin/kubectl
        ```

    === "Linux/arm64"
        ```bash
        cd /opt
        wget https://download.jumpserver.org/public/kubectl-linux-arm64.tar.gz -O kubectl.tar.gz
        tar -xzf kubectl.tar.gz
        mv kubectl /usr/local/bin/rawkubectl
        wget https://download.jumpserver.org/public/helm-v3.9.0-linux-arm64.tar.gz
        tar -xf helm-v3.9.0-linux-arm64.tar.gz
        mv linux-arm64/helm /usr/local/bin/rawhelm
        chmod 755 /usr/local/bin/rawkubectl /usr/local/bin/rawhelm
        chown root:root /usr/local/bin/rawkubectl /usr/local/bin/rawhelm
        rm -rf linux-arm64
        wget https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-linux-arm64.tar.gz
        tar -xf koko-{{ jumpserver.tag }}-linux-arm64.tar.gz -C /opt
        cd koko-{{ jumpserver.tag }}-linux-arm64
        mv kubectl /usr/local/bin/kubectl
        ```

1.3 修改配置文件

!!! tip "" bash cp config_example.yml config.yml vi config.yml ```yaml # 项目名称, 会用来向Jumpserver注册, 识别而已, 不能重复 # NAME: {{ Hostname }}

# Jumpserver项目的url, api请求注册会使用
CORE_HOST: http://127.0.0.1:8080   # Core 的地址

# Bootstrap Token, 预共享秘钥, 用来注册coco使用的service account和terminal
# 请和jumpserver 配置文件中保持一致,注册完成后可以删除
BOOTSTRAP_TOKEN: ********  # 和 Core config.yml 的值保持一致

# 启动时绑定的ip, 默认 0.0.0.0
BIND_HOST: 0.0.0.0

# 监听的SSH端口号, 默认2222
SSHD_PORT: 2222            # 使用 0.0.0.0:2222

# 监听的HTTP/WS端口号,默认5000
HTTPD_PORT: 5000           # 使用 0.0.0.0:5000

# 项目使用的ACCESS KEY, 默认会注册,并保存到 ACCESS_KEY_STORE中,
# 如果有需求, 可以写到配置文件中, 格式 access_key_id:access_key_secret
# ACCESS_KEY: null

# ACCESS KEY 保存的地址, 默认注册后会保存到该文件中
# ACCESS_KEY_FILE: data/keys/.access_key

# 设置日志级别 [DEBUG, INFO, WARN, ERROR, FATAL, CRITICAL]
LOG_LEVEL: DEBUG           # 开发建议设置 DEBUG, 生产环境推荐使用 ERROR

# SSH连接超时时间 (default 15 seconds)
# SSH_TIMEOUT: 15

# 语言 [en,zh]
# LANGUAGE_CODE: zh

# SFTP的根目录, 可选 /tmp, Home其他自定义目录
# SFTP_ROOT: /tmp

# SFTP是否显示隐藏文件
# SFTP_SHOW_HIDDEN_FILE: false

# 是否复用和用户后端资产已建立的连接(用户不会复用其他用户的连接)
# REUSE_CONNECTION: true

# 资产加载策略, 可根据资产规模自行调整. 默认异步加载资产, 异步搜索分页; 如果为all, 则资产全部加载, 本地搜索分页.
# ASSET_LOAD_POLICY:

# zip压缩的最大额度 (单位: M)
# ZIP_MAX_SIZE: 1024M

# zip压缩存放的临时目录 /tmp
# ZIP_TMP_PATH: /tmp

# 向 SSH Client 连接发送心跳的时间间隔 (单位: 秒),默认为30, 0则表示不发送
# CLIENT_ALIVE_INTERVAL: 30

# 向资产发送心跳包的重试次数,默认为3
# RETRY_ALIVE_COUNT_MAX: 3

# 会话共享使用的类型 [local, redis], 默认local
# SHARE_ROOM_TYPE: local

# Redis配置
# REDIS_HOST: 127.0.0.1      # 如果需要部署多个 koko, 需要通过 redis 来保持会话
# REDIS_PORT: 6379
# REDIS_PASSWORD:
# REDIS_CLUSTERS:
# REDIS_DB_ROOM:
```

1.4 启动 KoKo

!!! tip "" bash ./koko

[core_release]: https://github.com/jumpserver/jumpserver/releases/tag/{{ jumpserver.tag }}

[lina_release]: https://github.com/jumpserver/lina/releases/tag/{{ jumpserver.tag }}

[luna_release]: https://github.com/jumpserver/luna/releases/tag/{{ jumpserver.tag }} [koko_release]: https://github.com/jumpserver/koko/releases/tag/{{ jumpserver.tag }}

[koko_release]: https://github.com/jumpserver/koko/releases/tag/{{ jumpserver.tag }}

[lion_release]: https://github.com/jumpserver/lion-release/releases/tag/{{ jumpserver.tag }}

[wisp_release]: https://github.com/jumpserver/wisp/releases/tag/{{ jumpserver.wisp }}

[magnus_release]: https://github.com/jumpserver/magnus-release/releases/tag/{{ jumpserver.tag }} [lina-{{ jumpserver.tag }}]: https://github.com/jumpserver/lina/releases/download/{{ jumpserver.tag }}/lina-{{ jumpserver.tag }}.tar.gz [luna-{{ jumpserver.tag }}]: https://github.com/jumpserver/luna/releases/download/{{ jumpserver.tag }}/luna-{{ jumpserver.tag }}.tar.gz [koko-{{ jumpserver.tag }}-linux-amd64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-linux-amd64.tar.gz [koko-{{ jumpserver.tag }}-linux-arm64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-linux-arm64.tar.gz [koko-{{ jumpserver.tag }}-linux-loong64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-linux-loong64.tar.gz [koko-{{ jumpserver.tag }}-darwin-amd64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-darwin-amd64.tar.gz [koko-{{ jumpserver.tag }}-darwin-arm64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-darwin-arm64.tar.gz [lion-{{ jumpserver.tag }}-linux-amd64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-linux-amd64.tar.gz [lion-{{ jumpserver.tag }}-linux-arm64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-linux-arm64.tar.gz [lion-{{ jumpserver.tag }}-linux-loong64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-linux-loong64.tar.gz [lion-{{ jumpserver.tag }}-darwin-amd64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-darwin-amd64.tar.gz [lion-{{ jumpserver.tag }}-windows-amd64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-windows-amd64.tar.gz [magnus-{{ jumpserver.tag }}-linux-amd64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-linux-amd64.tar.gz [magnus-{{ jumpserver.tag }}-linux-arm64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-linux-arm64.tar.gz [magnus-{{ jumpserver.tag }}-linux-loong64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-linux-loong64.tar.gz [magnus-{{ jumpserver.tag }}-darwin-amd64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-darwin-amd64.tar.gz [magnus-{{ jumpserver.tag }}-darwin-arm64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-darwin-arm64.tar.gz [wisp-{{ jumpserver.wisp }}-linux-amd64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-linux-amd64.tar.gz [wisp-{{ jumpserver.wisp }}-linux-arm64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-linux-arm64.tar.gz [wisp-{{ jumpserver.wisp }}-linux-loong64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-linux-loong64.tar.gz [wisp-{{ jumpserver.wisp }}-darwin-amd64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-darwin-amd64.tar.gz [wisp-{{ jumpserver.wisp }}-darwin-arm64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-darwin-arm64.tar.gz [wisp-{{ jumpserver.wisp }}-windows-amd64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-windows-amd64.tar.gz

📄 lina_install.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/source_install/lina_install.md

Lina 环境部署

1 Lina 组件简述

!!! tip "" - Lina 是 JumpServer 的前端 UI 项目,主要使用 VueElement UI 完成。

1.1 环境要求

!!! tip ""

| Name    | Lina                     | Node  |
| :------ | :----------------------- | :---- |
| Version | {{ jumpserver.tag }}     | 16.5  |

1.2 选择部署方式

!!! tip "" === "源代码部署"
- 下载源代码。 - 从 Github 下载 Source code.tar.gz 源代码,通过命令行中提取该存档:

    ```bash
    cd /opt
    mkdir /opt/lina-{{ jumpserver.tag }}
    wget -O /opt/lina-{{ jumpserver.tag }}.tar.gz https://github.com/jumpserver/lina/archive/refs/tags/{{ jumpserver.tag }}.tar.gz
    tar -xf lina-{{ jumpserver.tag }}.tar.gz -C /opt/lina-{{ jumpserver.tag }} --strip-components 1
    ```

    - 安装 Node。
    - 从 [Node][node] 官方网站参考文档部署 Node.js,请根据 [环境要求](#_6),通过命令行中判断是否安装完成:

    === "Ubuntu 20.04"
        ```bash
        cd /opt
        wget https://nodejs.org/download/release/v16.5.0/node-v16.5.0-linux-x64.tar.xz
        tar -xf node-v16.5.0-linux-x64.tar.xz
        mv node-v16.5.0-linux-x64 /usr/local/node
        chown -R root:root /usr/local/node
        export PATH=/usr/local/node/bin:$PATH
        echo 'export PATH=/usr/local/node/bin:$PATH' >> ~/.bashrc
        ```
    ```bash
    node -v
    ```
    `v16.5`

    - 安装依赖。

    ```bash
    cd /opt/lina-{{ jumpserver.tag }}
    npm install -g yarn
    yarn install
    ```

    - 修改配置文件。

    ```bash
    sed -i "s@Version <strong>.*</strong>@Version <strong>{{ jumpserver.tag }}</strong>@g" src/layout/components/Footer/index.vue
    vi .env.development
    ```
    ```yaml
    # 全局环境变量 请勿随意改动
    ENV = 'development'

    # base api
    VUE_APP_BASE_API = ''
    VUE_APP_PUBLIC_PATH = '/ui/'

    # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
    # to control whether the babel-plugin-dynamic-import-node plugin is enabled.
    # It only does one thing by converting all import() to require().
    # This configuration can significantly increase the speed of hot updates,
    # when you have a large number of pages.
    # Detail:  https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/babel-preset-app/index.js

    VUE_CLI_BABEL_TRANSPILE_MODULES = true

    # External auth
    VUE_APP_LOGIN_PATH = '/core/auth/login/'
    VUE_APP_LOGOUT_PATH = '/core/auth/logout/'

    # Dev server for core proxy
    VUE_APP_CORE_HOST = 'http://localhost:8080'  # 修改成 Core 的 url 地址
    VUE_APP_CORE_WS = 'ws://localhost:8070'
    VUE_APP_ENV = 'development'
    ```

    - 运行 Lina。

    ```bash
    yarn serve
    ```

    - 构建 Lina。

    ```bash
    yarn build
    cp -rf lina lina-{{ jumpserver.tag }}
    tar -czf lina-{{ jumpserver.tag }}.tar.gz lina-{{ jumpserver.tag }}
    ```

    !!! tip "构建完成后, 生成在 lina 目录下"

=== "使用 Release"

    - 下载 Release 文件,从 [Github][lina] 网站上获取最新的 [Release][lina_release] 副本。
    - 这些版本是最新代码的稳定快照。

    | OS     | Arch  | Name                                                          |
    | :----- | :---- | :------------------------------------------------------------ |
    | All    | All   | [lina-{{ jumpserver.tag }}.tar.gz][lina-{{ jumpserver.tag }}] |

    ```bash
    cd /opt
    wget https://github.com/jumpserver/lina/releases/download/{{ jumpserver.tag }}/lina-{{ jumpserver.tag }}.tar.gz
    tar -xf lina-{{ jumpserver.tag }}.tar.gz
    ```

[core_release]: https://github.com/jumpserver/jumpserver/releases/tag/{{ jumpserver.tag }}

[lina_release]: https://github.com/jumpserver/lina/releases/tag/{{ jumpserver.tag }}

[luna_release]: https://github.com/jumpserver/luna/releases/tag/{{ jumpserver.tag }} [koko_release]: https://github.com/jumpserver/koko/releases/tag/{{ jumpserver.tag }}

[koko_release]: https://github.com/jumpserver/koko/releases/tag/{{ jumpserver.tag }}

[lion_release]: https://github.com/jumpserver/lion-release/releases/tag/{{ jumpserver.tag }}

[wisp_release]: https://github.com/jumpserver/wisp/releases/tag/{{ jumpserver.wisp }}

[magnus_release]: https://github.com/jumpserver/magnus-release/releases/tag/{{ jumpserver.tag }} [lina-{{ jumpserver.tag }}]: https://github.com/jumpserver/lina/releases/download/{{ jumpserver.tag }}/lina-{{ jumpserver.tag }}.tar.gz [luna-{{ jumpserver.tag }}]: https://github.com/jumpserver/luna/releases/download/{{ jumpserver.tag }}/luna-{{ jumpserver.tag }}.tar.gz [koko-{{ jumpserver.tag }}-linux-amd64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-linux-amd64.tar.gz [koko-{{ jumpserver.tag }}-linux-arm64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-linux-arm64.tar.gz [koko-{{ jumpserver.tag }}-linux-loong64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-linux-loong64.tar.gz [koko-{{ jumpserver.tag }}-darwin-amd64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-darwin-amd64.tar.gz [koko-{{ jumpserver.tag }}-darwin-arm64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-darwin-arm64.tar.gz [lion-{{ jumpserver.tag }}-linux-amd64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-linux-amd64.tar.gz [lion-{{ jumpserver.tag }}-linux-arm64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-linux-arm64.tar.gz [lion-{{ jumpserver.tag }}-linux-loong64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-linux-loong64.tar.gz [lion-{{ jumpserver.tag }}-darwin-amd64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-darwin-amd64.tar.gz [lion-{{ jumpserver.tag }}-windows-amd64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-windows-amd64.tar.gz [magnus-{{ jumpserver.tag }}-linux-amd64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-linux-amd64.tar.gz [magnus-{{ jumpserver.tag }}-linux-arm64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-linux-arm64.tar.gz [magnus-{{ jumpserver.tag }}-linux-loong64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-linux-loong64.tar.gz [magnus-{{ jumpserver.tag }}-darwin-amd64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-darwin-amd64.tar.gz [magnus-{{ jumpserver.tag }}-darwin-arm64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-darwin-arm64.tar.gz [wisp-{{ jumpserver.wisp }}-linux-amd64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-linux-amd64.tar.gz [wisp-{{ jumpserver.wisp }}-linux-arm64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-linux-arm64.tar.gz [wisp-{{ jumpserver.wisp }}-linux-loong64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-linux-loong64.tar.gz [wisp-{{ jumpserver.wisp }}-darwin-amd64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-darwin-amd64.tar.gz [wisp-{{ jumpserver.wisp }}-darwin-arm64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-darwin-arm64.tar.gz [wisp-{{ jumpserver.wisp }}-windows-amd64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-windows-amd64.tar.gz

📄 lion_install.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/source_install/lion_install.md

Lion 环境部署

1 Lion 组件简述

!!! tip "" Lion 使用了 Apache 软件基金会的开源项目 Guacamole,JumpServer 使用 Golang 和 Vue 重构了 Guacamole 实现 RDP/VNC 协议跳板机功能。

1.1 环境要求

!!! tip ""

| Name    | JumpServer               | Guacd                  |  Lion                    |
| :------ | :----------------------- | :--------------------- | :----------------------- |
| Version | {{ jumpserver.tag }}     | [1.4.0][guacd-1.4.0]   | {{ jumpserver.tag }} |

- 可以从 [Github][guacamole-server] 网站上获取对应的 guacd 副本。这些版本是最新代码的稳定快照,从项目网站下载 Source code.tar.gz 源代码,通过命令行中提取该存档:

```bash
mkdir /opt/guacamole-{{ jumpserver.tag }}
cd /opt/guacamole-{{ jumpserver.tag }}
wget http://download.jumpserver.org/public/guacamole-server-1.4.0.tar.gz
tar -xzf guacamole-server-1.4.0.tar.gz
cd guacamole-server-1.4.0/
```

- 参考 [building-guacamole-server][building-guacamole-server] 官方文档,安装对应操作系统的依赖包。

=== "Ubuntu 20.04"
    ```bash
    apt-get install -y libcairo2-dev libjpeg-turbo8-dev libpng-dev libtool-bin libossp-uuid-dev
    apt-get install -y libavcodec-dev libavformat-dev libavutil-dev libswscale-dev freerdp2-dev libpango1.0-dev libssh2-1-dev libtelnet-dev libvncserver-dev libwebsockets-dev     libpulse-dev libssl-dev libvorbis-dev libwebp-dev
    ```

1.2 构建 Guacd

!!! tip "" bash ./configure --with-init-dir=/etc/init.d make make install ldconfig

!!! tip ""
- 如果希望使用 systemd 管理, 可以使用 ./configure --with-systemd-dir=/etc/systemd/system/

1.3 下载 Lion

!!! tip "" - 可以从 Github 网站上获取最新的 [Release][lion_release] 副本。

| OS      | Arch    | Name                                                                                              |
| :------ | :------ | :------------------------------------------------------------------------------------------------ |
| Linux   | amd64   | [lion-{{ jumpserver.tag }}-linux-amd64.tar.gz][lion-{{ jumpserver.tag }}-linux-amd64]     |
| Linux   | arm64   | [lion-{{ jumpserver.tag }}-linux-arm64.tar.gz][lion-{{ jumpserver.tag }}-linux-arm64]     |
| Linux   | loong64 | [lion-{{ jumpserver.tag }}-linux-loong64.tar.gz][lion-{{ jumpserver.tag }}-linux-loong64] |
| Darwin  | amd64   | [lion-{{ jumpserver.tag }}-darwin-amd64.tar.gz][lion-{{ jumpserver.tag }}-darwin-amd64]   |
| Windows | amd64   | [lion-{{ jumpserver.tag }}-windows-amd64.tar.gz][lion-{{ jumpserver.tag }}-windows-amd64] |

!!! tip "" === "Linux/amd64" bash cd /opt wget https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-linux-amd64.tar.gz tar -xf lion-{{ jumpserver.tag }}-linux-amd64.tar.gz cd lion-{{ jumpserver.tag }}-linux-amd64

=== "Linux/arm64"
    ```bash
    cd /opt
    wget https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-linux-arm64.tar.gz
    tar -xf lion-{{ jumpserver.tag }}-linux-arm64.tar.gz
    cd lion-{{ jumpserver.tag }}-linux-arm64
    ```

1.4 修改配置文件

!!! tip "" bash cp config_example.yml config.yml vi config.yml ```yaml # 项目名称, 会用来向Jumpserver注册, 识别而已, 不能重复 # NAME: {{ Hostname }}

# Jumpserver项目的url, api请求注册会使用
CORE_HOST: http://127.0.0.1:8080   # Core 的地址

# Bootstrap Token, 预共享秘钥, 用来注册使用的service account和terminal
# 请和jumpserver 配置文件中保持一致,注册完成后可以删除
BOOTSTRAP_TOKEN: ********  # 和 Core config.yml 的值保持一致

# 启动时绑定的ip, 默认 0.0.0.0
BIND_HOST: 0.0.0.0

# 监听的HTTP/WS端口号,默认8081
HTTPD_PORT: 8081

# 设置日志级别 [DEBUG, INFO, WARN, ERROR, FATAL, CRITICAL]
LOG_LEVEL: DEBUG           # 开发建议设置 DEBUG, 生产环境推荐使用 ERROR

# Guacamole Server ip,默认127.0.0.1
# GUA_HOST: 127.0.0.1

# Guacamole Server 端口号,默认4822
# GUA_PORT: 4822

# 会话共享使用的类型 [local, redis], 默认local
# SHARE_ROOM_TYPE: local

# Redis配置
# REDIS_HOST: 127.0.0.1
# REDIS_PORT: 6379
# REDIS_PASSWORD:
# REDIS_DB_ROOM:
```

1.5 启动 Guacd

!!! tip "" bash /etc/init.d/guacd start

1.6 启动 Lion

!!! tip "" bash ./lion

[core_release]: https://github.com/jumpserver/jumpserver/releases/tag/{{ jumpserver.tag }}

[lina_release]: https://github.com/jumpserver/lina/releases/tag/{{ jumpserver.tag }}

[luna_release]: https://github.com/jumpserver/luna/releases/tag/{{ jumpserver.tag }} [koko_release]: https://github.com/jumpserver/koko/releases/tag/{{ jumpserver.tag }}

[koko_release]: https://github.com/jumpserver/koko/releases/tag/{{ jumpserver.tag }}

[lion_release]: https://github.com/jumpserver/lion-release/releases/tag/{{ jumpserver.tag }}

[wisp_release]: https://github.com/jumpserver/wisp/releases/tag/{{ jumpserver.wisp }}

[magnus_release]: https://github.com/jumpserver/magnus-release/releases/tag/{{ jumpserver.tag }} [lina-{{ jumpserver.tag }}]: https://github.com/jumpserver/lina/releases/download/{{ jumpserver.tag }}/lina-{{ jumpserver.tag }}.tar.gz [luna-{{ jumpserver.tag }}]: https://github.com/jumpserver/luna/releases/download/{{ jumpserver.tag }}/luna-{{ jumpserver.tag }}.tar.gz [koko-{{ jumpserver.tag }}-linux-amd64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-linux-amd64.tar.gz [koko-{{ jumpserver.tag }}-linux-arm64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-linux-arm64.tar.gz [koko-{{ jumpserver.tag }}-linux-loong64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-linux-loong64.tar.gz [koko-{{ jumpserver.tag }}-darwin-amd64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-darwin-amd64.tar.gz [koko-{{ jumpserver.tag }}-darwin-arm64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-darwin-arm64.tar.gz [lion-{{ jumpserver.tag }}-linux-amd64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-linux-amd64.tar.gz [lion-{{ jumpserver.tag }}-linux-arm64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-linux-arm64.tar.gz [lion-{{ jumpserver.tag }}-linux-loong64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-linux-loong64.tar.gz [lion-{{ jumpserver.tag }}-darwin-amd64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-darwin-amd64.tar.gz [lion-{{ jumpserver.tag }}-windows-amd64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-windows-amd64.tar.gz [magnus-{{ jumpserver.tag }}-linux-amd64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-linux-amd64.tar.gz [magnus-{{ jumpserver.tag }}-linux-arm64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-linux-arm64.tar.gz [magnus-{{ jumpserver.tag }}-linux-loong64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-linux-loong64.tar.gz [magnus-{{ jumpserver.tag }}-darwin-amd64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-darwin-amd64.tar.gz [magnus-{{ jumpserver.tag }}-darwin-arm64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-darwin-arm64.tar.gz [wisp-{{ jumpserver.wisp }}-linux-amd64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-linux-amd64.tar.gz [wisp-{{ jumpserver.wisp }}-linux-arm64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-linux-arm64.tar.gz [wisp-{{ jumpserver.wisp }}-linux-loong64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-linux-loong64.tar.gz [wisp-{{ jumpserver.wisp }}-darwin-amd64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-darwin-amd64.tar.gz [wisp-{{ jumpserver.wisp }}-darwin-arm64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-darwin-arm64.tar.gz [wisp-{{ jumpserver.wisp }}-windows-amd64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-windows-amd64.tar.gz

📄 luna_install.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/source_install/luna_install.md

Luna 环境部署

1 Luna 组件简述

!!! tip "" Luna 是 JumpServer 的前端 UI 项目,主要使用 Angular CLI 完成。

1.1 环境要求

!!! tip ""

| Name    | Luna                     | Node  |
| :------ | :----------------------- | :---- |
| Version | {{ jumpserver.tag }}     | 16.5 |

1.2 选择部署方式

!!! tip "" === "源代码部署"

    - 下载源代码。
    - 可以从 [Github][luna] 网站上获取最新的 [Release][core_release] 副本。这些版本是最新代码的稳定快照,从项目网站下载 Source code.tar.gz 源代码,通过命令行中提取该存档:

    ```bash
    cd /opt
    mkdir /opt/luna-{{ jumpserver.tag }}
    wget -O /opt/luna-{{ jumpserver.tag }}.tar.gz https://github.com/jumpserver/luna/archive/refs/tags/{{ jumpserver.tag }}.tar.gz
    tar -xf luna-{{ jumpserver.tag }}.tar.gz -C /opt/luna-{{ jumpserver.tag }} --strip-components 1
    ```

    - 安装 Node。
    - 从 [Node][node] 官方网站参考文档部署 Node.js,请根据 [环境要求](#_10),通过命令行中判断是否安装完成:

    ```bash
    node -v
    ```
    `v16.5`

    - 安装依赖。

    ```bash
    cd /opt/luna-{{ jumpserver.tag }}
    yarn install
    ```

    - 修改配置文件。

    ```bash
    sed -i "s@[0-9].[0-9].[0-9]@{{ jumpserver.tag }}@g" src/environments/environment.prod.ts
    vi proxy.conf.json
    ```
    ```yaml
    {
      "/koko": {
        "target": "http://localhost:5000",  # KoKo 地址
        "secure": false,
        "ws": true
      },
      "/media/": {
        "target": "http://localhost:8080",  # Core 地址
        "secure": false,
        "changeOrigin": true
      },
      "/api/": {
        "target": "http://localhost:8080",  # Core 地址
        "secure": false,                    # https ssl 需要开启
        "changeOrigin": true
      },
      "/core": {
        "target": "http://localhost:8080",  # Core 地址
        "secure": false,
        "changeOrigin": true
      },
      "/static": {
        "target": "http://localhost:8080",  # Core 地址
        "secure": false,
        "changeOrigin": true
      },
      "/lion": {
        "target": "http://localhost:9529",  # Lion 地址
        "secure": false,
        "pathRewrite": {
          "^/lion/monitor": "/monitor"
        },
        "ws": true,
        "changeOrigin": true
      },
      "/omnidb": {
        "target": "http://localhost:8082",
        "secure": false,
        "ws": true,
        "changeOrigin": true
      }
    }
    ```

    - 运行 Luna。

    ```bash
    ./node_modules/.bin/ng serve
    ```

    - 构建 Luna。

    ```bash
    yarn build
    cp -R src/assets/i18n luna/
    cp -rf luna luna-{{ jumpserver.tag }}
    tar -czf luna-{{ jumpserver.tag }}.tar.gz luna-{{ jumpserver.tag }}
    ```

    !!! tip "构建完成后, 生成在 luna 目录下"

=== "使用 Release"

    - 下载 Release 文件,从 [Github][luna] 网站上获取最新的 [Release][luna_release] 副本。
    - 这些版本是最新代码的稳定快照。

    | OS     | Arch  | Name                                                          |
    | :----- | :---- | :------------------------------------------------------------ |
    | All    | All   | [luna-{{ jumpserver.tag }}.tar.gz][luna-{{ jumpserver.tag }}] |

    ```bash
    cd /opt
    wget https://github.com/jumpserver/luna/releases/download/{{ jumpserver.tag }}/luna-{{ jumpserver.tag }}.tar.gz
    tar -xf luna-{{ jumpserver.tag }}.tar.gz
    ```

[core_release]: https://github.com/jumpserver/jumpserver/releases/tag/{{ jumpserver.tag }}

[lina_release]: https://github.com/jumpserver/lina/releases/tag/{{ jumpserver.tag }}

[luna_release]: https://github.com/jumpserver/luna/releases/tag/{{ jumpserver.tag }} [koko_release]: https://github.com/jumpserver/koko/releases/tag/{{ jumpserver.tag }}

[koko_release]: https://github.com/jumpserver/koko/releases/tag/{{ jumpserver.tag }}

[lion_release]: https://github.com/jumpserver/lion-release/releases/tag/{{ jumpserver.tag }}

[wisp_release]: https://github.com/jumpserver/wisp/releases/tag/{{ jumpserver.wisp }}

[magnus_release]: https://github.com/jumpserver/magnus-release/releases/tag/{{ jumpserver.tag }} [lina-{{ jumpserver.tag }}]: https://github.com/jumpserver/lina/releases/download/{{ jumpserver.tag }}/lina-{{ jumpserver.tag }}.tar.gz [luna-{{ jumpserver.tag }}]: https://github.com/jumpserver/luna/releases/download/{{ jumpserver.tag }}/luna-{{ jumpserver.tag }}.tar.gz [koko-{{ jumpserver.tag }}-linux-amd64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-linux-amd64.tar.gz [koko-{{ jumpserver.tag }}-linux-arm64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-linux-arm64.tar.gz [koko-{{ jumpserver.tag }}-linux-loong64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-linux-loong64.tar.gz [koko-{{ jumpserver.tag }}-darwin-amd64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-darwin-amd64.tar.gz [koko-{{ jumpserver.tag }}-darwin-arm64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-darwin-arm64.tar.gz [lion-{{ jumpserver.tag }}-linux-amd64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-linux-amd64.tar.gz [lion-{{ jumpserver.tag }}-linux-arm64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-linux-arm64.tar.gz [lion-{{ jumpserver.tag }}-linux-loong64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-linux-loong64.tar.gz [lion-{{ jumpserver.tag }}-darwin-amd64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-darwin-amd64.tar.gz [lion-{{ jumpserver.tag }}-windows-amd64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-windows-amd64.tar.gz [magnus-{{ jumpserver.tag }}-linux-amd64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-linux-amd64.tar.gz [magnus-{{ jumpserver.tag }}-linux-arm64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-linux-arm64.tar.gz [magnus-{{ jumpserver.tag }}-linux-loong64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-linux-loong64.tar.gz [magnus-{{ jumpserver.tag }}-darwin-amd64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-darwin-amd64.tar.gz [magnus-{{ jumpserver.tag }}-darwin-arm64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-darwin-arm64.tar.gz [wisp-{{ jumpserver.wisp }}-linux-amd64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-linux-amd64.tar.gz [wisp-{{ jumpserver.wisp }}-linux-arm64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-linux-arm64.tar.gz [wisp-{{ jumpserver.wisp }}-linux-loong64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-linux-loong64.tar.gz [wisp-{{ jumpserver.wisp }}-darwin-amd64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-darwin-amd64.tar.gz [wisp-{{ jumpserver.wisp }}-darwin-arm64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-darwin-arm64.tar.gz [wisp-{{ jumpserver.wisp }}-windows-amd64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-windows-amd64.tar.gz

📄 magnus_install.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/source_install/magnus_install.md

Magnus 环境部署

1 Magnus 环境部署

1.1 环境要求

!!! tip "" - 可以从 Github 网站上获取最新的 [Release][magnus_release] 副本。

| 操作系统 | 架构类型 | 名称                                                                                         |
| :------ | :------ | :-------------------------------------------------------------------------------------------- |
| Linux   | amd64   | [magnus-{{ jumpserver.tag }}-linux-amd64.tar.gz][magnus-{{ jumpserver.tag }}-linux-amd64]     |
| Linux   | arm64   | [magnus-{{ jumpserver.tag }}-linux-arm64.tar.gz][magnus-{{ jumpserver.tag }}-linux-arm64]     |
| Linux   | loong64 | [magnus-{{ jumpserver.tag }}-linux-loong64.tar.gz][magnus-{{ jumpserver.tag }}-linux-loong64] |
| Darwin  | amd64   | [magnus-{{ jumpserver.tag }}-darwin-amd64.tar.gz][magnus-{{ jumpserver.tag }}-darwin-amd64]   |
| Darwin  | arm64   | [magnus-{{ jumpserver.tag }}-darwin-arm64.tar.gz][magnus-{{ jumpserver.tag }}-darwin-arm64]   |

!!! tip "" - Magnus 需要使用 Wisp 与 JumpServer 通信,从 Github 网站上获取最新的 [Release][wisp_release] 副本。

| 操作系统 | 架构类型 | 名称                                                                                       |
| :------ | :------ | :------------------------------------------------------------------------------------------ |
| Linux   | amd64   | [wisp-{{ jumpserver.wisp }}-linux-amd64.tar.gz][wisp-{{ jumpserver.wisp }}-linux-amd64]     |
| Linux   | arm64   | [wisp-{{ jumpserver.wisp }}-linux-arm64.tar.gz][wisp-{{ jumpserver.wisp }}-linux-arm64]     |
| Linux   | loong64 | [wisp-{{ jumpserver.wisp }}-linux-loong64.tar.gz][wisp-{{ jumpserver.wisp }}-linux-loong64] |
| Darwin  | amd64   | [wisp-{{ jumpserver.wisp }}-darwin-amd64.tar.gz][wisp-{{ jumpserver.wisp }}-darwin-amd64]   |
| Darwin  | arm64   | [wisp-{{ jumpserver.wisp }}-darwin-arm64.tar.gz][wisp-{{ jumpserver.wisp }}-darwin-arm64]   |
| Windows | amd64   | [wisp-{{ jumpserver.wisp }}-windows-amd64.tar.gz][wisp-{{ jumpserver.wisp }}-windows-amd64] |

1.2 选择部署方式

!!! tip "" === "Linux/amd64"

    - 解压缩包。

    ```bash
    cd /opt
    wget https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-linux-amd64.tar.gz
    tar -xf magnus-{{ jumpserver.tag }}-linux-amd64.tar.gz
    cd magnus-{{ jumpserver.tag }}-linux-amd64
    ```
    ```bash
    wget https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-linux-amd64.tar.gz
    tar -xf wisp-{{ jumpserver.wisp }}-linux-amd64.tar.gz
    mv wisp-{{ jumpserver.wisp }}-linux-amd64/wisp /usr/local/bin/
    chown root:root /usr/local/bin/wisp /opt/magnus-{{ jumpserver.tag }}-linux-amd64/magnus
    chmod 755 /usr/local/bin/wisp /opt/magnus-{{ jumpserver.tag }}-linux-amd64/magnus
    ```

    - 修改配置文件。

    ```bash
    cp config_example.yml config.yml
    vi config.yml
    ```
    ```yaml
    # Jumpserver项目的url, api请求注册会使用
    CORE_HOST: http://127.0.0.1:8080   # Core 的地址

    # Bootstrap Token, 预共享秘钥, 用来注册使用的service account和terminal
    # 请和jumpserver 配置文件中保持一致,注册完成后可以删除
    BOOTSTRAP_TOKEN: ********  # 和 Core config.yml 的值保持一致

    # 服务 bind 地址
    BIND_HOST: "0.0.0.0"

    # 数据库代理暴露的端口
    MYSQL_PORT: 33060
    MARIA_DB_PORT: 33061
    POSTGRESQL_PORT: 54320

    # 日志级别
    LOG_LEVEL: "info"

    # jumpserver api grpc 组件地址
    WISP_HOST: "localhost"
    WISP_PORT: 9090
    ```

    - 启动 Wisp。

    ```bash
    export CORE_HOST="http://127.0.0.1:8080"   # Core 的地址
    export BOOTSTRAP_TOKEN=********            # 和 Core config.yml 的值保持一致
    export WORK_DIR="/opt/magnus-{{ jumpserver.tag }}-linux-amd64"
    export COMPONENT_NAME="magnus"
    export EXECUTE_PROGRAM="/opt/magnus-{{ jumpserver.tag }}-linux-amd64/magnus"
    wisp
    ```

=== "Linux/arm64"

    - 解压缩包。

    ```bash
    cd /opt
    wget https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-linux-arm64.tar.gz
    tar -xf magnus-{{ jumpserver.tag }}-linux-arm64.tar.gz
    cd magnus-{{ jumpserver.tag }}-linux-arm64
    ```
    ```bash
    wget https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-linux-arm64.tar.gz
    tar -xf wisp-{{ jumpserver.wisp }}-linux-arm64.tar.gz
    mv wisp-{{ jumpserver.wisp }}-linux-arm64/wisp /usr/local/bin/
    chown root:root /usr/local/bin/wisp /opt/magnus-{{ jumpserver.tag }}-linux-arm64/magnus
    chmod 755 /usr/local/bin/wisp /opt/magnus-{{ jumpserver.tag }}-linux-arm64/magnus
    ```

    - 修改配置文件。

    ```bash
    cp config_example.yml config.yml
    vi config.yml
    ```
    ```yaml
    # Jumpserver项目的url, api请求注册会使用
    CORE_HOST: http://127.0.0.1:8080   # Core 的地址

    # Bootstrap Token, 预共享秘钥, 用来注册使用的service account和terminal
    # 请和jumpserver 配置文件中保持一致,注册完成后可以删除
    BOOTSTRAP_TOKEN: ********  # 和 Core config.yml 的值保持一致

    # 服务 bind 地址
    BIND_HOST: "0.0.0.0"

    # 数据库代理暴露的端口
    MYSQL_PORT: 33060
    MARIA_DB_PORT: 33061
    POSTGRESQL_PORT: 54320

    # 日志级别
    LOG_LEVEL: "info"

    # jumpserver api grpc 组件地址
    WISP_HOST: "localhost"
    WISP_PORT: 9090
    ```

    - 启动 Wisp。

    ```bash
    export CORE_HOST="http://127.0.0.1:8080"   # Core 的地址
    export BOOTSTRAP_TOKEN=********            # 和 Core config.yml 的值保持一致
    export WORK_DIR="/opt/magnus-{{ jumpserver.tag }}-linux-arm64"
    export COMPONENT_NAME="magnus"
    export EXECUTE_PROGRAM="/opt/magnus-{{ jumpserver.tag }}-linux-arm64/magnus"
    wisp
    ```

[core_release]: https://github.com/jumpserver/jumpserver/releases/tag/{{ jumpserver.tag }}

[lina_release]: https://github.com/jumpserver/lina/releases/tag/{{ jumpserver.tag }}

[luna_release]: https://github.com/jumpserver/luna/releases/tag/{{ jumpserver.tag }} [koko_release]: https://github.com/jumpserver/koko/releases/tag/{{ jumpserver.tag }}

[koko_release]: https://github.com/jumpserver/koko/releases/tag/{{ jumpserver.tag }}

[lion_release]: https://github.com/jumpserver/lion-release/releases/tag/{{ jumpserver.tag }}

[wisp_release]: https://github.com/jumpserver/wisp/releases/tag/{{ jumpserver.wisp }}

[magnus_release]: https://github.com/jumpserver/magnus-release/releases/tag/{{ jumpserver.tag }} [lina-{{ jumpserver.tag }}]: https://github.com/jumpserver/lina/releases/download/{{ jumpserver.tag }}/lina-{{ jumpserver.tag }}.tar.gz [luna-{{ jumpserver.tag }}]: https://github.com/jumpserver/luna/releases/download/{{ jumpserver.tag }}/luna-{{ jumpserver.tag }}.tar.gz [koko-{{ jumpserver.tag }}-linux-amd64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-linux-amd64.tar.gz [koko-{{ jumpserver.tag }}-linux-arm64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-linux-arm64.tar.gz [koko-{{ jumpserver.tag }}-linux-loong64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-linux-loong64.tar.gz [koko-{{ jumpserver.tag }}-darwin-amd64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-darwin-amd64.tar.gz [koko-{{ jumpserver.tag }}-darwin-arm64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-darwin-arm64.tar.gz [lion-{{ jumpserver.tag }}-linux-amd64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-linux-amd64.tar.gz [lion-{{ jumpserver.tag }}-linux-arm64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-linux-arm64.tar.gz [lion-{{ jumpserver.tag }}-linux-loong64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-linux-loong64.tar.gz [lion-{{ jumpserver.tag }}-darwin-amd64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-darwin-amd64.tar.gz [lion-{{ jumpserver.tag }}-windows-amd64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-windows-amd64.tar.gz [magnus-{{ jumpserver.tag }}-linux-amd64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-linux-amd64.tar.gz [magnus-{{ jumpserver.tag }}-linux-arm64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-linux-arm64.tar.gz [magnus-{{ jumpserver.tag }}-linux-loong64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-linux-loong64.tar.gz [magnus-{{ jumpserver.tag }}-darwin-amd64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-darwin-amd64.tar.gz [magnus-{{ jumpserver.tag }}-darwin-arm64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-darwin-arm64.tar.gz [wisp-{{ jumpserver.wisp }}-linux-amd64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-linux-amd64.tar.gz [wisp-{{ jumpserver.wisp }}-linux-arm64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-linux-arm64.tar.gz [wisp-{{ jumpserver.wisp }}-linux-loong64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-linux-loong64.tar.gz [wisp-{{ jumpserver.wisp }}-darwin-amd64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-darwin-amd64.tar.gz [wisp-{{ jumpserver.wisp }}-darwin-arm64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-darwin-arm64.tar.gz [wisp-{{ jumpserver.wisp }}-windows-amd64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-windows-amd64.tar.gz

📄 merge_jumpserver.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/source_install/merge_jumpserver.md

JumpServer 环境整合

1 操作过程

1.1 编辑配置文件

!!! tip ""

```bash
vi /etc/nginx/conf.d/jumpserver.conf
```

1.2 选择部署方式

!!! tip "" === "源代码部署"

    ```nginx
    server {
      listen 80;
      # server_name _;

      client_max_body_size 5000m; # 文件大小限制

      # Luna 配置
      location /luna/ {
        # 注意将模板中的组件名称替换为服务实际 ip 地址, 如都在本机部署
        # proxy_pass       http://127.0.0.1:4200;
        proxy_pass http://luna:4200;
      }

      # Core data 静态资源
      location /media/replay/ {
        add_header Content-Encoding gzip;
        root /opt/jumpserver-{{ jumpserver.tag }}/data/;
      }

      location /static/ {
        root /opt/jumpserver-{{ jumpserver.tag }}/data/;
      }

      # KoKo Lion 配置
      location /koko/ {
        # 注意将模板中的组件名称替换为服务实际 ip 地址, 如都在本机部署
        # proxy_pass       http://127.0.0.1:5000;
        proxy_pass       http://koko:5000;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_http_version 1.1;
        proxy_buffering off;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
      }

      # lion 配置
      location /lion/ {
        # 注意将模板中的组件名称替换为服务实际 ip 地址, 如都在本机部署
        # proxy_pass       http://127.0.0.1:8081;
        proxy_pass http://lion:8081;
        proxy_buffering off;
        proxy_request_buffering off;
        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $http_connection;
        proxy_ignore_client_abort on;
        proxy_connect_timeout 600;
        proxy_send_timeout 600;
        proxy_read_timeout 600;
        send_timeout 6000;
      }

      location /ws/ {
        # 注意将模板中的组件名称替换为服务实际 ip 地址, 如都在本机部署
        # proxy_pass       http://127.0.0.1:8080;
        proxy_pass http://core:8080;
        proxy_buffering off;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      }

      location ~ ^/(core|api|media)/ {
        # 注意将模板中的组件名称替换为服务实际 ip 地址, 如都在本机部署
        # proxy_pass       http://127.0.0.1:8080;
        proxy_pass http://core:8080;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      }

      # 前端 Lina
      location /ui/ {
        # 注意将模板中的组件名称替换为服务实际 ip 地址, 如都在本机部署
        # proxy_pass       http://127.0.0.1:9528;
        proxy_pass http://lina:9528;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      }

      location / {
        rewrite ^/(.*)$ /ui/$1 last;
      }
    }
    ```

=== "使用 Release"

    ```nginx
    server {
      listen 80;
      # server_name _;

      client_max_body_size 5000m; # 文件大小限制

      # 前端 Lina
      location /ui/ {
        try_files $uri / /index.html;
        alias /opt/lina-{{ jumpserver.tag }}/;
        expires 24h;
      }

      # Luna 配置
      location /luna/ {
        try_files $uri / /index.html;
        alias /opt/luna-{{ jumpserver.tag }}/;
        expires 24h;
      }

      # Core data 静态资源
      location /media/replay/ {
        add_header Content-Encoding gzip;
        root /opt/jumpserver-{{ jumpserver.tag }}/data/;
      }

      location /static/ {
        root /opt/jumpserver-{{ jumpserver.tag }}/data/;
        expires 24h;
      }

      # KoKo Lion 配置
      location /koko/ {
        # 注意将模板中的组件名称替换为服务实际 ip 地址, 如都在本机部署
        # proxy_pass       http://127.0.0.1:5000;
        proxy_pass       http://koko:5000;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_http_version 1.1;
        proxy_buffering off;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
      }

      # lion 配置
      location /lion/ {
        # 注意将模板中的组件名称替换为服务实际 ip 地址, 如都在本机部署
        # proxy_pass       http://127.0.0.1:8081;
        proxy_pass http://lion:8081;
        proxy_buffering off;
        proxy_request_buffering off;
        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $http_connection;
        proxy_ignore_client_abort on;
        proxy_connect_timeout 600;
        proxy_send_timeout 600;
        proxy_read_timeout 600;
        send_timeout 6000;
      }

      location /ws/ {
        # 注意将模板中的组件名称替换为服务实际 ip 地址, 如都在本机部署
        # proxy_pass       http://127.0.0.1:8080;
        proxy_pass http://core:8080;
        proxy_buffering off;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      }

      location ~ ^/(core|api|media)/ {
        # 注意将模板中的组件名称替换为服务实际 ip 地址, 如都在本机部署
        # proxy_pass       http://127.0.0.1:8080;
        proxy_pass http://core:8080;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      }

      location / {
        rewrite ^/(.*)$ /ui/$1 last;
      }
    }
    ```

```bash
nginx -t
```
```bash
nginx -s reload
```

📄 nginx_install.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/source_install/nginx_install.md

Nginx 环境部署

1 操作过程

!!! tip "" - 从 Nginx 官方网站上获取 Nginx 的最新发行版本 linux_packages,通过命令行验证安装是否完成:

=== "Ubuntu 20.04"
    ```bash
    apt-get install -y curl gnupg2 ca-certificates lsb-release ubuntu-keyring
    echo "deb http://nginx.org/packages/ubuntu focal nginx" > /etc/apt/sources.list.d/nginx.list
    curl -o /etc/apt/trusted.gpg.d/nginx_signing.asc https://nginx.org/keys/nginx_signing.key
    apt-get update
    apt-get install -y nginx
    echo > /etc/nginx/conf.d/default.conf
    ```

```bash
nginx -v
```
`nginx version: nginx/1.20.2`

[core_release]: https://github.com/jumpserver/jumpserver/releases/tag/{{ jumpserver.tag }}

[lina_release]: https://github.com/jumpserver/lina/releases/tag/{{ jumpserver.tag }}

[luna_release]: https://github.com/jumpserver/luna/releases/tag/{{ jumpserver.tag }} [koko_release]: https://github.com/jumpserver/koko/releases/tag/{{ jumpserver.tag }}

[koko_release]: https://github.com/jumpserver/koko/releases/tag/{{ jumpserver.tag }}

[lion_release]: https://github.com/jumpserver/lion-release/releases/tag/{{ jumpserver.tag }}

[wisp_release]: https://github.com/jumpserver/wisp/releases/tag/{{ jumpserver.wisp }}

[magnus_release]: https://github.com/jumpserver/magnus-release/releases/tag/{{ jumpserver.tag }} [lina-{{ jumpserver.tag }}]: https://github.com/jumpserver/lina/releases/download/{{ jumpserver.tag }}/lina-{{ jumpserver.tag }}.tar.gz [luna-{{ jumpserver.tag }}]: https://github.com/jumpserver/luna/releases/download/{{ jumpserver.tag }}/luna-{{ jumpserver.tag }}.tar.gz [koko-{{ jumpserver.tag }}-linux-amd64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-linux-amd64.tar.gz [koko-{{ jumpserver.tag }}-linux-arm64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-linux-arm64.tar.gz [koko-{{ jumpserver.tag }}-linux-loong64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-linux-loong64.tar.gz [koko-{{ jumpserver.tag }}-darwin-amd64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-darwin-amd64.tar.gz [koko-{{ jumpserver.tag }}-darwin-arm64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-darwin-arm64.tar.gz [lion-{{ jumpserver.tag }}-linux-amd64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-linux-amd64.tar.gz [lion-{{ jumpserver.tag }}-linux-arm64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-linux-arm64.tar.gz [lion-{{ jumpserver.tag }}-linux-loong64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-linux-loong64.tar.gz [lion-{{ jumpserver.tag }}-darwin-amd64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-darwin-amd64.tar.gz [lion-{{ jumpserver.tag }}-windows-amd64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-windows-amd64.tar.gz [magnus-{{ jumpserver.tag }}-linux-amd64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-linux-amd64.tar.gz [magnus-{{ jumpserver.tag }}-linux-arm64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-linux-arm64.tar.gz [magnus-{{ jumpserver.tag }}-linux-loong64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-linux-loong64.tar.gz [magnus-{{ jumpserver.tag }}-darwin-amd64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-darwin-amd64.tar.gz [magnus-{{ jumpserver.tag }}-darwin-arm64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-darwin-arm64.tar.gz [wisp-{{ jumpserver.wisp }}-linux-amd64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-linux-amd64.tar.gz [wisp-{{ jumpserver.wisp }}-linux-arm64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-linux-arm64.tar.gz [wisp-{{ jumpserver.wisp }}-linux-loong64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-linux-loong64.tar.gz [wisp-{{ jumpserver.wisp }}-darwin-amd64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-darwin-amd64.tar.gz [wisp-{{ jumpserver.wisp }}-darwin-arm64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-darwin-arm64.tar.gz [wisp-{{ jumpserver.wisp }}-windows-amd64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-windows-amd64.tar.gz

📄 requirements.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/source_install/requirements.md

环境说明

!!! warning "Windows 平台推荐使用 VSCode 的 Remote SSH 功能在 Linux 上进行编译"

1 架构图

!!! tip "" - JumpServer 分为多个组件,大致的架构如下图所示,其中 LinaLuna 为纯静态文件,最终由 Nginx 整合。 !架构图

2 数据库要求

!!! tip "" - MySQL 和 MariaDB 二选一即可, JumpServer 需要使用 MySQL 或 MariaDB 存储数据。

| Name    | Core                     | MySQL  | MariaDB | Redis |
| :------ | :----------------------- | :----- | :------ | :---- |
| Version | {{ jumpserver.tag }} | >= 5.7 | >= 10.3 | >= 6.0  |

3 部署顺序

!!! tip "" 1.Core 环境部署

2.Lina 环境部署

3.Luna 环境部署

4.KoKo 环境部署

5.Lion 环境部署

6.Magnus 环境部署

7.Nginx 环境部署

8.JumpServer 环境整合

[core_release]: https://github.com/jumpserver/jumpserver/releases/tag/{{ jumpserver.tag }}

[lina_release]: https://github.com/jumpserver/lina/releases/tag/{{ jumpserver.tag }}

[luna_release]: https://github.com/jumpserver/luna/releases/tag/{{ jumpserver.tag }} [koko_release]: https://github.com/jumpserver/koko/releases/tag/{{ jumpserver.tag }}

[koko_release]: https://github.com/jumpserver/koko/releases/tag/{{ jumpserver.tag }}

[lion_release]: https://github.com/jumpserver/lion-release/releases/tag/{{ jumpserver.tag }}

[wisp_release]: https://github.com/jumpserver/wisp/releases/tag/{{ jumpserver.wisp }}

[magnus_release]: https://github.com/jumpserver/magnus-release/releases/tag/{{ jumpserver.tag }} [lina-{{ jumpserver.tag }}]: https://github.com/jumpserver/lina/releases/download/{{ jumpserver.tag }}/lina-{{ jumpserver.tag }}.tar.gz [luna-{{ jumpserver.tag }}]: https://github.com/jumpserver/luna/releases/download/{{ jumpserver.tag }}/luna-{{ jumpserver.tag }}.tar.gz [koko-{{ jumpserver.tag }}-linux-amd64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-linux-amd64.tar.gz [koko-{{ jumpserver.tag }}-linux-arm64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-linux-arm64.tar.gz [koko-{{ jumpserver.tag }}-linux-loong64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-linux-loong64.tar.gz [koko-{{ jumpserver.tag }}-darwin-amd64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-darwin-amd64.tar.gz [koko-{{ jumpserver.tag }}-darwin-arm64]: https://github.com/jumpserver/koko/releases/download/{{ jumpserver.tag }}/koko-{{ jumpserver.tag }}-darwin-arm64.tar.gz [lion-{{ jumpserver.tag }}-linux-amd64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-linux-amd64.tar.gz [lion-{{ jumpserver.tag }}-linux-arm64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-linux-arm64.tar.gz [lion-{{ jumpserver.tag }}-linux-loong64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-linux-loong64.tar.gz [lion-{{ jumpserver.tag }}-darwin-amd64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-darwin-amd64.tar.gz [lion-{{ jumpserver.tag }}-windows-amd64]: https://github.com/jumpserver/lion-release/releases/download/{{ jumpserver.tag }}/lion-{{ jumpserver.tag }}-windows-amd64.tar.gz [magnus-{{ jumpserver.tag }}-linux-amd64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-linux-amd64.tar.gz [magnus-{{ jumpserver.tag }}-linux-arm64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-linux-arm64.tar.gz [magnus-{{ jumpserver.tag }}-linux-loong64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-linux-loong64.tar.gz [magnus-{{ jumpserver.tag }}-darwin-amd64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-darwin-amd64.tar.gz [magnus-{{ jumpserver.tag }}-darwin-arm64]: https://github.com/jumpserver/magnus-release/releases/download/{{ jumpserver.tag }}/magnus-{{ jumpserver.tag }}-darwin-arm64.tar.gz [wisp-{{ jumpserver.wisp }}-linux-amd64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-linux-amd64.tar.gz [wisp-{{ jumpserver.wisp }}-linux-arm64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-linux-arm64.tar.gz [wisp-{{ jumpserver.wisp }}-linux-loong64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-linux-loong64.tar.gz [wisp-{{ jumpserver.wisp }}-darwin-amd64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-darwin-amd64.tar.gz [wisp-{{ jumpserver.wisp }}-darwin-arm64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-darwin-arm64.tar.gz [wisp-{{ jumpserver.wisp }}-windows-amd64]: https://github.com/jumpserver/wisp/releases/download/{{ jumpserver.wisp }}/wisp-{{ jumpserver.wisp }}-windows-amd64.tar.gz

📄 upgrade_notice.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/installation/upgrade_notice.md

升级须知

!!! warning "v3 版本与 v2 版本存在一定的差异,如需 v2 版本升级至 v3 版本 请先阅读此文档{:target="_blank"}" !!! warning "v2.20 =< Version <= v2.23 之间的版本需先升级到 v2.28 版本,再升级到 v3 版本,否则会出现资产连接失败的问题"

!!! warning "注意" v3.6 版本为了安全,要求强制填写 DOMAINS 可信任域名才能正常访问服务,否则会提示错误码 400/403 导致无法无法访问页面,DOMAINS 配置如下。

- 如果服务器是一键安装并且旧版本就已经使用 JumpServer 开启了 HTTPS,则不需要进行任何更改。
- 需要使用 IP 地址来访问 JumpServer 的场景,可以根据自己的 IP 类型来填写 config.txt 配置文件中 DOMAINS 字段为公网 IP 还是内网 IP。

```
  # 打开config.txt 配置文件,定义 DOMAINS 字段
  vim /opt/jumpserver/config/config.txt

  # 可信任 DOMAINS 定义,
  # 定义可信任的访问 IP, 请根据实际情况修改, 如果是公网 IP 请改成对应的公网 IP。
  # DOMAINS="demo.jumpserver.org"    # 使用域名访问
  # DOMAINS="172.17.200.191"         # 使用 IP 访问
  # DOMAINS="demo.jumpserver.org,172.17.200.191"    # 使用 IP 和 域名一起访问
  DOMAINS=

  # 重启 JumpServer 服务生效
  jmsctl restart
```

!!! info "在进行升级或者迁移操作前,请先做好备份工作"

!!! warning "注意" - 更新前请一定要做好备份工作 - V2版本升级至V3版本请参考此文档{:target="_blank"} - 数据库迁移请先参考此文档{:target="_blank"} - 升级前版本小于 1.4.4 请先按照此文档操作{:target="_blank"} - 升级前版本小于 1.4.5 请先按照此文档操作{:target="_blank"} - 未使用 installer 部署的用户请参考迁移说明迁移到最新版本{:target="_blank"}

!!! tip "环境说明" - 从 v2.5 版本开始,要求 MySQL Server >= 5.7 - 从 v2.6 版本开始,要求 Redis Server >= 6.0 - 推荐使用外置 DB Server 和 Redis Server,方便日后扩展升级

!!! tip "外置数据库要求"

| 名称     | 版本   |
| :------ | :------ |
| MySQL   | >= 5.7  |
| MariaDB | >= 10.6 |    
| Redis   | >= 6.0  |

📄 quick_start.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/quick_start.md

快速入门

1 一键安装

!!! tip "" - 支持主流 Linux 发行版本(基于 Debian / RedHat,包括国产操作系统) - Gentoo / Arch Linux 请通过 源码安装 - 如用于生产环境,推荐使用 离线安装包 进行部署

!!! tip "" === "中国大陆"

```console // root@localhost:/opt# $ curl -sSL https://resource.fit2cloud.com/jumpserver/jumpserver/releases/latest/download/quick_start.sh | bash

    ---> 100%
    <span style="color: green;">[Success]</span>: download install script to /opt/jumpserver-installer-{{jumpserver.tag}}
    [Info]: Start executing the installation script.
    [Info]: In an automated script deployment, note the message prompts on the screen.
    ---> 100%
    <span style="color: green;">[Success]</span>: The Installation is Complete.

    For more commands, you can enter <span style="color: red;">jmsctl --help</span> to view help information.
    ```
    </div>
=== "其他地区"
    <div class="termy">
    ```console
    // root@localhost:/opt#
    $ curl -sSL https://github.com/jumpserver/jumpserver/releases/latest/download/quick_start.sh | bash

    ---> 100%
    <span style="color: green;">[Success]</span>: download install script to /opt/jumpserver-installer-{{jumpserver.tag}}
    [Info]: Start executing the installation script.
    [Info]: In an automated script deployment, note the message prompts on the screen.
    ---> 100%
    <span style="color: green;">[Success]</span>: The Installation is Complete.

    For more commands, you can enter <span style="color: red;">jmsctl --help</span> to view help information.
    ```
    </div>

!!! info "安装成功后,通过浏览器访问登录 JumpServer" sh 地址: http://<JumpServer服务器IP地址>:<服务运行端口> 用户名: admin 密码: ChangeMe

2 资产管理

2.1 准备工作

!!! tip "" - 准备两个测试资产和一个数据库来验证功能。

!!! tip ""

|   IP 地址     |    主机名       |    端口    | 操作系统         |  管理员用户    |    密码       |
| ------------ | --------------- | ---------- | ---------------- |--- ---------- |--- ---------- |
| 172.16.80.11 |    test_ssh01   |     22     |     Centos 7     |      root     |  Test2020.L   |
| 172.16.80.21 |    test_rdp01   |    3389    |    Windows 10    | administrator |  Test2020.W   |
| 172.16.80.31 |   test_mysql01  |    3306    |      MySQL 5     |      root     |  Test2020.M   |

!!! warning "注意" - Windows 资产如需执行 更新资产 信息、可连接性测试 等自动化任务,需先进行 Windows SSH 设置,此非登录 Windows 资产的必填项。 - MySQL 应用需要授权 CoreKoKo 的远程访问的权限 MySQL 应用要求

2.2 编辑资产树

!!! tip "" - 点击页面左侧的 资产管理 - 资产列表,在根节点 Default 右键新建 SSH ServerRDP ServerDatabase 三个节点。 !!! tip "" - 资产树样式如下:

```
Default
├─ SSH Server
└─ RDP Server
└─ DB Server
```

!!! warning "注意" - 根节点 Default 不能重命名,右击节点可以 添加删除重命名 节点,以及进行资产相关的操作。

2.3 创建资产

!!! tip "" - 点击页面左侧的 资产管理 - 资产列表 - 主机 - 创建 创建一台 Linux 服务器,并在创建资产过程中,创建特权用户,内容就是上面表单的 管理员用户密码。 - Windows 资产的创建流程同样如此。

!!! tip "" - 创建 Linux 资产样式如下:

!!! tip ""

| 名称        | IP/主机      | 资产平台 | 节点          | 协议组    | 账号列表   |
| ---------- | ------------ | ------- | ------------ | -------  | -------- |
| test_ssh01 | 172.16.80.11 | Linux   | /Default/SSH Server | ssh 22 | 添加 |

!!! tip "" - 添加登录资产用户样式如下:

!!! tip ""

| 名称              | 用户名 | 特权用户 | 密文类型     | 密码          |
| ----------------- | ---- | ------- | ---------- | ---------------- |
| 172.16.80.11_root | root  | 是 | 密码 |Test2020.L |

!!! warning "注意" - 名称 不能重名,密码 或者 密钥 二选一即可,一些资产不允许通过 密码 认证可以改用 私钥 认证。
- 特权用户 仅支持 SSH 协议,用于资产 可连接性测试推送用户批量改密 等自动化任务。 - 资产创建信息填写好保存之后隔几秒钟时间刷新一下网页,ssh 协议资产的可连接图标会显示 绿色,且 硬件信息 会显示出来。
- 如果 可连接 的图标是 黄色 或者 红色,可以点击 资产名称,在右侧 快速修改 - 测试可连接性 点击 测试 按钮,根据错误提示处理。
- 被连接 Linux 资产需要 python 组件,且版本大于等于 2.6Ubuntu 等资产默认不允许 root 用户远程 ssh 登录,请自行处理,Windows 资产需要手动安装 OpenSSH Server。 - 如果资产不能正常连接,请检查 特权用户 的 用户名密码 是否正确以及该 特权用户 是否能使用 SSHJumpServer 主机正确登录到资产主机上。

2.4 创建数据库应用

!!! tip "" - 点击页面左侧的 资产管理 - 资产列表 - 创建 - 数据库下选择 MySQL 数据库

!!! tip "" - 创建 MySQL 数据库应用样式如下:

!!! tip ""

| 名称         | 地址          | 节点               | 数据库 | 协议组      | 账号列表  |
| ------------ | ------------ | ------------------ | ----- | ----------- | -------- |
| test_mysql01 | 172.16.80.31 | /Default/DB Server | test  | mysql:3306  | 添加     |

!!! tip "" - 添加登录数据库用户样式如下:

!!! tip ""

|        名称       | 用户名 | 特权用户 | 密文类型 |    密码    |
| ----------------- | ----- | ------ | -------  | ---------- |
| 172.16.80.23_root | root  | root   | 密码     | Test2020.M |

!!! warning "注意" - 名称、主机、数据库选项为必填项。

3 创建授权规则

!!! tip "" - 点击页面左侧的 权限管理 - 资产授权 - 创建 创建一个授权。 - Windows 资产、MySQL 数据库 的授权流程和下述内容相同。

!!! tip "" - 创建登录授权规则(例如 Linux 资产),样式如下:

!!! tip ""

| 名称             | 用户                 | 用户组 | 资产                     | 节点 | 账号                                  | 动作                  |
| ---------------- | -------------------- | ----- | ------------------------ | --- | ----------------------------------------- | -------------------- |
| admin_ssh01 | Administrator(admin) |   -    | test_ssh01(172.16.80.11) |  -   | 所有账号                  | :material-check: 全部 |

!!! warning "注意" - 名称,授权的名称,不能重复。
- 用户用户组 二选一,不推荐即选择 用户 又选择 用户组
- 资产节点 二选一,选择 节点 会包含 节点 下面的所有 资产
- 账号账号 为连接资产的 认证凭据
- 用户(组)资产(节点) 是一对一的关系,所以当拥有 LinuxWindows 不同类型资产时,应该分别给 Linux 资产和 Windows 资产创建 授权规则

4 用户登录

!!! tip "" - 点击页面右上角的 Web 终端 进行资产连接。

!!! warning "注意" - 用户只能看到自己被管理员授权了的 资产,如果登录后无资产,请联系管理员进行确认。

5 系统设置

!!! tip "" - 点击页面右上角的 系统设置 进行配置。

5.1 基本设置

!!! tip ""

| 名称          | 示例                        | 备注                                         |
| ------------ | --------------------------- | -------------------------------------------- |
| 当前站点URL   | https://demo.jumpserver.org | 不设置的话,邮件收到的地址为 `http://localhost` |
| 用户向导URL   |                             | 用户首次登录可以看到此 `超链接`,可以不设置      |
| 忘记密码URL   |                             | 使用了 LDAP, OPENID 等外部认证系统,可以自定义  |

5.2 邮件设置

!!! tip "" - 我们支持通过SMTPEXCHANGE方式来对接邮件配置。

=== "SMTP" !!! tip ""

    | 名称 | 示例 | 备注 |
    | ---------- | ---------------- | ---------------------------------- |
    | SMTP主机   | smtp.qq.com      | 服务商提供的 smtp 服务器             |
    | SMTP端口   | 25               | 通常是 `25`                         |
    | SMTP账号   | **********@qq.com | 通常是 `user@domain.com`            |
    | SMTP密码   | **************** | 每次 `测试连接` 都需要重新输入密码    |
    | 使用SSL    | [ ]              | 如果端口使用 `465`,必须勾选此项      |
    | 使用TLS    | [ ]              | 如果端口使用 `587`,必须勾选此项      |
    | 发件人     | **********@qq.com | `测试连接` 必须要输入                |
    | 主题前缀   | [JMS]            | 邮件的标题,收到的邮件是 `[JMS]` 开头 |
    | 测试收件人 | **********@qq.com | 测试连接必填                         |

!!! warning "注意"
    - 不可以同时勾选 `使用 SSL` 和 `使用 TLS`。

6 常用功能操作

!!! tip "" - 通过 SFTP 上传下载 - Windows 上传下载 - 限制 IP 登录 - 纳管数据库应用 - Redis 数据库纳管

📄 teaching_video.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/teaching_video.md

教学视频

1 安装部署

安装部署{ width="280"}

2 资产管理

用户管理{ width="280"} 资产管理{ width="280"} 网域网关{ width="280"}
命令过滤{ width="280"} 应用管理{ width="280"}

3 日志审计

日志审计{ width="280"}

4 其他配置

邮箱服务{ width="280"} LDAP 认证{ width="280"}

📄 user_stories.md

Chemin: 04_INFRA_DEPLOIEMENT/Notes_Operations/jumpserver_docs/docs/user_stories.md

用户案例

!!! tip "" JumpServer 是广受欢迎的开源堡垒机,经历千锤百炼,广泛服务于银行、证券、制造、物流、媒体、互联网等行业,累计安装超过 200,000 次。

!!! tip "" - JumpServer 堡垒机护航顺丰科技超大规模资产安全运维{:target="_blank"} - JumpServer 堡垒机让“大智慧”的混合 IT 运维更智慧{:target="_blank"} - JumpServer 堡垒机助力中手游提升多云环境下安全运维能力{:target="_blank"} - 携程 JumpServer 堡垒机部署与运营实战{:target="_blank"} - 腾讯海外游戏 基于 JumpServer 构建游戏安全运营能力{:target="_blank"} - 万华化学 通过 JumpServer 管理全球化分布式IT资产,并且实现与云管平台的联动{:target="_blank"} - 雪花啤酒 JumpServer 堡垒机使用体会{:target="_blank"} - 小红书的 JumpServer 堡垒机大规模资产跨版本迁移之路{:target="_blank"} - 中通快递 JumpServer 主机安全运维实践{:target="_blank"} - 东方明珠 JumpServer 高效管控异构化、分布式云端资产{:target="_blank"} - 江苏农信 JumpServer 堡垒机助力行业云安全运维{:target="_blank"}

📄 README.md

Chemin: 04_INFRA_DEPLOIEMENT/README.md

04_INFRA_DEPLOIEMENT – Infrastructure & DevOps

Dossier d’infrastructure technique : déploiement, supervision, sécurité.

Objectifs

Contenu attendu

Responsable

DevOps / SRE

Connexions transversales

📄 README.md

Chemin: 04_INFRA_DEPLOIEMENT/Sécurité_WAF_Coraza/README.md

Sécurité — WAF, TLS, Accès, Antivirus

Ce dossier regroupe toutes les configurations et outils de protection des services Talas.

Stack de sécurité déployée

Couche réseau — WireGuard + HAProxy

Composant Rôle Serveur
WireGuard VPN d'accès aux serveurs + exposition des services sur Internet R720 #1
HAProxy Reverse proxy, terminaison TLS, routage vers les services R720 #1
Let's Encrypt Certificats TLS automatiques via certbot R720 #1

Flux : Internet → Fibre Orange → WireGuard/port forward → HAProxy (TLS + WAF) → services

Pas de Cloudflare, pas de Tailscale, pas de CDN tiers. 100% self-hosted.

Couche applicative — Coraza WAF

Composant Rôle
Coraza WAF Web Application Firewall open source, intégré à HAProxy
OWASP CRS Core Rule Set — règles de détection SQLi, XSS, path traversal, etc.

Configuration : - Paranoia level dynamique (ajustable par environnement) - Logs au format personnalisé → Filebeat → Elasticsearch → Kibana - 245+ règles application-multi actives

Couche administration — JumpServer

Composant Rôle
JumpServer Bastion SSH/RDP open source

Fonctionnalités : - Interface web d'administration - Audit vidéo de toutes les sessions terminal - RBAC (contrôle d'accès par rôle) - MFA obligatoire - Gestion des assets (serveurs, comptes, credentials) - Intégration Hashicorp Vault pour les secrets

Couche applicative Veza — Sécurité intégrée

Sécurité implémentée dans le code Veza (voir [[03_APPS_&_SERVICES/ARCHITECTURE_VEZA]]) :

Mécanisme Description
JWT RS256 Authentification par tokens asymétriques (avec fallback HS256)
CSRF tokens Stockés dans Redis, obligatoires en production sur tous les POST/PUT/DELETE
Rate limiting Global : 1000 req/s. Par IP : 100 req/s. Par endpoint : variable.
ClamAV Scan antivirus de tous les fichiers uploadés (port 13310)
Bcrypt Hash des mots de passe
AES-256-GCM Chiffrement des tokens OAuth
WebAuthn/Passkeys Authentification sans mot de passe
MFA TOTP Double authentification par application
Verrouillage de compte Après N tentatives échouées (Redis ou in-memory)
Audit logging Log automatique de tous les POST/PUT/DELETE
Security headers HSTS, CSP, X-Content-Type-Options, X-Frame-Options

Gestion des secrets — Hashicorp Vault

Usage Description
Clés SSH Générées et stockées dans Vault, distribuées automatiquement
Tokens API Rotation via Vault
Mots de passe DB Stockage sécurisé

Rôle Ansible : ssh-keygen-and-store (génération → Vault → distribution)

Rôles Ansible associés

Rôle Description
haproxy Reverse proxy + Coraza WAF + TLS
ssh-keygen-and-store Génération de clés SSH + stockage Vault
nftables Règles de filtrage réseau

Contenu de ce dossier

Voir aussi