-
Notifications
You must be signed in to change notification settings - Fork 0
ci: PR Discord 알림 워크플로우 추가 #143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| name: Discord PR 알림 | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, reopened] | ||
|
|
||
| jobs: | ||
| notify: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Discord 알림 전송 | ||
| uses: sarisia/actions-status-discord@eb045afee445dc055c18d3d90bd0f244fd062708 | ||
| with: | ||
| webhook: ${{ secrets.DISCORD_WEBHOOK_URL }} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- workflow ---'
cat -n .github/workflows/discord-pr-notify.yml
printf '%s\n' '--- pinned action URL handling ---'
python3 - <<'PY'
from urllib.request import urlopen
url = "https://raw.githubusercontent.com/sarisia/actions-status-discord/eb045afee445dc055c18d3d90bd0f244fd062708/lib/index.js"
with urlopen(url, timeout=10) as response:
text = response.read().decode("utf-8")
for number, line in enumerate(text.splitlines(), 1):
if "http" in line.lower() or "webhook" in line.lower() or "url" in line.lower():
print(f"{number}: {line}")
PYRepository: uttae/frontend-server Length of output: 3157 🏁 Script executed: #!/bin/bash
set -eu
url='https://raw.githubusercontent.com/sarisia/actions-status-discord/eb045afee445dc055c18d3d90bd0f244fd062708/lib/index.js'
curl -ksSfL "$url" | nl -ba | sed -n '/https\|http\|webhook\|URL\|redirect/Ip'Repository: uttae/frontend-server Length of output: 295 🏁 Script executed: #!/bin/bash
set -eu
python3 - <<'PY'
import ssl
from urllib.request import urlopen
url = "https://raw.githubusercontent.com/sarisia/actions-status-discord/eb045afee445dc055c18d3d90bd0f244fd062708/lib/index.js"
context = ssl._create_unverified_context()
with urlopen(url, context=context, timeout=10) as response:
lines = response.read().decode("utf-8").splitlines()
for number, line in enumerate(lines, 1):
lowered = line.lower()
if any(term in lowered for term in ("http", "webhook", "url", "redirect")):
print(f"{number}: {line}")
PYRepository: uttae/frontend-server Length of output: 50378 🏁 Script executed: #!/bin/bash
set -eu
python3 - <<'PY'
import ssl
from urllib.request import urlopen
url = "https://raw.githubusercontent.com/sarisia/actions-status-discord/eb045afee445dc055c18d3d90bd0f244fd062708/lib/index.js"
with urlopen(url, context=ssl._create_unverified_context(), timeout=10) as response:
text = response.read().decode("utf-8")
terms = ("webhook", "new URL", "https.request", "http.request", "axios(", "redirect")
for term in terms:
print(f"\n--- {term} ---")
start = 0
count = 0
while count < 8:
index = text.find(term, start)
if index < 0:
break
left = max(0, index - 180)
right = min(len(text), index + len(term) + 300)
print(text[left:right].replace("\n", " "))
start = index + len(term)
count += 1
PYRepository: uttae/frontend-server Length of output: 11992 🏁 Script executed: #!/bin/bash
set -eu
python3 - <<'PY'
import ssl
from urllib.request import urlopen
url = "https://raw.githubusercontent.com/sarisia/actions-status-discord/eb045afee445dc055c18d3d90bd0f244fd062708/lib/index.js"
with urlopen(url, context=ssl._create_unverified_context(), timeout=10) as response:
text = response.read().decode("utf-8")
terms = ("c.webhooks", "webhooks.forEach", "webhooks.map", "client.request", "request('POST'", 'request("POST"', "sendWebhook")
for term in terms:
print(f"\n--- {term} ---")
start = 0
count = 0
while count < 5:
index = text.find(term, start)
if index < 0:
break
left = max(0, index - 250)
right = min(len(text), index + len(term) + 500)
print(text[left:right].replace("\n", " "))
start = index + len(term)
count += 1
PYRepository: uttae/frontend-server Length of output: 3374 Sensitive Data Exposure (CWE-319): Cleartext Transmission of Sensitive Information Reachability: Internal · Exploitability: Difficult
현재 secret URL을 action에 그대로 전달합니다. action은 각 URL을 HTTP client에 전달하고, scheme이 제안된 수정 steps:
+ - name: Discord 웹훅 URL 검증
+ env:
+ DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
+ run: |
+ while IFS= read -r webhook; do
+ case "$webhook" in
+ https://*) ;;
+ *) echo "::error::DISCORD_WEBHOOK_URL must use HTTPS"; exit 1 ;;
+ esac
+ done <<< "$DISCORD_WEBHOOK_URL"
+
- name: Discord 알림 전송🧰 Tools🪛 zizmor (1.29.0)[warning] 8-21: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block (excessive-permissions) 🤖 Prompt for AI AgentsSource: MCP tools |
||
| title: "PR 올라왔어요!" | ||
| description: | | ||
| ${{ github.event.pull_request.title }} | ||
| ${{ github.event.pull_request.html_url }} | ||
| color: 0x5865F2 | ||
| username: GitHub | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🤖 get_repo_knowledge executed:
get_repo_knowledge uttae/frontend-server /tmp/coderabbit-repo-knowledge/uttae-frontend-server-75da0319Length of output: 574
🏁 Script executed:
Repository: uttae/frontend-server
Length of output: 1079
🌐 Web query:
site:docs.github.com GitHub Actions permissions {} workflow GITHUB_TOKEN default permissions💡 Result:
In GitHub Actions, the GITHUB_TOKEN is a unique, short-lived authentication token created for each workflow job [1]. By default, its permissions are determined by settings configured at the repository, organization, or enterprise level [2][3]. Administrators can choose between two default modes: "permissive" (which grants broad read/write access to many scopes) or "restricted" (which grants limited access, typically read-only for contents and none for most other scopes) [3]. You can override these default permissions within your workflow file using the permissions key to implement the principle of least privilege [2][4]. This key can be defined at the top level of a workflow (applying to all jobs) or within individual jobs [2][5]. When using the permissions key: - You can specify access levels for individual scopes (e.g., contents, issues, pull-requests) as read, write, or none [2][5]. - If you specify access for any individual permission, all unspecified permissions are automatically set to none [2][5]. - You can also use the shorthand syntax read-all or write-all to set all permissions at once [5][6]. If a workflow is triggered by a pull request from a forked repository, the GITHUB_TOKEN permissions are automatically downgraded to read-only access for certain scopes to prevent unauthorized access or modification, regardless of your explicit settings, unless the "Send write tokens to workflows from pull requests" setting is enabled [3].
Citations:
🏁 Script executed:
Repository: uttae/frontend-server
Length of output: 2420
🌐 Web query:
site:github.com/sarisia/actions-status-discord eb045afee445dc055c18d3d90bd0f244fd062708 GITHUB_TOKEN💡 Result:
The hash eb045afee445dc055c18d3d90bd0f244fd062708 refers to a specific git commit in the GitHub repository sarisia/actions-status-discord [1]. This commit, titled "Automatic build," was authored by the github-actions[bot] on January 9, 2026 [1]. There is no publicly available evidence linking this specific commit hash to a leaked or compromised GITHUB_TOKEN. In the context of GitHub Actions, GITHUB_TOKEN is a temporary, automatically generated token used to authenticate workflows, and it is standard practice to avoid hardcoding or exposing such tokens in commit history. If you are concerned about a potential leak, you should consider the token compromised and revoke it immediately via your repository settings.
Citations:
🏁 Script executed:
Repository: uttae/frontend-server
Length of output: 50378
🏁 Script executed:
Repository: uttae/frontend-server
Length of output: 4973
Security Misconfiguration (CWE-732): Incorrect Permission Assignment for Critical Resource
Reachability: External · Exploitability: Difficult
GITHUB_TOKEN권한을 명시적으로 최소화하세요.이 워크플로우와 고정된 action은
GITHUB_TOKEN을 사용하지 않습니다. 워크플로우 수준에permissions: {}를 추가하세요. 이를 생략하면 저장소 또는 조직의 기본 권한이 적용될 수 있습니다.제안된 수정
on: pull_request: types: [opened, reopened] +permissions: {} + jobs:🧰 Tools
🪛 zizmor (1.29.0)
[warning] 8-21: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
🤖 Prompt for AI Agents
Sources: MCP tools, Linters/SAST tools