Skip to content

Commit 6f72b57

Browse files
authored
Merge pull request CactuseSecurity#4227 from tpurschke/fix/docker-pull
Fix/docker pull
2 parents 1a39b00 + 7882993 commit 6f72b57

4 files changed

Lines changed: 34 additions & 18 deletions

File tree

agents

documentation/installer/install-advanced.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Note that the following domains (and their sub-domains) must be reachable throug
8383
github.com, api.github.com
8484
githubusercontent.com
8585
docker.com (and subdomains)
86-
docker.io, auth.docker.io
86+
docker.io (and subdomains)
8787
hasura.io, releases.hasura.io
8888
postgresql.org
8989
microsoft.com

roles/api/tasks/hasura-install.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,37 @@
177177
var: hasura_env
178178
when: debug_level > '1'
179179

180+
- name: request Docker Hub token for hasura/graphql-engine
181+
uri:
182+
url: "https://auth.docker.io/token?service=registry.docker.io&scope=repository:hasura/graphql-engine:pull"
183+
method: GET
184+
return_content: true
185+
register: dockerhub_token
186+
environment: "{{ proxy_env }}"
187+
failed_when: dockerhub_token.status | default(-1) != 200
188+
189+
- name: check Docker Hub manifest access for hasura/graphql-engine:{{ api_hasura_version }}
190+
uri:
191+
url: "https://registry-1.docker.io/v2/hasura/graphql-engine/manifests/{{ api_hasura_version }}"
192+
method: HEAD
193+
headers:
194+
Authorization: "Bearer {{ dockerhub_token.json.token }}"
195+
Accept: "application/vnd.docker.distribution.manifest.v2+json"
196+
status_code:
197+
- 200
198+
register: dockerhub_manifest_check
199+
environment: "{{ proxy_env }}"
200+
failed_when: false
201+
202+
- name: fail if Docker Hub manifest access is blocked
203+
fail:
204+
msg: >-
205+
Cannot access Docker Hub manifest for hasura/graphql-engine:{{ api_hasura_version }}
206+
(HTTP {{ dockerhub_manifest_check.status | default('unknown') }}). This typically indicates
207+
blocked registry access or proxy restrictions. Ensure the host can reach registry-1.docker.io
208+
or configure a registry mirror.
209+
when: dockerhub_manifest_check.status | default(0) != 200
210+
180211
- name: start hasura container
181212
docker_container:
182213
name: "{{ api_container_name }}"
@@ -194,7 +225,7 @@
194225
env: "{{ hasura_env }}"
195226
container_default_behavior: no_defaults
196227
user: "1001:1001" # hasura user and group id
197-
pull: no
228+
pull: false
198229
register: docker_return
199230
become: true
200231
become_user: "{{ fworch_user }}"

roles/lib/files/FWO.Report/ReportRules.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -366,21 +366,6 @@ private string ExportSingleRulebaseToCsv(StringBuilder report, RuleDisplayCsv ru
366366
if (rbLink == null)
367367
{
368368
return report.ToString();
369-
//NOSONAR
370-
// from develop:
371-
// foreach (var dev in mgt.Devices.Where(d => d.Rules != null && d.Rules.Length > 0))
372-
// {
373-
// if (dev.Rules != null)
374-
// {
375-
// foreach (Rule rule in dev.Rules)
376-
// {
377-
// rule.ManagementName = mgt.Name ?? "";
378-
// rule.DeviceName = dev.Name ?? "";
379-
// mgt.ReportedRuleIds.Add(rule.Id);
380-
// }
381-
// }
382-
// }
383-
// mgt.ReportedRuleIds = mgt.ReportedRuleIds.Distinct().ToList();
384369
}
385370
foreach (var rule in GetRulesByRulebaseId(rbLink.NextRulebaseId, managementReport)) // just dealing with the first rb for starters
386371
{

0 commit comments

Comments
 (0)