Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/scorecard-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: OpenSSF Scorecard supply-chain security

on:
branch_protection_rule:
push:
branches:
- master
schedule:
- cron: '30 1 * * 6'

permissions:
contents: read

jobs:
scorecard:
permissions:
contents: read # Required to check out the repository.
id-token: write # Required to sign published results with the GitHub OIDC token.
security-events: write # Required to upload SARIF results to code scanning.
uses: yiisoft/yii2-actions/.github/workflows/scorecard.yml@2b3b3497b6d88911a3cd5b3b48ebcf322b9d0dc7 # master
secrets:
SCORECARD_TOKEN: ${{ secrets.SCORECARD_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/zizmor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ permissions:

jobs:
zizmor:
uses: yiisoft/yii2-actions/.github/workflows/zizmor.yml@d90cdb5bb58df697c808bb66928864f574c6d07b # master
uses: yiisoft/yii2-actions/.github/workflows/zizmor.yml@2b3b3497b6d88911a3cd5b3b48ebcf322b9d0dc7 # master
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ If your code is hosted at GitHub, you can place the following in your README.md
[![Yii2](https://img.shields.io/badge/Powered_by-Yii_Framework-green.svg?style=for-the-badge&logo=yii)](https://www.yiiframework.com/)
```

### Supply-Chain Security

[![Security](https://img.shields.io/github/actions/workflow/status/yiisoft/yii2/zizmor.yml?style=for-the-badge&label=Security&logo=github)](https://github.com/yiisoft/yii2/actions/workflows/zizmor.yml)
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/yiisoft/yii2/badge?style=for-the-badge)](https://scorecard.dev/viewer/?uri=github.com/yiisoft/yii2)

GitHub Actions workflows are analyzed by [zizmor](https://github.com/yiisoft/yii2/actions/workflows/zizmor.yml) for supply-chain vulnerabilities and workflow misconfigurations.
Supply-chain security is tracked via the [OpenSSF Scorecard](https://scorecard.dev/viewer/?uri=github.com/yiisoft/yii2), which evaluates security practices across the repository.

### Sponsoring

Support this project by becoming a sponsor or a backer.
Expand Down
11 changes: 6 additions & 5 deletions framework/validators/IpValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@
* ['ip_address', 'ip', 'expandIPv6' => true], // expands IPv6 address to a full notation format
* ```
*
* @property-read array $ranges The IPv4 or IPv6 ranges that are allowed or forbidden.
* @property-write array|string|null $ranges The IPv4 or IPv6 ranges that are allowed or forbidden.
*
* The `ranges` property accepts IPv4 or IPv6 ranges that are allowed or forbidden.
* When the array is empty, or the option not set, all IP addresses are allowed.
*
* Otherwise, the rules are checked sequentially until the first match is found.
Expand All @@ -56,6 +54,9 @@
* In this example, access is allowed for all the IPv4 and IPv6 addresses excluding the `192.168.10.0/24` subnet.
* IPv4 address `192.168.10.128` is also allowed, because it is listed before the restriction.
*
* @property-read array $ranges The IPv4 or IPv6 ranges that are allowed or forbidden.
* @property-write array|string|null $ranges The IPv4 or IPv6 ranges that are allowed or forbidden.
*
* @author Dmitry Naumenko <d.naumenko.a@gmail.com>
* @since 2.0.7
*/
Expand Down Expand Up @@ -265,8 +266,6 @@ public function init()
* - Recursively substitutes aliases (described in [[networks]]) with their values.
* - Removes duplicates
*
* @param array|string|null $ranges the IPv4 or IPv6 ranges that are allowed or forbidden.
*
* When the array is empty, or the option not set, all IP addresses are allowed.
*
* Otherwise, the rules are checked sequentially until the first match is found.
Expand All @@ -286,6 +285,8 @@ public function init()
*
* In this example, access is allowed for all the IPv4 and IPv6 addresses excluding the `192.168.10.0/24` subnet.
* IPv4 address `192.168.10.128` is also allowed, because it is listed before the restriction.
*
* @param array|string|null $ranges the IPv4 or IPv6 ranges that are allowed or forbidden.
*/
public function setRanges($ranges)
{
Expand Down
Loading