diff --git a/salt/airgap/init.sls b/salt/airgap/init.sls new file mode 100644 index 000000000..c5f46e03b --- /dev/null +++ b/salt/airgap/init.sls @@ -0,0 +1,51 @@ +{% set MANAGER = salt['grains.get']('master') %} +{% set IMAGEREPO = salt['pillar.get']('global:airgap') %} +airgap.repo: + pkgrepo.managed: + - humanname: Airgap Repo + - baseurl: https://{{ MANAGER }}/repo + - gpgcheck: 0 + +agbase: + file.absent: + - name: /etc/yum.repos.d/CentOS-Base.repo + +agcr: + file.absent: + - name: /etc/yum.repos.d/CentOS-CR.repo + +agdebug: + file.absent: + - name: /etc/yum.repos.d/CentOS-Debuginfo.repo + +agfasttrack: + file.absent: + - name: /etc/yum.repos.d/CentOS-fasttrack.repo + +agmedia: + file.absent: + - name: /etc/yum.repos.d/CentOS-Media.repo + +agsources: + file.absent: + - name: /etc/yum.repos.d/CentOS-Sources.repo + +agvault: + file.absent: + - name: /etc/yum.repos.d/CentOS-Vault.repo + +agkernel: + file.absent: + - name: /etc/yum.repos.d/CentOS-x86_64-kernel.repo + +agepel: + file.absent: + - name: /etc/yum.repos.d/epel.repo + +agtesting: + file.absent: + - name: /etc/yum.repos.d/epel-testing.repo + +agssrepo: + file.absent: + - name: /etc/yum.repos.d/saltstack.repo \ No newline at end of file diff --git a/salt/nginx/etc/nginx.conf.so-standalone b/salt/nginx/etc/nginx.conf.so-standalone index ceae18cb1..220f86af5 100644 --- a/salt/nginx/etc/nginx.conf.so-standalone +++ b/salt/nginx/etc/nginx.conf.so-standalone @@ -2,6 +2,7 @@ {%- set FLEET_MANAGER = salt['pillar.get']('global:fleet_manager') %} {%- set FLEET_NODE = salt['pillar.get']('global:fleet_node') %} {%- set FLEET_IP = salt['pillar.get']('global:fleet_ip', None) %} +{%- set ISAIRGAP = salt['pillar.get']('global:airgap') %} # For more information on configuration, see: # * Official English Documentation: http://nginx.org/en/docs/ # * Official Russian Documentation: http://nginx.org/ru/docs/ @@ -182,6 +183,21 @@ http { proxy_set_header X-Forwarded-Proto $scheme; } + {%- if ISAIRGAP is sameas true %} + location /repo/ { + #auth_request /auth/sessions/whoami; + proxy_read_timeout 90; + proxy_connect_timeout 90; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Proxy ""; + proxy_set_header X-Forwarded-Proto $scheme; + } + + {%- endif %} + + location /grafana/ { auth_request /auth/sessions/whoami; rewrite /grafana/(.*) /$1 break; diff --git a/salt/nginx/init.sls b/salt/nginx/init.sls index 2e67a6b2c..2cb7984db 100644 --- a/salt/nginx/init.sls +++ b/salt/nginx/init.sls @@ -3,6 +3,7 @@ {% set MANAGER = salt['grains.get']('master') %} {% set VERSION = salt['pillar.get']('global:soversion', 'HH1.2.2') %} {% set IMAGEREPO = salt['pillar.get']('global:imagerepo') %} +{% set ISAIRGAP = salt['pillar.get']('global:airgap') %} # Drop the correct nginx config based on role nginxconfdir: @@ -72,6 +73,9 @@ so-nginx: - /etc/pki/managerssl.crt:/etc/pki/nginx/server.crt:ro - /etc/pki/managerssl.key:/etc/pki/nginx/server.key:ro - /opt/so/conf/fleet/packages:/opt/socore/html/packages + {% if ISAIRGAP is sameas true %} + - /nsm/repo:/opt/socore/html/repo:ro + {% endif %} # ATT&CK Navigator binds - /opt/so/conf/navigator/navigator_config.json:/opt/socore/html/navigator/assets/config.json:ro - /opt/so/conf/navigator/nav_layer_playbook.json:/opt/socore/html/navigator/assets/playbook.json:ro