-
Notifications
You must be signed in to change notification settings - Fork 383
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
[WIP] Compose SCAP 1.3 DataStreams #1323
Conversation
|
||
oscap_document_type_t doc_type = oscap_source_get_scap_type(component_source); | ||
if (oscap_str_startswith(filepath, "com.")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is suspicious for me. Is it remote when the file path starts with "com."?
Also, ds_sds_compose_add_component_source_with_ref is called from ds_sds_compose_add_component_with_ref which is called from ds_sds_compose_add_component which is used when composing datastreams.
What if I have a local file com.example.xml
in current working directory and I run this:
oscap ds sds-compose com.example.xml ds.xml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it remote when the file path starts with "com."?
No. I just used a hardcoded string, and a dumb match to it just to see how the output would lookl ike. This PR is very rough, take it with a grain of salt, :)
* downloaded once the scan is run. */ | ||
xmlFree(href); | ||
continue; | ||
* it within the DataStream. Such component shall only be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean after this change it will get included?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not the contents, just a component-ref
in the <ds:checks>
that will reference the remote content, and a <uri>
in each Benchmark component that uses the remote resource.
// fix real_path for remote source | ||
// Update href name to be only remote file (com.redhat.rhsa-RHEL7.xml) | ||
// char *real_path = oscap_strdup(href) | ||
real_path = oscap_strdup("com.redhat.rhsa-RHEL7.xml"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand. If content references any remote content from anywhere, will it always get replaced by RHEL 7 RHSA? Hard coding anything here seems suspicious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just lazy to implement a URL parser before I could test that this is a good approach.
I think we will need a test for this. |
We are not using OpenSCAP to compose DS anymore. Closing. |
This is a very early and rough patch to update openscap to compose SCAP 1.3 compliant Data Streams.
What this PR does for now:
check-content-ref
'shref
attribute is a supported URL (i.e.:http://
orhttps://
)uri
entry in theBenchmark
s component-ref catalog, but don't include its contents in DScomponent-ref
to datastream's<ds:checks>
What it needs to do:
name
anduri
.oscap_source_new_from_url
not sure if makes sense to implement it.Related to ComplianceAsCode/content#4302