From 15b0ddb068c94a82d926af6311b245076185871b Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 24 Feb 2024 20:01:53 +0930 Subject: [PATCH] feat(scanner): Set user http user agent to / !11 --- .gitlab-ci.yml | 12 ++++++++++++ gitlab-ci | 2 +- playbooks/tasks/api_call.yaml | 3 +++ playbooks/tasks/scan_subnet.yaml | 3 +++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fcf4110..89bdc43 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,6 +19,18 @@ variables: DOCKER_IMAGE_PUBLISH_REGISTRY: docker.io/nofusscomputing DOCKER_IMAGE_PUBLISH_URL: https://hub.docker.com/r/nofusscomputing/$DOCKER_IMAGE_PUBLISH_NAME + RELEASE_ADDITIONAL_ACTIONS_BUMP: | + sed -E "/http_agent: nfc-phpipam-scan-agent/s/\/(.+)/\/$(cz version --project)/g" -i playbooks/tasks/scan_subnet.yaml; + + git add playbooks/tasks/scan_subnet.yaml; + + git status; + + sed -E "/http_agent: nfc-phpipam-scan-agent/s/\/(.+)/\/$(cz version --project)/g" -i playbooks/tasks/api_call.yaml + + git add playbooks/tasks/api_call.yaml; + + git status; include: diff --git a/gitlab-ci b/gitlab-ci index 4f65bc1..6f80ea3 160000 --- a/gitlab-ci +++ b/gitlab-ci @@ -1 +1 @@ -Subproject commit 4f65bc1367585146490637dfc7c57c987216e652 +Subproject commit 6f80ea3af7fdc64e9998820a8800c288d7facbc6 diff --git a/playbooks/tasks/api_call.yaml b/playbooks/tasks/api_call.yaml index 0e1b216..554e945 100644 --- a/playbooks/tasks/api_call.yaml +++ b/playbooks/tasks/api_call.yaml @@ -49,6 +49,8 @@ cached_file.stat.exists + # Note: Dont edit http_agent version as the build pipeline updates automagically!! + # see ci variable 'RELEASE_ADDITIONAL_ACTIONS_BUMP' - name: > PHPIPAM API Call - {{ api_path }}{%- if api_query_string is defined -%} /?{{ api_query_string }} @@ -61,6 +63,7 @@ {%- endif %} headers: token: "{{ api_token }}" + http_agent: nfc-phpipam-scan-agent/0.2.0-a2 return_content: true status_code: - 200 diff --git a/playbooks/tasks/scan_subnet.yaml b/playbooks/tasks/scan_subnet.yaml index a73e3c5..9b200b8 100644 --- a/playbooks/tasks/scan_subnet.yaml +++ b/playbooks/tasks/scan_subnet.yaml @@ -65,10 +65,13 @@ subnet_scan_results: "{{ subnet_scan_results | from_yaml }}" + # Note: Dont edit http_agent version as the build pipeline updates automagically!! + # see ci variable 'RELEASE_ADDITIONAL_ACTIONS_BUMP' - name: Upload Scan Results - {{ subnet.address }} ansible.builtin.uri: headers: Authorization: "Bearer {{ nofusscomputing_phpipam_scan_agent.auth_token | default('no-token-set') }}" + http_agent: nfc-phpipam-scan-agent/0.2.0-a2 url: "{{ nofusscomputing_phpipam_scan_agent.http_server | default(nfc_c_http_server) }}:{{ nofusscomputing_phpipam_scan_agent.http_port | default(nfc_c_http_port) }}/"