• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ninoseki / abuse_whois / 4020719131

pending completion
4020719131

push

github

GitHub
Merge pull request #42 from ninoseki/sigma

300 of 421 new or added lines in 19 files covered. (71.26%)

7 existing lines in 4 files now uncovered.

608 of 791 relevant lines covered (76.86%)

1.54 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.0
/abuse_whois/schemas/rule.py
1
from typing import Any
2✔
2

3
from pydantic import root_validator
2✔
4

5
from abuse_whois.pysigma import schemas
2✔
6
from abuse_whois.pysigma.factories import RuleFactory
2✔
7
from abuse_whois.pysigma.validator import SigmaValidator
2✔
8

9
from .api_model import APIModel
2✔
10
from .contact import Contact
2✔
11

12

13
class BaseRule(APIModel):
2✔
14
    title: str
2✔
15
    description: str
2✔
16
    detection: Any
2✔
17

18
    contact: Contact
2✔
19

20
    @root_validator
2✔
21
    def validate_detection(cls, values: dict[str, Any]):
2✔
22
        validator = SigmaValidator(values)
2✔
23
        if len(validator.file_errors) > 0:
2✔
NEW
24
            raise ValueError(validator.file_errors)
×
25

26
        return values
2✔
27

28
    @property
2✔
29
    def sigma_rule(self) -> schemas.Rule | None:
2✔
30
        if self.detection is None:
2✔
NEW
31
            return None
×
32

33
        return RuleFactory.from_data(self.dict())
2✔
34

35
    async def match(self, hostname: str) -> bool:
2✔
36
        raise NotImplementedError()
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc