Skip to content

Commit

Permalink
重构命名空间,优化代码结构,添加 SHA1 算法实现,更新 CMake 配置以支持 Python 模块
Browse files Browse the repository at this point in the history
  • Loading branch information
AstroAir committed Nov 6, 2024
1 parent 6ae3365 commit c82e365
Show file tree
Hide file tree
Showing 42 changed files with 5,439 additions and 855 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,6 @@ Alternatively, utilize the provided quick-build scripts to streamline the proces
### Intellectual Inspiration

Embarking on the journey with Lithium, we embrace curiosity and an unwavering pursuit of knowledge, echoing the adapted verse which reminds us that every attempt, though fraught with challenges and setbacks, is a necessary step toward wisdom and understanding. Together, let us navigate the vast cosmos of astronomical imaging, our technology the vessel, innovation our sail, advancing relentlessly forward.

<figure><embed src="https://wakatime.com/share/@018d39f0-57c9-4a13-aedb-90454b61e6cc/e1b2b694-2ecc-4cfd-9c75-2d01b8581e4d.svg"></embed></figure>
<figure><embed src="https://wakatime.com/share/@018d39f0-57c9-4a13-aedb-90454b61e6cc/d6c29fb7-c5b3-4ffc-8e17-16634c7b669a.svg"></embed></figure>
154 changes: 59 additions & 95 deletions config/script/check.json
Original file line number Diff line number Diff line change
@@ -1,116 +1,80 @@
{
"danger_patterns": [
"powershell_danger_patterns": [
{
"pattern": "\\brm\\s+-rf\\b",
"reason": "Potentially destructive operation"
"pattern": "Remove-Item -Recurse -Force",
"reason": "Potentially dangerous command that can delete files recursively and forcefully."
},
{
"pattern": "\\bsudo\\b",
"reason": "Elevated permissions, dangerous"
},
{
"pattern": "\\bmkfs\\b",
"reason": "Filesystem creation, dangerous operation"
},
{
"pattern": "\\|",
"reason": "Pipeline usage might lead to unintended consequences"
},
{
"pattern": "2>&1\\s*>\\s*/dev/null",
"reason": "Redirection might hide errors"
},
{
"pattern": "\\bkill\\s+-9\\b",
"reason": "Forcefully killing processes, consider using safer signal"
},
{
"pattern": "eval\\s+",
"reason": "Using eval can lead to security vulnerabilities"
},
{
"pattern": "\\bshutdown\\b",
"reason": "Potentially shuts down or restarts the system"
},
{
"pattern": "\\bdd\\s+iflag=fullblock",
"reason": "Low-level data copying can lead to data loss or corruption"
},
{
"pattern": "\\bchmod\\s+([0-7]{3,4}|[ugoa]+\\+?)\\s+[^/].*",
"reason": "Changing file permissions may lead to security issues"
},
{
"pattern": "\\bchown\\s+[^:]+:[^/]+\\s+[^/].*",
"reason": "Changing file ownership may lead to access issues"
},
{
"pattern": "\\bssh\\s+root@[^\\s]+",
"reason": "SSH access as root user can be risky"
},
{
"pattern": "\\bwget\\s+[^\\s]+",
"reason": "Downloading files might lead to unintended consequences"
},
{
"pattern": "\\bcurl\\s+[^\\s]+",
"reason": "Fetching data from the internet can be risky"
"pattern": "Stop-Process -Force",
"reason": "Forcefully stopping a process can lead to data loss."
}
],
"sensitive_patterns": [
{
"pattern": "password\\s*=\\s*['\"].*['\"]",
"reason": "Possible plaintext password"
},
{
"pattern": "AWS_SECRET_ACCESS_KEY",
"reason": "AWS secret key detected"
},
{
"pattern": "GITHUB_TOKEN",
"reason": "GitHub token detected"
},
{
"pattern": "PRIVATE_KEY",
"reason": "Private key detected"
},
{
"pattern": "DB_PASSWORD\\s*=\\s*['\"].*['\"]",
"reason": "Database password detected"
},
"windows_cmd_danger_patterns": [
{
"pattern": "SECRET_KEY\\s*=\\s*['\"].*['\"]",
"reason": "Application secret key detected"
"pattern": "del /s /q",
"reason": "Potentially dangerous command that can delete files recursively and quietly."
},
{
"pattern": "API_KEY\\s*=\\s*['\"].*['\"]",
"reason": "API key detected"
},
"pattern": "taskkill /F",
"reason": "Forcefully killing a task can lead to data loss."
}
],
"bash_danger_patterns": [
{
"pattern": "TOKEN\\s*=\\s*['\"].*['\"]",
"reason": "Authorization token detected"
"pattern": "rm -rf /",
"reason": "Potentially dangerous command that can delete all files recursively and forcefully."
},
{
"pattern": "PASSWORD\\s*=\\s*['\"].*['\"]",
"reason": "Password detected"
"pattern": "kill -9",
"reason": "Forcefully killing a process can lead to data loss."
}
],
"environment_patterns": [
"python_danger_patterns": [
{
"pattern": "\\$\\{?\\w+\\}?",
"reason": "Environment variable dependency detected"
"pattern": "os.system",
"reason": "Using os.system can be dangerous as it allows execution of arbitrary commands."
},
{
"pattern": "\\$\\{[^\\}]+\\}",
"reason": "Environment variable with braces detected"
},
"pattern": "subprocess.call",
"reason": "Using subprocess.call can be dangerous as it allows execution of arbitrary commands."
}
],
"ruby_danger_patterns": [
{
"pattern": "\\$\\w+",
"reason": "Environment variable placeholder detected"
"pattern": "system",
"reason": "Using system can be dangerous as it allows execution of arbitrary commands."
},
{
"pattern": "\\${HOME|USER|SHELL|PATH}",
"reason": "Common environment variables detected"
"pattern": "exec",
"reason": "Using exec can be dangerous as it allows execution of arbitrary commands."
}
]
}
],
"replacements": {
"Remove-Item -Recurse -Force": "Remove-Item -Recurse",
"Stop-Process -Force": "Stop-Process",
"rm -rf /": "find . -type f -delete",
"kill -9": "kill -TERM"
},
"external_commands": {
"powershell": [
"Invoke-WebRequest",
"Invoke-RestMethod"
],
"cmd": [
"curl",
"wget"
],
"bash": [
"curl",
"wget"
],
"python": [
"os.system",
"subprocess.call"
],
"ruby": [
"system",
"exec"
]
}
}
Loading

0 comments on commit c82e365

Please sign in to comment.