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 OSPS Baseline Level 1 rules. #265

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

blkt
Copy link
Contributor

@blkt blkt commented Jan 10, 2025

This change adds all currently implemented rule types for OSPS Baseline Level 1.

Some rules were copy-pasted from rules like
e.g. branch_protection_allow_deletions in order to (a) be able to change them independently and (b) change the name to something descriptive in the scope of Security Baseline. We generally do not foster this, but in this case we deemed simplicity was preferable to avoiding duplication.

Along the rules themselves, tests were added to new, existing ones, and their copies.

Fixes stacklok/minder-stories#198

@blkt blkt self-assigned this Jan 10, 2025
@blkt blkt requested a review from a team as a code owner January 10, 2025 19:07
@blkt blkt force-pushed the feat/add-baseline-profile-and-rules branch from b3b647a to 50f2fb9 Compare January 10, 2025 19:08
@blkt blkt changed the title Add OSPS Baseline rules. Add OSPS Baseline Level 1 rules. Jan 10, 2025
evankanderson
evankanderson previously approved these changes Jan 10, 2025
Copy link
Member

@evankanderson evankanderson left a comment

Choose a reason for hiding this comment

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

I'm assuming a future PR will add a profile definition for maturity level 1?

data-sources/ghapi.yaml Outdated Show resolved Hide resolved
security-baseline/rule-types/github/osps-do-01.yaml Outdated Show resolved Hide resolved
Comment on lines 1 to 7
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

...
Copy link
Member

Choose a reason for hiding this comment

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

This shouldn't be a license file, this should say something like:

Suggested change
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
...
# Contributing to Foo
We welcome contributions, and the rest of this doc is slap-dash! Sorry!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We're just checking for existence, not content.
I'm not sure we want to check contents as well, might be tricky.

@blkt
Copy link
Contributor Author

blkt commented Jan 11, 2025

I'm assuming a future PR will add a profile definition for maturity level 1?

Yes, sorry for the confusing branch name.
The idea was to write the profile and have it applied in staging under mindersec project so that we keep tabs on our own repos.

@blkt blkt force-pushed the feat/add-baseline-profile-and-rules branch from 9525df8 to 9fb924a Compare January 13, 2025 09:51
@blkt
Copy link
Contributor Author

blkt commented Jan 13, 2025

@evankanderson our good @teodor-yanev was quicker than I was and got the profile merged earlier today.
I've rebased on top of his work and integrated the profile with the new rules.

This change adds all currently implemented rule types for OSPS
Baseline Level 1.

Some rules were copy-pasted from rules like
e.g. `branch_protection_allow_deletions` in order to (a) be able to
change them independently and (b) change the name to something
descriptive in the scope of Security Baseline. We generally do not
foster this, but in this case we deemed simplicity was preferable to
avoiding duplication.

Along the rules themselves, tests were added to new, existing ones,
and their copies.

Fixes stacklok/minder-stories#198
@blkt blkt force-pushed the feat/add-baseline-profile-and-rules branch from 9fb924a to ef919c5 Compare January 14, 2025 09:34
Copy link
Member

@evankanderson evankanderson left a comment

Choose a reason for hiding this comment

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

There are a couple places where we use a git ingest (which requires cloning the repo), where we should prefer using a REST ingest. Other than that, these LGTM (or at least sufficient to merge).

If you can approve the 4 suggestions, I'm happy to merge.

security-baseline/rule-types/github/osps-do-01.yaml Outdated Show resolved Hide resolved
security-baseline/rule-types/github/osps-do-01.yaml Outdated Show resolved Hide resolved
security-baseline/rule-types/github/osps-do-01.yaml Outdated Show resolved Hide resolved
security-baseline/rule-types/github/osps-qa-01.yaml Outdated Show resolved Hide resolved
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.

2 participants