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

docs: adding SLSA verification steps to READMEs #344

Merged
merged 5 commits into from
Jan 16, 2024

Conversation

rsoberano-ld
Copy link
Contributor

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Describe the solution you've provided

Drafting up documentation for how consumers may use the SLSA framework to verify SDK packages published with provenance to improve supply chain security.

Describe alternatives you've considered

Provide a clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context about the pull request here.

@rsoberano-ld rsoberano-ld requested a review from mmrj January 9, 2024 02:06
@rsoberano-ld
Copy link
Contributor Author

Starting off with a single SDK for now. If this looks good I'll add this to the other SDK READMEs in this monorepo. Let me know if what we've got so far looks good, namely:

  • Verification steps look reasonable and make sense
  • Language is correct or if there are better ways to phrase things
  • Placement in the README makes sense (didn't want it to show up before the getting started steps, since that's probably what most developers will want to read here)

@rsoberano-ld rsoberano-ld force-pushed the rsoberano/SEC-4729/js-core-slsa branch from 2c588a9 to 2a5ee2e Compare January 9, 2024 03:29
@kinyoklion
Copy link
Member

@rsoberano-ld Did you intent to mark this ready for review?

@kinyoklion
Copy link
Member

For this repo, as many packages have provenance, should we make a central markdown file and link to it from relevant readme files?

@rsoberano-ld rsoberano-ld marked this pull request as ready for review January 9, 2024 17:58
@rsoberano-ld
Copy link
Contributor Author

For this repo, as many packages have provenance, should we make a central markdown file and link to it from relevant readme files?

That's a great idea, I'll update that today

@rsoberano-ld rsoberano-ld requested a review from a team January 9, 2024 17:59
- Use the provenance published in npm to verify the authenticity of the build:
- Check the source commit for:
- Source repository is a LaunchDarkly-owned repository
- Commit author is a LaunchDarkly entity
Copy link
Member

@kinyoklion kinyoklion Jan 9, 2024

Choose a reason for hiding this comment

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

Commits are approved by LD maybe? Many commits are either made by contributors, or made by former employees.

A basic example from erlang: launchdarkly/erlang-server-sdk@v3.0.3...v3.0.4

Copy link
Contributor

@mmrj mmrj left a comment

Choose a reason for hiding this comment

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

Couple of suggestions on how you might want to move this info around. Content LGTM.

@@ -98,6 +98,30 @@ echo "MOBILE_KEY=mob-abc" >> packages/sdk/react-native/example/.env
yarn && yarn ios-go
```

## Validating SDK packages with the SLSA framework

LaunchDarkly uses the [SLSA framework](https://slsa.dev/spec/v1.0/about) to help developers make their supply chain more secure by ensuring the authenticity of our published SDK packages. As part of [SLSA requirements for level 3 compliance](https://slsa.dev/spec/v1.0/requirements), LaunchDarkly publishes provenance about our SDK package builds to NPM for distribution alongside our packages.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
LaunchDarkly uses the [SLSA framework](https://slsa.dev/spec/v1.0/about) to help developers make their supply chain more secure by ensuring the authenticity of our published SDK packages. As part of [SLSA requirements for level 3 compliance](https://slsa.dev/spec/v1.0/requirements), LaunchDarkly publishes provenance about our SDK package builds to NPM for distribution alongside our packages.
LaunchDarkly uses the [SLSA framework](https://slsa.dev/spec/v1.0/about) to help developers make their supply chain more secure by ensuring the authenticity of our published SDK packages. As part of [SLSA requirements for level 3 compliance](https://slsa.dev/spec/v1.0/requirements), LaunchDarkly publishes provenance about our SDK package builds to npm for distribution alongside our packages.

should this be lowercase npm to match the paragraph below? I'm not sure if there's a case where it's all caps

@@ -98,6 +98,30 @@ echo "MOBILE_KEY=mob-abc" >> packages/sdk/react-native/example/.env
yarn && yarn ios-go
```

## Validating SDK packages with the SLSA framework
Copy link
Contributor

Choose a reason for hiding this comment

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

I saw that you're thinking of moving this info to the top-level SECURITY.md file in the cpp-sdk repo.

I think it could be nice for customers to always be able to find this info in the same place.

That means two options:

(a) move this info to the top-level SECURITY.md in this repo (could be okay, but maybe that means this info is too far from the package now? given that this repo has so many SDKs)

(b) reference this info in the top-level SECURITY.md file in this repo, but leave the details here.

If you go with (b), you could update this repo's SECURITY.md with something like: "Validating SDK packages with the SLSA framework / LaunchDarkly uses the SLSA framework to help developers make their supply chain more secure by ensuring the authenticity of our published SDK packages. As part of SLSA requirements for level 3 compliance, LaunchDarkly publishes provenance about our SDK package builds. To learn more, read the "Validating SDK packages" section in the package README." or similar.

Comment on lines 105 to 106
The SLSA framework specifies some [recommendations for verifying build artifacts](https://slsa.dev/spec/v1.0/verifying-artifacts) in their documentation. For npm packages that are published with provenance, npm already [validates the authenticity of the package using Sigstore](https://docs.npmjs.com/generating-provenance-statements#about-npm-provenance). In addition to npm's validation, we recommend the following steps:
- Ensure that the @launchdarkly/react-native-client-sdk version you're downloading was published with npm-verified provenance
Copy link
Contributor

Choose a reason for hiding this comment

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

If you move this content all to SECURITY.md (option (a) above), then you might need sub-sections for each SDK package? Something like:

Suggested change
The SLSA framework specifies some [recommendations for verifying build artifacts](https://slsa.dev/spec/v1.0/verifying-artifacts) in their documentation. For npm packages that are published with provenance, npm already [validates the authenticity of the package using Sigstore](https://docs.npmjs.com/generating-provenance-statements#about-npm-provenance). In addition to npm's validation, we recommend the following steps:
- Ensure that the @launchdarkly/react-native-client-sdk version you're downloading was published with npm-verified provenance
The SLSA framework specifies some [recommendations for verifying build artifacts](https://slsa.dev/spec/v1.0/verifying-artifacts) in their documentation. For npm packages that are published with provenance, npm already [validates the authenticity of the package using Sigstore](https://docs.npmjs.com/generating-provenance-statements#about-npm-provenance). In addition to npm's validation, we recommend several additional steps for each package.
### Validating the React Native SDK package
In addition to npm's recommendation, we recommend the following steps to validate the React Native SDK package:
- Ensure that the @launchdarkly/react-native-client-sdk version you're downloading was published with npm-verified provenance

But not needed if this content is staying here.

@rsoberano-ld rsoberano-ld force-pushed the rsoberano/SEC-4729/js-core-slsa branch from e4b9fbf to 2ebc7d8 Compare January 11, 2024 01:22
Copy link
Contributor

@mmrj mmrj left a comment

Choose a reason for hiding this comment

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

LGTM, added suggestions to bring the header edits from the C++ PR over to this one

@@ -30,6 +30,10 @@ yarn && yarn build && cd packages/sdk/akamai-base
yarn test
```

## Verifying SDK build provenance with the SLSA framework

LaunchDarkly uses the [SLSA framework](https://slsa.dev/spec/v1.0/about) (Supply-chain Levels for Software Artifacts) to help developers make their supply chain more secure by ensuring the authenticity and build integrity of our published SDK packages. To learn more, see the [provenance guide](PROVENANCE.md).
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kinyoklion how would the link to PROVENANCE.md work with npm? do I need to include a relative path here (../../../PROVENANCE.md), or specify the provenance file in the package.json for inclusion?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FWIW the CONTRIBUTING.md link here doesn't seem to work: https://www.npmjs.com/package/@launchdarkly/js-server-sdk-common

Copy link
Member

Choose a reason for hiding this comment

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

Yours should work fine. The relative path would work in github, but not NPM unfortunately.

@rsoberano-ld rsoberano-ld merged commit f85bbea into main Jan 16, 2024
1 check passed
@rsoberano-ld rsoberano-ld deleted the rsoberano/SEC-4729/js-core-slsa branch January 16, 2024 23:45
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.

3 participants