Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update agent server parse #2203

Closed
wants to merge 14 commits into from
Closed

Update agent server parse #2203

wants to merge 14 commits into from

Conversation

uruwhy
Copy link
Contributor

@uruwhy uruwhy commented Jul 21, 2021

Description

Addresses the server-parsing bug (#2200) where the C2 server would incorrectly parse server values for manx agents. The urlparse method would not work properly if the protocol (e.g. http) was not provided.

The C2 server will now perform regex checks when storing the server and upstream dest values for agents:

  • endpoints values of the format protocol://fqdn_or_ip:port or protocol://fqdn_or_ip will be saved accordingly. Any trailing forward slashes are removed.
  • endpoint values of the format fqdn_or_ip:port will be saved as-is, without any default protocol assumed. Any trailing forward slashes are removed. Note that port is required if no protocol is given. This will primarily handle tcp/udp endpoint values used by manx agents.
  • Any endpoint values that do not match the above formats will be stored as unknown.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Added tests to confirm that the new parsing function works as expected.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

@uruwhy uruwhy self-assigned this Jul 21, 2021
@codecov
Copy link

codecov bot commented Jul 21, 2021

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c1ce024) 73.04% compared to head (e647cce) 69.01%.
Report is 716 commits behind head on master.

❗ Current head e647cce differs from pull request most recent head e47e3c4. Consider uploading reports for the commit e47e3c4 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2203      +/-   ##
==========================================
- Coverage   73.04%   69.01%   -4.04%     
==========================================
  Files         112       83      -29     
  Lines        8070     6155    -1915     
==========================================
- Hits         5895     4248    -1647     
+ Misses       2175     1907     -268     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions
Copy link

This issue is stale because it has been open 20 days with no activity. Remove stale label or comment or this will be closed in 5 days

@sonarcloud
Copy link

sonarcloud bot commented Aug 13, 2021

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 6 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@github-actions github-actions bot closed this Aug 19, 2021
@elegantmoose elegantmoose deleted the update-agent-server-parse branch February 24, 2023 15:01
@clenk clenk restored the update-agent-server-parse branch July 11, 2023 13:47
@clenk clenk reopened this Jul 11, 2023
@github-actions github-actions bot closed this Jul 17, 2023
@clenk clenk reopened this Jul 24, 2023
@sonarcloud
Copy link

sonarcloud bot commented Jul 24, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

Prevent catastrophic backtracking using the workaround explained
here: https://stackoverflow.com/a/13577411/
for 'localhost'.
Note that it will be parsed as 'unknown' unless you have a protocol,
port, or TLD.
@github-actions github-actions bot closed this Jul 31, 2023
@clenk clenk reopened this Jul 31, 2023
@elegantmoose elegantmoose removed the request for review from ArtificialErmine July 31, 2023 17:51
@elegantmoose elegantmoose removed the request for review from kaylakraines July 31, 2023 17:51
@sonarcloud
Copy link

sonarcloud bot commented Aug 1, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

1 similar comment
@sonarcloud
Copy link

sonarcloud bot commented Aug 1, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@clenk clenk requested a review from djlawren August 1, 2023 13:57
@github-actions
Copy link

github-actions bot commented Sep 1, 2023

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

@sonarcloud
Copy link

sonarcloud bot commented Sep 1, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

warning The version of Java (11.0.20) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

@github-actions
Copy link

github-actions bot commented Oct 2, 2023

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

Copy link

github-actions bot commented Nov 2, 2023

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

Copy link

sonarcloud bot commented Nov 3, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

warning The version of Java (11.0.20) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

1 similar comment
Copy link

sonarcloud bot commented Nov 3, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

warning The version of Java (11.0.20) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

Copy link

github-actions bot commented Dec 4, 2023

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

Copy link

github-actions bot commented Jan 8, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

@github-actions github-actions bot closed this Jan 15, 2024
@clenk clenk reopened this Feb 14, 2024
@github-actions github-actions bot closed this Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants