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

Example for HTTP extension in specification is invalid #277

Open
TcM1911 opened this issue Jul 12, 2021 · 2 comments
Open

Example for HTTP extension in specification is invalid #277

TcM1911 opened this issue Jul 12, 2021 · 2 comments

Comments

@TcM1911
Copy link

TcM1911 commented Jul 12, 2021

The provided example for HTTP extension does not follow the specification. The dictionary values in the request_header MUST be a list of string. The example has strings.

Description text:

Each key in the dictionary MUST be the name of the header field and SHOULD preserve case, e.g., User-Agent. The corresponding value for each dictionary key MUST always be a list of type string to support when a header field is repeated.

Example:

{
  "type": "network-traffic",
  "spec_version": "2.1",
  "id": "network-traffic--f8ae967a-3dc3-5cdf-8f94-8505abff00c2",
  "dst_ref": "ipv4-addr--6da8dad3-4de3-5f8e-ab23-45d0b8f12f16",
  "protocols": ["tcp", "http"],
  "extensions": {
    "http-request-ext": {
      "request_method": "get",
      "request_value": "/download.html",
      "request_version": "http/1.1",
      "request_header": {
        "Accept-Encoding": "gzip,deflate",
        "User-Agent": "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113",
        "Host": "www.example.com"
      }
    }
  }
}
@rpiazza
Copy link
Contributor

rpiazza commented Jul 23, 2021

Thanks @TcM1911 - This is a good catch. Unfortunately, the spec has been published, so no changes can be made at this time. If you look at the json schema (see https://github.com/oasis-open/cti-stix2-json-schemas/blob/master/schemas/observables/network-traffic.json) it also is incorrect, according to the spec, which is why this error wasn't caught. This will be addressed in any new version of the spec in the future.

@ejratl
Copy link
Contributor

ejratl commented Sep 28, 2021

The TC must make a decision about whether to update the spec language or whether to update the example and the schema. The Errata will explain the decision and the implications. Updating the schema is problematic because it may invalidate objects in the field.

Reference material (courtesy jmg): https://datatracker.ietf.org/doc/html/rfc2616#section-4.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants