-
Notifications
You must be signed in to change notification settings - Fork 17
Source Code Artifact component #1019
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
Source Code Artifact component #1019
Conversation
// just fall through and get the next file or directory to create | ||
} | ||
|
||
header, err := tr.Next() |
Check failure
Code scanning / CodeQL
Arbitrary file access during archive extraction ("Zip Slip") High
file system operation
Unsanitized archive entry, which may contain '..', is used in a
file system operation
Unsanitized archive entry, which may contain '..', is used in a
file system operation
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.
Smithy scan results
components/targets/source-code-artifact/internal/artifact/extractor/common/untar.go
Outdated
Show resolved
Hide resolved
components/targets/source-code-artifact/internal/artifact/extractor/zip/extractor.go
Outdated
Show resolved
Hide resolved
components/targets/source-code-artifact/internal/artifact/extractor/tar/extractor.go
Outdated
Show resolved
Hide resolved
components/targets/source-code-artifact/internal/artifact/extractor/zip/extractor.go
Outdated
Show resolved
Hide resolved
components/targets/source-code-artifact/internal/artifact/extractor/zip/extractor.go
Outdated
Show resolved
Hide resolved
components/targets/source-code-artifact/internal/artifact/persister/persister.go
Outdated
Show resolved
Hide resolved
components/targets/source-code-artifact/internal/artifact/extractor/common/untar.go
Outdated
Show resolved
Hide resolved
components/targets/source-code-artifact/internal/artifact/extractor/zip/extractor.go
Outdated
Show resolved
Hide resolved
components/targets/source-code-artifact/internal/artifact/extractor/targz/extractor.go
Outdated
Show resolved
Hide resolved
8a8e61e
to
8ec34b6
Compare
8ec34b6
to
2ee6998
Compare
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.
Smithy scan results
components/targets/source-code-artifact/internal/artifact/extractor/zip/extractor.go
Show resolved
Hide resolved
components/targets/source-code-artifact/internal/artifact/extractor/zip/extractor.go
Show resolved
Hide resolved
components/targets/source-code-artifact/internal/artifact/persister/persister.go
Show resolved
Hide resolved
components/targets/source-code-artifact/internal/artifact/extractor/common/untar.go
Show resolved
Hide resolved
components/targets/source-code-artifact/internal/artifact/extractor/zip/extractor.go
Show resolved
Hide resolved
components/targets/source-code-artifact/internal/artifact/extractor/tar/extractor.go
Show resolved
Hide resolved
components/targets/source-code-artifact/internal/artifact/extractor/common/untar.go
Show resolved
Hide resolved
components/targets/source-code-artifact/internal/artifact/extractor/zip/extractor.go
Show resolved
Hide resolved
components/targets/source-code-artifact/internal/artifact/extractor/zip/extractor.go
Show resolved
Hide resolved
components/targets/source-code-artifact/internal/artifact/extractor/zip/extractor.go
Show resolved
Hide resolved
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.
LGTM
2ee6998
to
831a9dd
Compare
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.
Smithy scan results
components/targets/source-code-artifact/internal/artifact/extractor/common/untar.go
Show resolved
Hide resolved
components/targets/source-code-artifact/internal/artifact/extractor/zip/extractor.go
Show resolved
Hide resolved
components/targets/source-code-artifact/internal/artifact/persister/persister.go
Show resolved
Hide resolved
components/targets/source-code-artifact/internal/artifact/extractor/zip/extractor.go
Show resolved
Hide resolved
components/targets/source-code-artifact/internal/artifact/extractor/zip/extractor.go
Show resolved
Hide resolved
components/targets/source-code-artifact/internal/artifact/extractor/zip/extractor.go
Show resolved
Hide resolved
components/targets/source-code-artifact/internal/artifact/extractor/targz/extractor.go
Show resolved
Hide resolved
components/targets/source-code-artifact/internal/artifact/extractor/zip/extractor.go
Show resolved
Hide resolved
components/targets/source-code-artifact/internal/artifact/extractor/common/untar.go
Show resolved
Hide resolved
831a9dd
to
f8a3fc3
Compare
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.
Smithy scan results
Read the README.md for details.
This is a rework of our private s3 target. We are extending it for http archives as well as making it more robust and tested.
This component is able to download and unpack repo archives from:
It supports the following file formats:
It essentially:
artifact_url
sourceCodeWorkspace
for scanners to pick-upI tried to keep it simple by using dependency injection for the fetchers/extractors so the target itself is very small and highly extensible.
How to test:
smithyctl workflow run --build-component-images=true --overrides=examples/source-code-artifact/overrides.yaml examples/source-code-artifact/workflow.yaml
gs://my-bucket/my-archive.zip
, amendexamples/source-code-artifact/overrides.yaml
parameters, including credentials, and re-run the command above.archive_url
likes3://my-bucket/my-archive.tar