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

Outputting yaml from the CLI cannot be re-applied #4623

Open
rdimitrov opened this issue Oct 3, 2024 · 0 comments · May be fixed by #4960
Open

Outputting yaml from the CLI cannot be re-applied #4623

rdimitrov opened this issue Oct 3, 2024 · 0 comments · May be fixed by #4960
Assignees
Labels
bug Something isn't working

Comments

@rdimitrov
Copy link
Member

rdimitrov commented Oct 3, 2024

Describe the issue

It is expected that using minder profile get -o yaml ... would produce a YAML file that one could quickly modify and then re-apply with minder profile apply -f ..., but this seems not to be the case.

Thanks to @danbarr for reporting this.

Note: The same goes for ruletypes, not just profiles.

To Reproduce

The YAML produced by get -o yaml has the profile definition nested under a top level profile node, like such:

profile:
    alert: "off"
    context:
        project: b3d294d7-4b82-4550-9171-2e3398e4a064
    displayName: Sample Profile
    id: 2285a65d-d3ef-432f-a66f-5d99f1e4b5d1
    name: acme-github-profile
    remediate: "off"
...

But the expected format is:

version: v1
type: profile
alert: "off"
context:
    project: b3d294d7-4b82-4550-9171-2e3398e4a064
displayName: Sample Profile
id: 2285a65d-d3ef-432f-a66f-5d99f1e4b5d1
name: acme-github-profile
remediate: "off"
...

Once edited out the profile: node and added version/type, it was then possible to apply it with the rest of the contents that get had generated.

What version are you using?

No response

@rdimitrov rdimitrov added the bug Something isn't working label Oct 3, 2024
@JAORMX JAORMX self-assigned this Nov 11, 2024
JAORMX added a commit to JAORMX/minder that referenced this issue Nov 13, 2024
This follows mindersec#4936 and prints
profiles as individual YAML documents.

Closes mindersec#4623

Signed-off-by: Juan Antonio Osorio <[email protected]>
@JAORMX JAORMX linked a pull request Nov 13, 2024 that will close this issue
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants