b8788c239e
MCP Docker / build-and-push (push) Has been cancelled
- Remove telemetry: disabled all phone-home (installation notify, false positives, behavior tracking, upgrade tips) - Version branding: removed 'ce-' prefix, product name changed to '长亭雷池 WAF' - Detection engine enhancement: strict preset enables all 17 modules with aggressive configs - Multi-user RBAC: admin/operator/viewer roles with password + TOTP 2FA - Rate limiting: nginx limit_req per website (RPS, burst, action) - JS Challenge: browser fingerprint verification page with cookie-based bypass - Security fixes: removed InsecureSkipVerify, hardcoded credentials, NO_AUTH backdoor
33 lines
737 B
Go
33 lines
737 B
Go
package cron
|
|
|
|
import (
|
|
"github.com/robfig/cron/v3"
|
|
|
|
"chaitin.cn/patronus/safeline-2/management/tcontrollerd/pkg/log"
|
|
)
|
|
|
|
var logger = log.GetLogger("cron")
|
|
|
|
func newCronWithSeconds() *cron.Cron {
|
|
secondParser := cron.NewParser(cron.Second | cron.Minute | cron.Hour |
|
|
cron.Dom | cron.Month | cron.DowOptional | cron.Descriptor)
|
|
return cron.New(cron.WithParser(secondParser), cron.WithChain())
|
|
}
|
|
|
|
func StartCron() error {
|
|
cronInstance := newCronWithSeconds()
|
|
|
|
_, err := cronInstance.AddFunc(specCheckForbiddenPage, checkAndUpdateForbiddenPage)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
_, err = cronInstance.AddFunc(specCheckChallengePage, checkAndUpdateChallengePage)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
cronInstance.Start()
|
|
return nil
|
|
}
|