ossf / package-analysis

Open Source Package Analysis
Apache License 2.0
720 stars 51 forks source link

add urls (http+https) to json report #585

Open jossef opened 1 year ago

jossef commented 1 year ago

It is highly valuable to include URLs audited as part of the analysis in the JSON report. For example (see URLs field):

{
  "Package": {
    "Name": "package-name",
    "Version": "1.2.3",
    "Ecosystem": "npm"
  },
  "CreatedTimestamp": 1674062447,
  "Analysis": {
    "install": {
      "Status": "",
      "Stdout": "...",
      "Stderr": "...",
      "Files": [],
      "Sockets": [],
      "Commands": [],
      "DNS": [],
      "URLs": [
        "http://2oqwmc7o04ssmcdi4e6wn79ys2vnkh.burpcollaborator.net/",
        "https://raw.githubusercontent.com/Gauravbhatia1211/experiment/main/exps.sh"
      ],
    }
  }
}

How to deal with HTTPS traffic?

Had a great chat with @oliverchang, @calebbrown, and @alik-kold. Suggesting adding a MITM-TLS component and routing the TLS traffic through a transparent proxy component able to audit the URLs, body, headers, and more valuable information:

@alik-kold built a working POC with the following architecture (this is the original):

We started working on this feature. let us know WDYT 🙏

maxfisher-g commented 1 year ago

This sounds awesome! Very keen to see it in action :D

We might need to think about how to add that extra data (e.g. headers, request / response body, etc) in the JSON - if we want it.