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 allow list #373

Merged
merged 1 commit into from
Jun 29, 2022
Merged

Add allow list #373

merged 1 commit into from
Jun 29, 2022

Conversation

lucasgarfield
Copy link
Contributor

@lucasgarfield lucasgarfield commented Jun 1, 2022

Adds an allow list for distributions that verifies that a compose
request's distribution is valid for the requesting account. Validation
is done using the account's orgId, which is cross referenced against an
allow list file pointed to by the ALLOW_FILE environment variable. If no
ALLOW_FILE environment variable is set, a set of fallback default values
is used.

@app-sre-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@lucasgarfield lucasgarfield force-pushed the allow-list branch 3 times, most recently from fa15d2b to 3c14ebc Compare June 1, 2022 15:17
@lucasgarfield lucasgarfield changed the title Build Fedora images Add allow list Jun 1, 2022
Copy link
Member

@ondrejbudai ondrejbudai left a comment

Choose a reason for hiding this comment

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

This is awesome! I like that it's documented and fully functional (hopefully, no test coverage, I will get to this later).

I put my observations inline, my main thoughts are: reading the file must be elsewhere and we should make sure that this doesn't add much burden when defining new distros (therefore I proposed restricted distributions and globs in the allow list). Otherwise, these are just minor Go things that you didn't know.

The other big missing thing is testing - we should try to cover everything as much as possible, unit testing is fine.

Anyway, thanks for your work, and I'm happy to discuss everything in more depth if needed. :)

internal/common/allow.go Outdated Show resolved Hide resolved
internal/common/allow.go Outdated Show resolved Hide resolved
internal/common/allow.go Outdated Show resolved Hide resolved
internal/common/allow.go Outdated Show resolved Hide resolved
internal/common/allow.go Show resolved Hide resolved
internal/common/allow.go Outdated Show resolved Hide resolved
@lucasgarfield lucasgarfield force-pushed the allow-list branch 2 times, most recently from 7a687a2 to 96e4497 Compare June 14, 2022 15:01
internal/common/allow.go Outdated Show resolved Hide resolved
internal/common/allow.go Outdated Show resolved Hide resolved
internal/common/allow.go Outdated Show resolved Hide resolved
internal/common/allow.go Outdated Show resolved Hide resolved
internal/v1/server.go Outdated Show resolved Hide resolved
@lucasgarfield lucasgarfield force-pushed the allow-list branch 2 times, most recently from 29617b3 to 2912116 Compare June 23, 2022 09:36
@lucasgarfield lucasgarfield marked this pull request as ready for review June 23, 2022 09:40
Copy link
Member

@ondrejbudai ondrejbudai left a comment

Choose a reason for hiding this comment

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

Nice, we are getting really close, this is exciting, thank you! :)

internal/common/allow.go Outdated Show resolved Hide resolved
internal/common/allow_test.go Outdated Show resolved Hide resolved
@lucasgarfield lucasgarfield force-pushed the allow-list branch 2 times, most recently from 7370eb7 to f39a2b9 Compare June 28, 2022 15:29
Adds an allow list for distributions that verifies that a compose
request's distribution is valid for the requesting account. Validation
is done using the account's orgId, which is cross referenced against an
allow list file pointed to by the ALLOW_FILE environment variable. If no
ALLOW_FILE environment variable is set, then an empty allow list is used
as a default value.
Copy link
Member

@ondrejbudai ondrejbudai left a comment

Choose a reason for hiding this comment

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

This is great, thank you!

@ondrejbudai ondrejbudai merged commit 425edc9 into osbuild:main Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants