diff options
-rw-r--r-- | .github/workflows/snapshot-automation.yml | 25 | ||||
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | README.skel.md | 29 | ||||
-rw-r--r-- | doc/pipe-bypass.puml | 9 | ||||
-rwxr-xr-x | get-kisa-as-list | 9 | ||||
-rwxr-xr-x | produce-readme | 6 |
7 files changed, 67 insertions, 16 deletions
diff --git a/.github/workflows/snapshot-automation.yml b/.github/workflows/snapshot-automation.yml new file mode 100644 index 0000000..e3d5ee3 --- /dev/null +++ b/.github/workflows/snapshot-automation.yml @@ -0,0 +1,25 @@ +name: rpki-tracker-kr snapshot automation +run-name: ${{ github.actor }}가 RPKI 보급률 데이터를 업데이트 중 +on: + schedule: + - cron: "00 00 * * mon" + workflow_dispatch: +permissions: + contents: write +jobs: + Do-snapshot: + name: Do data dump snapshot + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Run make + run: | + make clean + make + - name: Do commit + run: | + git config --global user.name 'Snapshot Automation Bot' + git config --global user.email '_@users.noreply.github.com' + git add --all + git commit -sm 'Data snapshot commit' + git push @@ -1 +1,3 @@ *.tmp + +/out @@ -21,7 +21,8 @@ clean: README.md aslist: - ./get-kisa-as-list > aslist.tmp + curl -sS 'https://krnic.kisa.or.kr/jsp/business/management/asList.jsp' | \ + ./get-kisa-as-list > aslist.tmp mv aslist.tmp aslist routelist: aslist diff --git a/README.skel.md b/README.skel.md index af39bdf..9bfd86a 100644 --- a/README.skel.md +++ b/README.skel.md @@ -19,7 +19,7 @@ https://stat.ripe.net/ui2013/widget/rpki-by-country#w.resource=kr%2Cus%2Cjp%2Cau RPKI가 BGP 설정 오류로 인한 장애 예방에 좋으면 빨리 적용해야겠죠? 각 사업자의 RPKI 적용률을 여기서 확인하세요. -UTC+9 기준 매주 월요일 자정에 업데이트 자동 업데이트 중(Github Action). +UTC+9 기준 매주 월요일 자정에 업데이트 자동 업데이트 중(Github Actions). ## 스크립트 실행 절차 [Makefile 레시피](Makefile) 설명. @@ -37,12 +37,27 @@ UTC+9 기준 매주 월요일 자정에 업데이트 자동 업데이트 중(Git ## 프리픽스 현황 https://krnic.kisa.or.kr/jsp/business/management/asList.jsp -- ASN: 자율시스템 번호 -- Name: 자율시스템 운영사 -- RPKI: 유효한 ROA가 적용된 라우팅 프리픽스 개수 -- Total: 총 라우팅 프리픽스 개수 -- %: RPKI/Total 백분율 -- Bars: 20점 만점 점수 +| 범례 | 설명 | +| - | - | +| ASN | 자율시스템 번호 | +| Name | 자율시스템 운영사 | +| RPKI | 유효한 ROA가 적용된 라우팅 프리픽스 개수 | +| Total | 총 라우팅 프리픽스 개수 | +| % | RPKI/Total 백분율 | +| Bars | 20점 만점 점수 | + +AS는 [여러 +종류](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)#Types)가 +있지만, [DFZ](https://en.wikipedia.org/wiki/Default-free_zone) 라우터에서 직접 +네트워크 구조를 분석하지 않는 이상, RADB의 정보만으로는 어떤 AS가 ISP와 IX인지, +어떤 AS가 stub인지 알 수 없음. 이를 할 때 필요한 [LG +서버](https://en.wikipedia.org/wiki/Looking_Glass_server)가 한국에 많이 존재하지 +않음. 하지만 인터넷 마비 예방은 ISP와 IX에서 운영되는 라우터에만 적용되어도 +충분히 예방될 수 있음. 단순 CDN 애니케스트나, CPE, 데이터센터인 stub AS에서 RPKI +validation을 할 필요가 없기 때문에, 보급률이 100%가 될 필요는 없음. 이는 RIPE +지역의 보급률이 80%인 사실로 확인할 수 있음. + +주의깊게 봐야할 AS들은 한국 기간망을 운영하는 통신 3사와 국내 IX임. **업데이트: %LAST_UPDATE_ISOTIME%** diff --git a/doc/pipe-bypass.puml b/doc/pipe-bypass.puml new file mode 100644 index 0000000..961fadb --- /dev/null +++ b/doc/pipe-bypass.puml @@ -0,0 +1,9 @@ +@startuml pipe-bypass + +[read_aslist] -> [open_db] +[open_db] -> [extract_answer] +[extract_answer] -> [output_filter] + +read_aslist -> output_filter: FD #3 + +@enduml diff --git a/get-kisa-as-list b/get-kisa-as-list index a57a95e..b4b1c10 100755 --- a/get-kisa-as-list +++ b/get-kisa-as-list @@ -1,9 +1,7 @@ #!/bin/env python3 import html import html.parser -import requests - -TARGET_URL = 'https://krnic.kisa.or.kr/jsp/business/management/asList.jsp' +import sys def sanitize_as_name (s: str): return ' '.join(s.split()) @@ -40,7 +38,4 @@ class KISAASListExtractor (html.parser.HTMLParser): doc_parser = KISAASListExtractor() - -with requests.get(TARGET_URL) as req: - raw = req.content.decode(req.encoding or 'utf-8') - doc_parser.feed(raw) +doc_parser.feed(sys.stdin.read()) diff --git a/produce-readme b/produce-readme index fa1bfd3..61275ab 100755 --- a/produce-readme +++ b/produce-readme @@ -5,7 +5,11 @@ import sys opts, args = getopt.getopt(sys.argv[1:], '') -now = datetime.datetime.now(datetime.UTC) +try: + now = datetime.datetime.now(datetime.UTC) +except AttributeError: + now = datetime.datetime.utcnow() + with open(args[0]) as f: table = f.read() with open(args[1]) as f: |