-
Notifications
You must be signed in to change notification settings - Fork 27
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
AWS Schemas, Take 5 #123
AWS Schemas, Take 5 #123
Conversation
Re-Adding @DavidRies comments from previous PR: Hi @wmunyan , I reviewed the new tests and... generally this all looks great! I'm excited to have these capabilities in OVAL. Here are a few minor comments... Versioning? Should we add an API version (required for all objects, optional for state, included in item)? That would allow the engine to attempt to use the API version the content author wrote against. If/when the API version is no longer available, that would also make it much easier to identify the affected objects. WDYT? API Orientation of api_test and apicontent_test For example, it might be nicer to have a instance_security_group_test that allowed authors to make assertions about the protocols allowed for ingress/egress to instances. With the protocol-oriented tests proposed, I think this is still possible, but it might require making calls to one API method to get instances and associated security group ids which are used as a filter on the results of another object/API call to get security group ingress/egress properties. However, I do think this protocol-orientation is the right approach right now. The API is so extensive that creating simplified, semantic OVAL tests for common use cases would take a long time. And, because the API and security controls are evolving relatively quickly, we'd need this generic/API capability in any case. I hope that over time, we--as a community--will discover common usage patterns of these API calls and will add simplified, semantic tests for them. credentialreport_test For example, if I wanted to make an assertion about the last rotated date, I would need to make it twice, once for access_key_1_last_rotated and once for access_key_2_last_rotated. The same goes for the cert_1 and cert_2 entities. Do you think it would make sense to break this into three tests as follows: credentialreportsuser_test with state/item entities: user, arn, user_creation_time, password_enabled, password_last_used, password_last_changed, password_next_rotation, mfa_active Thoughts? -David |
Should we add an API version?
API Orientation of api_test and apicontent_test
credentialreport_test
Thanks again for all the feedback! |
Should we add an API version?I think the required @api_version would mean that that exact version of the API has to be used (not a minimum) by the engine and if that version isn't available, then the result would be not_checked. API versions are not necessarily backwards compatible. The content will use specific API methods that exist in a specific version of the API and specify response JSON paths based on the response structure of that API version. Other API versions (earlier or later) may not have those methods and/or may have them, but may have different response structure/formats. Content written for API version 2 may be meaningless against API version 3. I don't know how much about AWS API versioning, but they don't seem to change very often. Some AWS guidance I found seems to recommend that API consumers using an explicit version in production code:
This should be a maintainable approach. When AWS deprecates a specific API version, we could easily identify all content tied to that version and upgrade it to a supported version. Credential Report Test
I assume the engine would collect the data as you described (once). The advantage of using multiple tests is that it would make some content simpler. For example, to assert that access keys have been rotated in the proposed schema may require:
Whereas, with a credentialreportskey_test that returns an item for each access key (if they exist):
|
@DavidRies I've read your ideas around splitting the |
…t into 3: user/key/cert
@DavidRies Any chance you can commit to a review before the next Area Supervisors meeting on 7/19? |
I'll do my best! |
Hi @wmunyan, I see you've added API version and split the credential report test as we discussed. That looks good to me--I hope it ends up making the content more reliable, maintainable and simple (as intended), :). |
… for new platform schemas
@wmunyan don't forget to add aws and panos values to the FamilyEnumeration in oval-common-schema.xsl as well. |
@solind Thank you! Updated and added to PR. |
This PR represents the addition of a new schema applicable to the collection and evaluation of AWS environments using their respective API.
The current proposal includes an enumeration for the various AWS services that may be queried using the API/SDK/CLI. I am not married to the idea that this element needs to be an enumeration, as the list services changes/expands/evolves rapidly. If this element is changed to a simple Entity(Object|State|Item)StringType, I am fine with that, and can include documentation that if a service is incorrect or unavailable, that some sort of error should occur (maybe an item status="error" or similar).
This PR includes 3 test/obj/state constructs:
This updates the API test according to @solind's comment regarding using an element for holding JSON data and using JSONPath expressions to evaluate collection of information.