CIS Software Supply Chain Security benchmark
Description
The CIS Software Supply Chain Security benchmark provides prescriptive guidance for establishing a secure configuration posture for Software Development Platforms and Pipelines.
CIS Benchmarks are best practices for the secure configuration of a target system. In this case, the target system is the software supply chain.
Rationale
This CIS Guide is intended for DevOps and application security administrators, security specialists, auditors, help desks, and platform deployment personnel who plan to develop, deploy, assess, or secure solutions to build and deploy software updates through automated means of DevOps pipelines.
This benchmark / guide follows the phases of the software supply chain and is intended for assessing the integrity of source code, build and deployment systems. The guide is organized under five categories:
-
Source code: Security recommendations for proper source code management of any application developed by the organization.
-
Build pipelines: Security recommendations for the management and security of the build pipeline components.
-
Dependencies: Security recommendations for the management of various dependencies introduced as part of the software build and release process.
-
Artifacts: Security recommendations for the management of artifacts produced by build pipelines, as well as ones used by the application in the build process itself.
-
Deployment: Security recommendations for the management of the application deployment process, the configurations, and the files that come with it.
Benefits
Following the guide may help organizations to:
-
Prevent injection of malicious code into source control and package/component repositories.
-
Improve the security of the source code management system itself.
-
Protect the integrity of dependencies and the attacks that leverage weaknesses in the package managers.
-
Produce safer builds, attesting the relation between the source code and the artifacts generated from it.
-
Help with maintaining the integrity of artifacts ready to be deployed in the target environments.
-
Maintain integrity of the deployment environment, avoiding insecure configurations and unintended actions that might subvert the security of the software deployed.
1.1.1 Ensure any changes to code are tracked in a version control platform
ID |
cis_sscs/code_in_vcs |
Severity |
critical |
Category |
source_code/code_changes |
Levels |
|
Optional |
false |
Tags |
security, supply-chain |
Rationale
Version control platforms keep track of every modification to code. They represent the cornerstone of code security, as well as allow for better code collaboration within engineering teams. With granular access management, change tracking, and key signing of code edits, version control platforms are the first step in securing the software supply chain.
1.1.3 Ensure any change to code receives approval of a minimum strongly authenticated users
ID |
cis_sscs/minimum_approvals |
Severity |
critical |
Category |
source_code/code_changes |
Levels |
|
Optional |
false |
Tags |
code-reviews, slsa-4, source-code, supply-chain |
Description
Ensure that every code change is reviewed and approved by a minimum number of authorized contributors, from the team relevant to the code change.
Rationale
To prevent malicious or unauthorized code changes, the first layer of protection is the process of code review. This process involves engineer teammates reviewing each other’s code for errors, optimizations, and general knowledge-sharing. With proper peer reviews in place, an organization can detect unwanted code changes very early in the process of release. In order to help facilitate code review, companies should employ automation to verify that every code change has been reviewed and approved by a minimum number of team members before it is pushed into the code base. These team members should be from the team that is related to the code change, so it will be a meaningful review.
Verification
Ensure that for every code repository in use, verify that a minimum number of approvals from the specific code repository team are required in order to push new code to the code base.
Remediation
An organization can protect specific code branches — for example, the "main" branch which often is the version deployed to production — by setting protection rules. These rules secure your code repository from unwanted or unauthorized changes. You may set requirements for any code change to that branch, and thus specify a minimum number of reviewers required to approve a change.
1.1.4 Ensure previous approvals are dismissed when updates are introduced to a code change proposal
ID |
cis_sscs/previous_approval_dismissed |
Severity |
critical |
Category |
source_code/code_changes |
Levels |
|
Optional |
false |
Tags |
code-reviews, source-code, supply-chain |
Description
Ensure that when a proposed code change is updated, previous approvals are declined, and new approvals are required.
Rationale
An approval process is necessary when code changes are suggested. Through this approval process, however, changes can still be made to the original proposal even after some approvals have already been given. This means malicious code can find its way into the code base even if the organization has enforced a review policy. To ensure this is not possible, outdated approvals must be declined when changes to the suggestion are introduced.
Verification
Ensure that if new code changes are pushed to a specific proposal, all previously accepted code change proposals must be declined.
Remediation
For each code repository in use, enforce an organization-wide policy to dismiss given approvals to code change suggestions if those suggestions were updated.
When using Azure Devops, enforce Require a minimum number of reviewers
policy is enabled, and When new changes are pushed
option is enabled using one of Reset all approval votes
or Reset all code reviewer votes
.
1.1.5 Ensure there are restrictions on who can dismiss code change reviews
ID |
cis_sscs/dismissal_restrictions |
Severity |
critical |
Category |
source_code/code_changes |
Levels |
|
Optional |
false |
Tags |
code-reviews, source-code, supply-chain |
Description
Ensure there are restrictions on who can dismiss code change reviews. Only trusted users should be allowed to dismiss code change reviews.
Rationale
Dismissing a code change review permits users to merge new suggested code changes without going through the standard process of approvals. Controlling who can perform this action will prevent malicious actors from simply dismissing the required reviews to code changes and merging malicious or dysfunctional code into the code base.
In cases where a code change proposal has been updated since it was last reviewed and the person who reviewed it isn’t available for approval, a general collaborator would not be able to merge their code changes until a user with "dismiss review" abilities could dismiss the open review.
Users who are not allowed to dismiss code change reviews will not be permitted to do so, and thus are unable to waive the standard flow of approvals.
Verification
For each code repository in use, ensure that only trusted users are allowed to dismiss code change reviews.
Remediation
For each code repository in use, do not grant the permission to dismiss code changes reviews unless it is really necessary. If it is obligatory, carefully select the individual collaborators or groups whom you trust with the ability to dismiss code change reviews.
By default, all users who have write access to the code repository are able to dismiss code change reviews.
For Azure Devops repositories, enable Require a minimum number of reviewers
policy and ensure Allow requestors to approve their own changes
is disabled, Prohibit the most recent pusher from approving their own changes
is enabled, and Allow completion even if some reviewers vote to wait or reject
is disabled.
1.1.6 Ensure code owners are set for extra sensitive code or configuration
ID |
cis_sscs/owners_sensitive_code |
Severity |
critical |
Category |
source_code/code_changes |
Levels |
|
Optional |
false |
Tags |
branch-protection, code-reviews, security, slsa-4, source-code, supply-chain |
Description
Code owners are trusted users that are responsible for reviewing and managing an important piece of code or configuration. An organization is advised to set code owners for every extremely sensitive code or configuration.
Rationale
Configuring code owners protects data by verifying that trusted users will notice and review every edit, thus preventing unwanted or malicious changes from potentially compromising sensitive code or configurations.
Code owner users will receive notifications for every change that occurs to the code and subsequently added as reviewers of pull requests automatically.
1.1.8 Ensure inactive branches are periodically reviewed and removed
ID |
cis_sscs/inactive_branches |
Severity |
low |
Category |
source_code/code_changes |
Levels |
|
Optional |
false |
Tags |
code-reviews, maintenance |
Description
Keep track of code branches that are inactive for a lengthy period of time and periodically remove them.
In this checkpoint you can configure the inactive time to consider that the branches should be removed by threshold
property.
Rationale
Git branches that have been inactive (i.e., no new changes introduced) for a long period of time are enlarging the surface of attack for malicious code injection, sensitive data leaks, and CI pipeline exploitation. They potentially contain outdated dependencies which may leave them highly vulnerable. They are more likely to be improperly managed, and could possibly be accessed by a large number of members of the organization.
Removing inactive Git branches means that any code changes they contain would be removed along with them, thus work done in the past might not be accessible after auditing for inactivity.
1.1.9 Ensure all checks have passed before merging new code
ID |
cis_sscs/status_checks |
Severity |
critical |
Category |
source_code/code_changes |
Levels |
|
Optional |
false |
Tags |
branch-protection, slsa-4, source-code, supply-chain |
Description
Ensure that before a code change request can be merged to the code base, all predefined checks must successfully pass.
Rationale
On top of manual reviews of code changes, a code protect should contain a set of prescriptive checks which validate each change. Organizations should enforce those status checks so that changes can only be introduced if all checks have successfully passed. This set of checks should serve as the absolute quality, stability, and security conditions which must be met in order to merge new code to a project.
Code changes in which all checks do not pass successfully would not be able to be pushed into the code base of the specific code repository.
1.1.10 Ensure open branches are up-to-date before merge
ID |
cis_sscs/strict_status_checks |
Severity |
high |
Category |
source_code/code_changes |
Levels |
|
Optional |
false |
Tags |
branch-protection, source-code, supply-chain |
Description
Organizations should make sure each suggested code change is in full sync with the existing state of its origin code repository before allowing merging.
Rationale
Code branches can easily become outdated since the origin code repository is constantly being edited. This means engineers working on separate code branches can accidentally include outdated code with potential security issues which might have already been fixed, overriding the potential solutions for those security issues when merging their own changes.
If enforced, outdated branches would not be able to be merged into their origin repository without first being updated to contain any recent changes.
1.1.11 Ensure all open comments are resolved before allowing code change merging
ID |
cis_sscs/comments_resolved |
Severity |
critical |
Category |
source_code/code_changes |
Levels |
|
Optional |
false |
Tags |
code-reviews, security, supply-chain |
Description
Organizations should enforce a "no open comments" policy before allowing code change merging.
Rationale
In an open code change proposal, reviewers can leave comments containing their questions and suggestions. These comments can also include potential bugs and security issues. Requiring all comments on a code change proposal to be resolved before it can be merged ensures that every concern is properly addressed or acknowledged before the new code changes are introduced to the code base.
Code change proposals containing open comments would not be able to be merged into the code base.
Verification
For every code repository in use, verify that each merged code change does not contain open, unattended comments.
Remediation
For each code repository in use, require open comments to be resolved before the relevant code change can be merged.
When working with Azure Devops, activate and mark required the Check for comment resolution policy
for protected branches.
By default, code changes with open comments on them are able to be merged into the code base.
1.1.12 Ensure verification of signed commits for new changes before merging
ID |
cis_sscs/signed_commits |
Severity |
high |
Category |
source_code/code_changes |
Levels |
|
Optional |
false |
Tags |
branch-protection, cicd-sec-09, cicd-security, security, supply-chain |
Rationale
Signing commits, or requiring to sign commits, gives other users confidence about the origin of a specific code change. It ensures that the author of the change is not hidden and is verified by the version control system, thus the change comes from a trusted source.
1.1.13 Ensure linear history is required
ID |
cis_sscs/linear_history |
Severity |
high |
Category |
source_code/code_changes |
Levels |
|
Optional |
false |
Description
Linear history is the name for Git history where all commits are listed in chronological order, one after another. Such history exists if a pull request is merged either by rebase merge (re-order the commits history) or squash merge (squashes all commits to one). Ensure that linear history is required by requiring the use of rebase or squash merge when merging a pull request.
Rationale
Enforcing linear history produces a clear record of activity, and as such it offers specific advantages: it is easier to follow, easier to revert a change, and bugs can be found more easily.
1.1.14 Ensure branch protection rules are enforced for administrators
ID |
cis_sscs/branch_rules_enforced_admins |
Severity |
high |
Category |
source_code/code_changes |
Levels |
|
Optional |
false |
Tags |
branch-protection, least-privilege, security, supply-chain |
Rationale
Administrators by default are excluded from any branch protection rules. This means these privileged users (both on the repository and organization levels) are not subject to protections meant to prevent untrusted code insertion, including malicious code. This is extremely important since administrator accounts are often targeted for account hijacking due to their privileged role.
1.1.15 Ensure pushing or merging of new code is restricted to specific individuals or teams
ID |
cis_sscs/pushing_restricted |
Severity |
critical |
Category |
source_code/code_changes |
Levels |
|
Optional |
false |
Tags |
branch-protection, security, source-code, supply-chain |
Rationale
Requiring that only trusted users may push or merge new changes reduces the risk of unverified code, especially malicious code, to a protected branch by reducing the number of trusted users who are capable of doing such.
1.1.16 Ensure force push code to branches is denied
ID |
cis_sscs/force_push_denied |
Severity |
critical |
Category |
source_code/code_changes |
Levels |
|
Optional |
false |
Tags |
branch-protection, security, supply-chain |
Description
The "Force Push" option allows users with "Push" permissions to force their changes directly to the branch without a pull request, and thus should be disabled.
Rationale
The "Force Push" option allows users to override the existing code with their own code. This can lead to both intentional and unintentional data loss, as well as data infection with malicious code. Disabling the "Force Push" option prohibits users from forcing their changes to the master branch, which ultimately prevents malicious code from entering source code.
1.1.17 Ensure protected branch deletions are denied
ID |
cis_sscs/branch_deletions_denied |
Severity |
critical |
Category |
source_code/code_changes |
Levels |
|
Optional |
false |
Tags |
branch-protection, security, source-code, supply-chain |
Rationale
When enabling deletion of a protected branch, any user with at least push access to the repository can delete a branch. This can be potentially dangerous, as a simple human mistake or a hacked account can lead to data loss if a branch is deleted. It is therefore crucial to prevent such incidents by denying protected branch deletion.
Verification
For each repository that is being used, verify that protected branches cannot be deleted.
1.2.1 Ensure all public repositories contain a SECURITY.md file
ID |
cis_sscs/contain_security_md |
Severity |
critical |
Category |
source_code/repository |
Levels |
|
Optional |
false |
Tags |
policy, security, supply-chain |
Description
A SECURITY.md file is a security policy file that offers instruction on reporting security vulnerabilities in a project.
Rationale
A SECURITY.md file provides users with crucial security information. It can also serve an important role in project maintenance, encouraging users to think ahead about how to properly handle potential security issues, updates and general security practices.
1.2.2 Ensure repository creation is limited to specific members
ID |
cis_sscs/repository_creation |
Severity |
high |
Category |
source_code/repository |
Levels |
|
Optional |
false |
Tags |
code-leakage, least-privilege, repo-permissions |
Rationale
Restricting repository creation to trusted users and teams is recommended in order to keep the organization properly structured, track fewer items, prevent impersonation, and to not overload the version-control system. It will allow administrators easier source code tracking and management capabilities, as they will have fewer repositories to track. The process of detecting potential attacks also becomes far more straightforward, as well, since the easier it is to track the source code, the easier it is to detect malicious acts within it. Additionally, the possibility of a member creating a public repository and sharing the organization’s data externally is significantly decreased.
1.2.3 Ensure repository deletion is limited to specific users
ID |
cis_sscs/repository_deletion |
Severity |
high |
Category |
source_code/repository |
Levels |
|
Optional |
false |
Tags |
least-privilege, repo-permissions, slsa-3, slsa-4 |
Rationale
Restricting the ability to delete repositories protects the organization from intentional and unintentional data loss. This ensures that users cannot delete repositories or cause other potential damage — whether by accident or due to their account being hacked — unless they have the correct privileges.
1.2.4 Ensure issue deletion is limited to specific users
ID |
cis_sscs/issue_deletion |
Severity |
critical |
Category |
source_code/repository |
Levels |
|
Optional |
false |
Tags |
issue-permissions, least-privilege, slsa-3, slsa-4, supply-chain |
Rationale
Issues are a way to keep track of things happening in repositories, such as setting new milestones or requesting urgent fixes. Deleting an issue is not a benign activity, as it might harm the development workflow or attempt to hide malicious behavior. Because of this, it should be restricted and allowed only by trusted and responsible users.
1.3.1 Ensure inactive users are reviewed and removed periodically
ID |
cis_sscs/inactive_users |
Severity |
low |
Category |
source_code/code_changes |
Levels |
|
Optional |
false |
Tags |
maintenance, security, slsa-4, supply-chain |
Description
Ensure inactive users are reviewed and removed periodically.
In this checkpoint you can configure the inactive time to consider that the users should be removed by inactiveDays
property.
Rationale
User accounts that have been inactive for a long period of time are enlarging the surface of attack. Inactive users with high-level privileges are of particular concern, as these accounts are more likely to be targets for attackers. This could potentially allow access to large portions of an organization should such an attack prove successful. It is recommended to remove them as soon as possible in order to prevent this.
1.3.3 Ensure maximum number of administrators are set for the organization
ID |
cis_sscs/minimum_admins_org |
Severity |
critical |
Category |
source_code/contribution_access |
Levels |
|
Optional |
false |
Tags |
administrators, least-privilege, slsa-4 |
Description
Ensure the organization has (at most) a given number of administrators, below a certain threshold.
You can configure the maximum number of administrators by changing these properties in conf/compliance/checkpoints/cis_sscs/maximum_admins_org.yml
:
-
maxAdministrators
: The maximum number of administrators allowed for the organization. (Default value: 2)
Rationale
Organization administrators [1] have the highest level of permissions, including the ability to add/remove collaborators, create or delete repositories, change branch protection policy, and convert a repo to be publicly-accessible.
Due to the permissive access granted to an organization administrator, it is highly recommended to keep the number of administrator accounts as minimal as possible.
It is customary to have at least two administrators for staff redundancy, but this check tries to curb the number of administrators. |
1.3.5 Ensure the organization is requiring members to use Multi-Factor Authentication (MFA)
ID |
cis_sscs/organization_mfa |
Severity |
critical |
Category |
source_code/contribution_access |
Levels |
|
Optional |
false |
Tags |
mfa, security, slsa-3, slsa-4, supply-chain |
Description
Require members of the organization to use Multi-Factor Authentication (MFA) in addition to a standard username and password when authenticating to the source code management platform.
Rationale
By default, every user authenticates within the system by password only. If the password of a user is compromised, however, the user account and every repository to which they have access are in danger of data loss, malicious code commits, and data theft.
It is therefore recommended that each user has Multi-Factor Authentication enabled. This adds another layer of protection to ensure the account remains secure even if the user’s password is compromised.
Members without MFA enabled should not contribute to organization’s projects. They should enable MFA before they can contribute any code.
1.3.7 Ensure two administrators are set for each repository
ID |
cis_sscs/repositories_admins |
Severity |
low |
Category |
source_code/contribution_access |
Levels |
|
Optional |
false |
Tags |
administrators, least-privilege, slsa-4 |
Description
Ensure every repository has a minimum number of users with administrative permissions.
You can configure the maximum and minimum number of administrators by changing these properties in conf/compliance/checkpoints/cis_sscs/repositories_admins.yml
:
-
minAdministrators
: Minimum number of administrators by repository. Often 2 is recommended for staff redundancy. (Default value: 2) -
maxAdministrators
: Maximum number of administrators by repository. The principle of least privilege recommends limiting the number of administrators. (Default value: 2)
Rationale
Repository administrators have the highest permissions to said repository. These include the ability to add/remove collaborators, change branch protection policy, and convert to a publicly-accessible repository.
Due to the liberal access granted to a repository administrator, it is highly recommended that only a limited number contributors occupy this role.
On the other side, it is also recommended, for staff redundancy, to have also a minimum number of repository administrators.
1.3.8 Ensure strict base permissions are set for repositories
ID |
cis_sscs/org_default_repo_permission |
Severity |
critical |
Category |
source_code/contribution_access |
Levels |
|
Optional |
false |
Tags |
least-privilege, security, slsa-4, supply-chain |
Description
Base permissions define the permission level automatically granted to all organization members. Define strict base access permissions for all the repositories in the organization, including new ones.
Rationale
Defining strict base permissions is the best practice in every role-based access control (RBAC) system. If the base permission is high — for example, "write" permission — every member of the organization will have "write" permission to every repository in the organization.
This will apply regardless of the specific permissions a user might need, which generally differ between organization repositories. The higher the permission, the higher the risk for incidents such as bad code commit or data breach.
It is therefore recommended to set the base permissions to the strictest level possible.
1.3.9 Ensure an organization’s identity is confirmed with a "Verified" badge
ID |
cis_sscs/identity_verified |
Severity |
critical |
Category |
source_code/contribution_access |
Levels |
|
Optional |
false |
Tags |
security, supply-chain, vetting |
Rationale
Verifying the organization’s domain gives developers assurance that a given domain is truly the official home for a public organization. Attackers can pretend to be an organization and steal information via a faked/spoof domain, therefore the use of a "Verified" badge instills more confidence and trust between developers and the open-source community.
2.3.1 Ensure all build steps are defined as code
ID |
cis_sscs/steps_as_code |
Severity |
low |
Category |
build_pipelines/pipeline_instructions |
Levels |
|
Optional |
false |
Tags |
build, pipeline, slsa-1, slsa-2, slsa-3, slsa-4, supply-chain |
Rationale
Storing pipeline instructions as code in a version control system means automation of the build steps and less room for human error, which could potentially lead to a security breach.
Additionally, it creates the ability to revert to a previous pipeline configuration in order to pinpoint the affected change should a malicious incident occur.
2.3.5 Ensure access to build process triggering is minimized
ID |
cis_sscs/access_build_min |
Severity |
critical |
Category |
build_pipelines/pipeline_instructions |
Levels |
|
Optional |
false |
Tags |
security, supply-chain |
Rationale
Build pipelines are used for multiple reasons. Some are very sensitive, such as pipelines which deploy to production. In order to protect the environment from malicious acts or human mistakes, such as a developer deploying a bug to production, it is important to apply the Least Privilege principle to pipeline triggering. This principle requires restrictions placed on which users can run which pipeline. It allows for sensitive pipelines to only be run by administrators, who are generally the most trusted and skilled members of the organization.
2.3.7 Ensure pipelines are automatically scanned for vulnerabilities
ID |
cis_sscs/pipeline_scan_vuln |
Severity |
low |
Category |
build_pipelines/pipeline_instructions |
Levels |
|
Optional |
true |
Tags |
sca, security, slsa-4, supply-chain |
Description
Scan for vulnerabilities in build pipelines. It is recommended to use an automated tools for detecting known vulnerabilities.
The vulnerability scanners to be considered may be configured for this checkpoint.
Rationale
Automatic scanning for vulnerabilities detects known vulnerabilities in pipeline instructions and components, allowing faster patching in case one is found. These vulnerabilities can lead to a potentially massive breach if not handled as fast as possible, as attackers might also be aware of such vulnerabilities.
2.3.8 Ensure scanners are in place to identify and prevent sensitive data in pipeline files
ID |
cis_sscs/secrets_scan |
Severity |
low |
Category |
build_pipelines/pipeline_instructions |
Levels |
|
Optional |
true |
Tags |
secrets-scanner, security, slsa-4, supply-chain |
Description
Detect and prevent sensitive data, such as confidential ID numbers, passwords, etc., in pipelines.
You can configure tools or run commands to check for workflows uses tools to verify this. The parameter are tools
and commands
.
Rationale
Sensitive data in pipeline configuration, such as cloud provider credentials or repository credentials, create vulnerabilities with which malicious actors could steal such information if they gain access to a pipeline. In order to mitigate this, set scanners that will identify and prevent the existence of sensitive data in the pipeline.
Verification
For every pipeline that is in use, verify that scanners are set to identify and prevent the existence of sensitive data within it.
2.4.2 Ensure all external dependencies used in the build process are locked
ID |
cis_sscs/pipeline_external_dependencies |
Severity |
high |
Category |
build_pipelines/pipeline_integrity |
Levels |
|
Optional |
false |
Tags |
cicd-sec-09, dependencies, security, slsa-4, supply-chain |
Description
External dependencies may be public packages needed in the pipeline, or perhaps the public image being used for the build worker. Lock these external dependencies in every build pipeline.
Rationale
External dependencies are sources of code that aren’t under organizational control. They might be intentionally or unintentionally infected with malicious code or have known vulnerabilities which could result in sensitive data exposure, data harvesting, or the erosion of trust in an organization.
Locking each external dependency to a specific, safe version gives more control and less chance for risk.
In particular, tasks in pipelines often refer to external software with is often tagged with version numbers. Unless you trust the creator of the task, it is good practice to pin tasks to a full-length commit SHA. Please read using third-party actions for the specific case of GitHub.
2.4.6 Ensure pipeline steps sign the Software Bill of Materials (SBOM) produced
ID |
cis_sscs/steps_sbom |
Severity |
low |
Category |
build_pipelines/pipeline_integrity |
Levels |
|
Optional |
true |
Tags |
sbom, security, slsa-1, slsa-2, slsa-3, slsa-4, supply-chain |
Description
SBOM (Software Bill of Materials) is a file that specifies each component of software or a build process.
It should be generated after every pipeline run. After it is generated, it must then be signed.
You can configure tools or run commands to check for workflows uses tools to verify this. The parameter are tools
and commands
.
Rationale
Software Bill of Materials (SBOM) is a file used to validate the integrity and security of a build pipeline. Signing it ensures that no one tampered with the file when it was delivered. Such interference can happen if someone tries to hide unusual activity. Validating the SBOM signature can detect this activity and prevent much greater incident.
3.1.7 Ensure dependencies are pinned to a specific, verified version
ID |
cis_sscs/pinned_dependencies |
Severity |
high |
Category |
dependencies/third_party_packages |
Levels |
|
Optional |
false |
Tags |
dependencies, security, slsa-4, supply-chain |
Rationale
When using a wildcard version of a package, or the "latest" tag, the risk of encountering a new, potentially malicious package increases. The "latest" tag pulls the last package pushed to the registry. This means that if an attacker pushes a new, malicious package successfully to the registry, the next user who pulls the "latest" will pull it and risk attack.
This same rule applies to a wildcard version - assuming one is using version v1.*, it will install the latest version of the major version 1, meaning that if an attacker can push a malicious package with that same version, those using it will be subject to possible attack.
By using a secure, verified version, use is restricted to this version only and no other may be pulled, decreasing the risk for any malicious package.
3.2.2 Ensure packages are automatically scanned for known vulnerabilities
ID |
cis_sscs/package_scan_vuln |
Severity |
high |
Category |
dependencies/validate_packages |
Levels |
|
Optional |
true |
Tags |
sca, security, slsa-4, supply-chain |
Description
Automatically scan every package for vulnerabilities.
The vulnerability scanners to be considered may be configured for this checkpoint.
Rationale
Automatic scanning for vulnerabilities detects known vulnerabilities in packages and dependencies in use, allowing faster patching when one is found. Such vulnerabilities can lead to a massive breach if not handled as fast as possible, as attackers will also know about those vulnerabilities and swiftly try to take advantage of them. Scanning packages regularly for vulnerabilities can also verify usage compliance with the organization’s security policy.
Gathering the dependencies graph and analyzing each dependency for vulnerabilities and other issues is named "Software Composition Analysis" or SCA. Tools that automate such analysis are called SCA tools.
A project compliant with this check typically is also compliant with the 3.2.3 check "Ensure packages are automatically scanned for license implications", as most SCA tools analyze vulnerabilities, license issues and obsolescence. |
3.2.3 Ensure packages are automatically scanned for license implications
ID |
cis_sscs/package_scan_license |
Severity |
high |
Category |
dependencies/validate_packages |
Levels |
|
Optional |
true |
Tags |
license, supply-chain |
Description
A software license is a document that provides legal conditions and guidelines for the use and distribution of software, usually defined by the author.
It is recommended to scan for any legal implications automatically. Tools that perform Software Composition Analysis (SCA) often gather the license for third-party packages used and report potential legal issues.
Rationale
When using packages with software licenses, especially commercial ones which tend to be the strictest, it is important to verify that the use of the package meets the conditions of the license.
If the use of the package violates the licensing agreement, it exposes the organization to possible lawsuits.
Scanning used packages for such license implications leads to faster detection and quicker fixes of such violations, and also reduces the risk for a lawsuit.
4.2.3 Ensure user access to the package registry utilizes Multi-Factor Authentication (MFA)
ID |
cis_sscs/package_org_mfa |
Severity |
critical |
Category |
artifacts/access_to_artifacts |
Levels |
|
Optional |
false |
Tags |
mfa, security, slsa-4, supply-chain |
Rationale
By default, every user authenticates to the system by password only. If a user’s password is compromised, the user account and all its related packages are in danger of data theft and malicious builds. It is therefore recommended that each user enables Multi-Factor Authentication. This additional step guarantees that the account stays secure even if the user’s password is compromised, as it adds another layer of authentication.
4.2.5 Ensure anonymous access to artifacts is revoked
ID |
cis_sscs/anonymous_access |
Severity |
critical |
Category |
artifacts/access_to_artifacts |
Levels |
|
Optional |
false |
Tags |
code-leakage, least-privilege, package-permissions, security, supply-chain |
Rationale
Most artifact repositories support anonymous users, such as Jfrog and Nexus. For unauthorized users, this defaults to a user with only read permissions, however more permissions may be added. Disable the option to view artifacts as "Anonymous User" in order to protect private artifacts from being exposed. This way, only trusted and authorized members will be able to access artifacts. == Verification
For each artifact or package manager in use, verify that anonymous access is disabled.
4.3.4 Ensure webhooks of the package registry are secured
ID |
cis_sscs/package_hooks |
Severity |
high |
Category |
artifacts/package_registries |
Levels |
|
Optional |
false |
Tags |
infrastructure, security, supply-chain |
Rationale
Webhooks are used for triggering an HTTP request based on an action made in the platform. Typically, package registries feature webhooks when a package receives an update.
Since webhooks are an HTTP POST request, they can be malformed if not secured over SSL.
In addition, webhooks messages could be protected by a message authentication code (MAC), often using a shared secret between emitter and receiver, so the receiver can verify that the message comes from the appropriate source.
To prevent a potential hack and compromise of the webhook or to the registry or web server excepting the request, use only secured webhooks.