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

Add Security Considerations (3.0.4) #3894

Merged
merged 1 commit into from
Jun 11, 2024
Merged

Conversation

handrews
Copy link
Member

@handrews handrews commented Jun 9, 2024

This adds the previously standalone security considerations document as a top-level section just before the appendices.

This adds the previously standalone security considerations
document as a top-level section just before the appendices.
@handrews handrews added security security: meta Metadata in and about the specification labels Jun 9, 2024
@handrews handrews added this to the v3.0.4 milestone Jun 9, 2024
@handrews handrews requested a review from a team June 9, 2024 17:19
@@ -3517,6 +3517,32 @@ Two examples of this:
1. The [Paths Object](#pathsObject) MAY be empty. It may be counterintuitive, but this may tell the viewer that they got to the right place, but can't access any documentation. They'd still have access to the [Info Object](#infoObject) which may contain additional information regarding authentication.
2. The [Path Item Object](#pathItemObject) MAY be empty. In this case, the viewer will be aware that the path exists, but will not be able to see any of its operations or parameters. This is different from hiding the path itself from the [Paths Object](#pathsObject), because the user will be aware of its existence. This allows the documentation provider to finely control what the viewer can see.

## Security Considerations
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an excellent PR.


### Security Schemes

An OpenAPI document describes the security schemes used to protect the resources it defines. The security schemes available offer varying degrees of protection. Factors such as the sensitivity of the data and the potential impact of a security breach should guide the selection of security schemes for the API resources. Some security schemes, such as basic auth and OAuth Implicit flow, are supported for compatibility with existing APIs. However, their inclusion in OpenAPI does not constitute an endorsement of their use, particularly for highly sensitive data or operations.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for including this. I think this opens the door for some other proposals to officially signal that some of the less secure schemes will be deprecated in future versions of the API. (similar to what OpenAPI does today to deprecate resources).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@miqui credit goes to @darrelmiller – he wrote this as a separate document (because we can't change the old specs) and I'm just putting it in the new versions of the spec :-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @darrelmiller !

Copy link
Contributor

@ralfhandl ralfhandl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, minor nits

### OpenAPI Document Formats

OpenAPI documents use JSON, YAML, and JSON Schema, and therefore share their security considerations:
- [JSON](https://www.iana.org/assignments/media-types/application/json)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- [JSON](https://www.iana.org/assignments/media-types/application/json)
- [JSON](https://www.rfc-editor.org/rfc/rfc8259.html#section-12)

Why not directly reference the section on security considerations?


OpenAPI documents use JSON, YAML, and JSON Schema, and therefore share their security considerations:
- [JSON](https://www.iana.org/assignments/media-types/application/json)
- [YAML](https://www.iana.org/assignments/media-types/application/yaml)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- [YAML](https://www.iana.org/assignments/media-types/application/yaml)
- [YAML](https://www.rfc-editor.org/rfc/rfc9512#name-security-considerations)

OpenAPI documents use JSON, YAML, and JSON Schema, and therefore share their security considerations:
- [JSON](https://www.iana.org/assignments/media-types/application/json)
- [YAML](https://www.iana.org/assignments/media-types/application/yaml)
- [JSON Schema Core](https://json-schema.org/draft/2020-12/json-schema-core#section-13)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- [JSON Schema Core](https://json-schema.org/draft/2020-12/json-schema-core#section-13)
- [JSON Schema Core](https://json-schema.org/draft/2020-12/json-schema-core#name-security-considerations)

@handrews
Copy link
Member Author

@ralfhandl this PR is really just to incorporate the pre-approved text into the spec. There was already a PR for debating the text. I'm not comfortable changing this as I recall someone (maybe @ioggstream ?) requesting those specific URLs- you'll have to ask @darrelmiller

@ralfhandl
Copy link
Contributor

someone (maybe @ioggstream ?) requesting those specific URLs

Yep, #3619. Surprising.

@handrews
Copy link
Member Author

@ralfhandl the need for the security requirements comes from working on the media type registration IETF draft, which @ioggstream started (and, after discussion with @darrelmiller who co-chairs that working group, I'll be picking up in the near future). But @ioggstream knows what the requirements are here so I'd trust his choice of reference URIs.

@ioggstream
Copy link
Contributor

Yes. We should reference the IANA registry and not the RFC directly.

Since media types can be changed outside RFCs, or RFCs can be obsoleted, the IANA process should guarantee that the Media type registration always references the latest information.

@ralfhandl
Copy link
Contributor

ralfhandl commented Jun 11, 2024

Pity that the IANA registry breaks the hypermedia paradigm and only provides plain-text representations 😞

@ralfhandl ralfhandl merged commit 945905d into OAI:v3.0.4-dev Jun 11, 2024
1 check passed
@handrews handrews deleted the sec-cons-304 branch June 11, 2024 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
security: meta Metadata in and about the specification security
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants