Skip to content

Commit 32f37f8

Browse files
authored
Merge pull request #4 from rotemreiss/bugfix/fetch-limit
Bugfix/fetch limit
2 parents 6680406 + 8b2c623 commit 32f37f8

File tree

6 files changed

+9051
-27
lines changed

6 files changed

+9051
-27
lines changed

cli.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,10 @@ async def registry_unblock(
12471247
return False
12481248

12491249
async def fetch_feed_packages(
1250-
self, ecosystem: Optional[str] = None, limit: int = 100, hours: int = 48
1250+
self,
1251+
ecosystem: Optional[str] = None,
1252+
limit: Optional[int] = None,
1253+
hours: int = 48,
12511254
) -> bool:
12521255
"""Fetch fresh malicious packages from the packages feed."""
12531256
try:
@@ -1965,7 +1968,11 @@ async def main():
19651968
"--ecosystem", "-e", type=str, help="Filter by ecosystem (npm, pypi, etc.)"
19661969
)
19671970
fetch_parser.add_argument(
1968-
"--limit", "-l", type=int, default=100, help="Number of packages to show"
1971+
"--limit",
1972+
"-l",
1973+
type=int,
1974+
default=None,
1975+
help="Maximum number of packages to fetch (default: no limit)",
19691976
)
19701977
fetch_parser.add_argument(
19711978
"--hours",

examples/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Malifiscan Examples
2+
3+
This directory provides advanced usage examples and configurations for Malifiscan, demonstrating different deployment scenarios and use cases beyond the basic setup.
4+
5+
## Available Examples
6+
7+
### config.shai-hulud-2.0.yaml
8+
9+
An example configuration that uses a hard-coded list of malicious packages instead of the default OSV feed. This demonstrates how to use the memory feed provider with a specific set of packages.
10+
11+
**Use Case**: Testing against a known set of malicious packages from security research.
12+
13+
**Package List Source**: This example includes packages identified in the [Shai-Hulud 2.0 supply chain attack research by Wiz](https://www.wiz.io/blog/shai-hulud-2-0-ongoing-supply-chain-attack).
14+
15+
**Features**:
16+
- Memory-based feed provider with pre-defined package list
17+
- JFrog registry integration enabled
18+
- Minimal logging (ERROR level only)
19+
- Storage service disabled for lightweight operation
20+
21+
**Usage**:
22+
```bash
23+
uv run python cli.py scan --config examples/config.shai-hulud-2.0.yaml
24+
```

0 commit comments

Comments
 (0)