gitlab-qa 15.10.1 → 15.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e921902d91ded31ce0003274106b20236f6b71231508fe4236ae926cbae8db26
4
- data.tar.gz: 23e8702dd725cd0f8cbd3d2105da4b5f6799f9eac1a19093f3d0c277cd957385
3
+ metadata.gz: 84dd5f52a5315b76b1fddcf578afa77b71699744f6c9250edd82c103a74c8e66
4
+ data.tar.gz: a6abb8d04101eac27f5289e705d54f257ca2bad9e451b039c53e9fbc86621509
5
5
  SHA512:
6
- metadata.gz: c599a048d4937a6f01c0b5a469f59c2377ead8e85cf301f8d2332efafdbc076779fd245afa74bd6b073fb8e9bd2a87e59c37c0a579e68d6461a509b4bffd6813
7
- data.tar.gz: 55c98ba9302e97e8c2d1b4f269fe81d0de926be93840cb9b0b0c04389c8d3f8e632c3001eecb2de57060d41ad3e447c5fc81f53aeb75303cb9ec3739ae72255b
6
+ metadata.gz: a78f8366d7779dc733b81cbde2a6ca07ca3241558424a8b3a3a1944909eeafcebd7c0e942a5d9aadccc461a0f8d7e6ccce6a597b36f2dab39c041d94075d7662
7
+ data.tar.gz: 80b60afd84ec9b1d9aeb470b89cccb97d92d2086ee2c5658446d8db166c52457ad9e438c831a1358a1bc57b8c41d8562b226af01e1a3c0db933ef7365e2e0a06
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab-qa (15.10.1)
4
+ gitlab-qa (15.10.2)
5
5
  activesupport (>= 6.1, < 8)
6
6
  ffi (~> 1.17)
7
7
  gitlab (~> 4.19)
@@ -1008,6 +1008,9 @@ This scenario will run tests from the test suite against an airgapped instance.
1008
1008
  The airgapped instance is set up by using `iptables` in the GitLab container to block network traffic other than testable ports, and by using runners
1009
1009
  in a shared internal network.
1010
1010
 
1011
+ After the rules are applied, the job fails if the container can connect to gitlab.com on port 443, to example.com on port 80 or 443, or to dns.google on port 53.
1012
+ The job also logs whether gitlab.com port 8080 is reachable, which the rules allow, and how many packets the `OUTPUT` policy dropped. Neither log line fails the job.
1013
+
1011
1014
  Example:
1012
1015
 
1013
1016
  ```shell
@@ -39,6 +39,7 @@ module Gitlab
39
39
  rspec_args << "--" unless rspec_args.include?('--')
40
40
  rspec_args << "--tag ~orchestrated"
41
41
  gitlab.instance do
42
+ report_gitlab_port_8080(gitlab)
42
43
  Component::Specs.perform do |specs|
43
44
  specs.suite = 'Test::Instance::Airgapped'
44
45
  specs.release = gitlab.release
@@ -46,14 +47,42 @@ module Gitlab
46
47
  specs.runner_network = gitlab.runner_network
47
48
  specs.args = [gitlab.address, *rspec_args]
48
49
  end
50
+ ensure
51
+ report_dropped_packets(gitlab)
49
52
  end
50
53
  end
51
54
  end
52
55
 
53
56
  private
54
57
 
58
+ def report_dropped_packets(gitlab)
59
+ chain = gitlab.docker.exec(gitlab.name, 'iptables -nvxL OUTPUT')
60
+ Runtime::Logger.info("Airgapped packets dropped by the OUTPUT policy: #{chain[/policy DROP \d+ packets, \d+ bytes/]}")
61
+ rescue Support::ShellCommand::StatusError => e
62
+ Runtime::Logger.warn("Unable to read the airgapped OUTPUT chain counters: #{e.message}")
63
+ end
64
+
65
+ def report_gitlab_port_8080(gitlab)
66
+ address = Resolv.getaddress('gitlab.com')
67
+ state = gitlab.docker.exec(gitlab.name, "ncat -zv -w 10 #{address} 8080 > /dev/null 2>&1 && echo open || echo closed")
68
+ if state.include?('open')
69
+ Runtime::Logger.warn("Airgapped finding: gitlab.com port 8080 is reachable")
70
+ else
71
+ Runtime::Logger.info("Airgapped gitlab.com port 8080 is not reachable")
72
+ end
73
+ rescue Resolv::ResolvError, Support::ShellCommand::StatusError => e
74
+ Runtime::Logger.warn("Unable to probe gitlab.com port 8080: #{e.message}")
75
+ end
76
+
77
+ def unreachable_check(ip, port)
78
+ reachable = "echo 'Airgapped network faulty. #{ip} port #{port} is reachable.'; exit 1;"
79
+ "if ncat -zv -w 10 #{ip} #{port}; then #{reachable} else echo 'Airgapped connectivity #{ip} port #{port} check passed.'; fi;"
80
+ end
81
+
55
82
  def airgap_gitlab_commands
56
83
  gitlab_ip = Resolv.getaddress('gitlab.com')
84
+ outside_ip = Resolv.getaddress('example.com')
85
+ resolver_ip = Resolv.getaddress('dns.google')
57
86
  gitlab_registry_ip = Resolv.getaddress(QA::Release::COM_REGISTRY)
58
87
  dev_gitlab_registry_ip = Resolv.getaddress(QA::Release::DEV_REGISTRY.split(':')[0])
59
88
  praefect_ip = config.praefect_ip
@@ -62,6 +91,7 @@ module Gitlab
62
91
  # Ping and wget check
63
92
  apt-get update && apt-get install -y iptables ncat
64
93
  if ncat -zv -w 10 #{gitlab_ip} 80; then echo 'Airgapped connectivity check passed.'; else echo 'Airgapped connectivity check failed - should be able to access gitlab_ip'; exit 1; fi;
94
+ if ncat -zv -w 10 #{outside_ip} 443; then echo 'Airgapped connectivity outside_ip check passed.'; else echo 'Airgapped connectivity check failed - should be able to access outside_ip'; exit 1; fi;
65
95
 
66
96
  echo "Checking regular connectivity..." \
67
97
  && wget --retry-connrefused --waitretry=1 --read-timeout=15 --timeout=10 -t 2 http://registry.gitlab.com > /dev/null 2>&1 \
@@ -92,9 +122,10 @@ module Gitlab
92
122
  if ncat -zv -w 10 127.0.0.1 80; then echo 'Airgapped connectivity port 80 check passed.'; else echo 'Airgapped connectivity port 80 check failed.'; exit 1 ; fi;
93
123
  if ncat -zv -w 10 #{gitlab_registry_ip} 80; then echo 'Airgapped connectivity port gitlab_registry_ip check passed.'; else echo 'Airgapped connectivity port 80 check failed.'; exit 1; fi;
94
124
 
95
- echo "Checking airgapped connectivity..." \
96
- && wget --retry-connrefused --waitretry=1 --read-timeout=15 --timeout=10 -t 2 http://registry.gitlab.com > /dev/null 2>&1 \
97
- && (echo "Airgapped network faulty. Connectivity wget check failed." && exit 1) || (echo "Airgapped network confirmed. Connectivity wget check passed." && exit 0)
125
+ #{unreachable_check(gitlab_ip, 443)}
126
+ #{unreachable_check(outside_ip, 80)}
127
+ #{unreachable_check(outside_ip, 443)}
128
+ #{unreachable_check(resolver_ip, 53)}
98
129
  AIRGAP_AND_VERIFY_COMMAND
99
130
  end
100
131
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Gitlab
4
4
  module QA
5
- VERSION = '15.10.1'
5
+ VERSION = '15.10.2'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-qa
3
3
  version: !ruby/object:Gem::Version
4
- version: 15.10.1
4
+ version: 15.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitLab Quality
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-10-27 00:00:00.000000000 Z
11
+ date: 2026-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control