Internal CodeArtifact package does not allow publishing versions already present in external public sources
codeartifact_packages_external_public_publishing_disabled
AWS CodeArtifact packages with an internal or unknown origin are evaluated for their package origin controls. The check identifies packages where the upstream setting allows ingesting versions from external or upstream repositories.
Risk
Allowing upstream on internal packages enables dependency confusion: public repos can supply higher versions to builds, leading to malicious code execution and package tampering. This threatens integrity, exposes secrets and data (confidentiality), and may disrupt pipelines and services (availability).
prowler aws --checks codeartifact_packages_external_public_publishing_disabled
prowler aws --checks codeartifact_packages_external_public_publishing_disabled --fixer
Recommendation
Enforce Package Origin Controls so internal packages use upstream=BLOCK and only trusted publish paths. Apply least privilege with package groups and private namespaces, pin versions, and prefer private endpoints. Add artifact signing and CI isolation, and monitor package events for unexpected source changes.
Remediation
aws codeartifact put-package-origin-configuration --domain <DOMAIN> --repository <REPOSITORY> --format <FORMAT> --package <PACKAGE_NAME> --restrictions publish=ALLOW,upstream=BLOCK
- In the AWS Console, go to CodeArtifact > Repositories and select <REPOSITORY>
- In Packages, open the internal package <PACKAGE_NAME>
- Under Origin controls, choose Edit
- Set Upstream to Block (leave Publish as Allow if required)
- Save
Source Code
Resource Type
Other
References
- https://noise.getoto.net/2022/07/15/tighten-your-package-security-with-codeartifact-package-origin-control-toolkit/
- https://docs.aws.amazon.com/codeartifact/latest/ug/package-origin-controls.html
- https://newstar.cloud/blog/improve-the-security-of-your-software-supply-chain-with-amazon-codeartifact-package-group-configuration/
- https://zego.engineering/dependency-confusion-in-aws-codeartifact-86b9ff68963d