Skip to content
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

Exporting JSON FILES OF RIPE RPKI ARCHIVE #19

Open
MAVRICK-1 opened this issue Jan 16, 2024 · 1 comment
Open

Exporting JSON FILES OF RIPE RPKI ARCHIVE #19

MAVRICK-1 opened this issue Jan 16, 2024 · 1 comment

Comments

@MAVRICK-1
Copy link
Contributor

MAVRICK-1 commented Jan 16, 2024

Sir , I have made modifications to the code to generate Json file for the RIPE archive data

Date Condition:

As per the provided URL RIPE archive data, the output.json.xz file is available after October 11, 2023. Consequently, I have made two changes to the code based on the date condition.

Depending on the date condition:

  • If the date is before October 11, 2023:
    • The updated code generates a JSON file from a CSV file.
    • The generated JSON file follows the same format as the current JSON file.
  • If the date is on or after October 11, 2023:
    • The code generates a JSON file by uncompressing a provided output.json.xz file.
  • The JSON files are stored in same path as csv file

URL Reference:
The relevant URL for this operation is [https://ftp.ripe.net/rpki/apnic.tal/).

This modification allows the code to adapt its behavior based on the specified date condition, either generating JSON from a CSV file or uncompressing a specific JSON file.

Here the output for 2018/10/01

only including the output for RIPE ARCHIVE urls

PS C:\Users\RISHI\Desktop\route-origin-validator\rov » rov 8.8.8.0/24 15169 --rpki_archive 2018/10/01 
Downloading: https://ftp.ripe.net/rpki/afrinic.tal/2018/10/01/roas.csv.xz
Downloading: https://ftp.ripe.net/rpki/apnic.tal/2018/10/01/roas.csv.xz
Downloading: https://ftp.ripe.net/rpki/arin.tal/2018/10/01/roas.csv.xz
Downloading: https://ftp.ripe.net/rpki/lacnic.tal/2018/10/01/roas.csv.xz
Downloading: https://ftp.ripe.net/rpki/ripencc.tal/2018/10/01/roas.csv.xz
Loading: C:\Users\RISHI\AppData\Local\IHR\rov\Cache/db/delegated\nro-extended-stats
Loading: C:\Users\RISHI\AppData\Local\IHR\rov\Cache/db/irr\+lacnic.db.gz
Loading: C:\Users\RISHI\AppData\Local\IHR\rov\Cache/db/irr\lacnic.db.gz
Loading: C:\Users\RISHI\AppData\Local\IHR\rov\Cache/db/rpki//2018/10/01\afrinic.csv
Loading: C:\Users\RISHI\AppData\Local\IHR\rov\Cache/db/rpki//2018/10/01\afrinic.json
Loading: C:\Users\RISHI\AppData\Local\IHR\rov\Cache/db/rpki//2018/10/01\apnic.csv
Loading: C:\Users\RISHI\AppData\Local\IHR\rov\Cache/db/rpki//2018/10/01\apnic.json
Loading: C:\Users\RISHI\AppData\Local\IHR\rov\Cache/db/rpki//2018/10/01\arin.csv
Loading: C:\Users\RISHI\AppData\Local\IHR\rov\Cache/db/rpki//2018/10/01\arin.json
Loading: C:\Users\RISHI\AppData\Local\IHR\rov\Cache/db/rpki//2018/10/01\lacnic.csv
Loading: C:\Users\RISHI\AppData\Local\IHR\rov\Cache/db/rpki//2018/10/01\lacnic.json
Loading: C:\Users\RISHI\AppData\Local\IHR\rov\Cache/db/rpki//2018/10/01\ripencc.csv
Loading: C:\Users\RISHI\AppData\Local\IHR\rov\Cache/db/rpki//2018/10/01\ripencc.json
{
    "query": {
        "prefix": "8.8.8.0/24",
        "asn": 15169
    },
    "irr": {
        "status": "NotFound"
    },
    "rpki": {
        "status": "NotFound"
    },
    "delegated": {
        "prefix": {
            "status": "assigned",
            "prefix": "8.8.8.0/24",
            "date": "20231228",
            "registry": "arin",
            "country": "US"
        },
        "asn": {
            "status": "assigned",
            "registry": "arin"
        }
    }
}

Here the output for 2024/01/01

only including the output for RIPE ARCHIVE urls

PS C:\Users\RISHI\Desktop\route-origin-validator\rov » rov 8.8.8.0/24 15169 --rpki_archive 2024/01/01
Downloading: https://ftp.ripe.net/rpki/afrinic.tal/2024/01/01/roas.csv.xz
Downloading: https://ftp.ripe.net/rpki/apnic.tal/2024/01/01/roas.csv.xz
Downloading: https://ftp.ripe.net/rpki/arin.tal/2024/01/01/roas.csv.xz
Downloading: https://ftp.ripe.net/rpki/lacnic.tal/2024/01/01/roas.csv.xz
Downloading: https://ftp.ripe.net/rpki/ripencc.tal/2024/01/01/roas.csv.xz
Downloading: https://ftp.ripe.net/rpki/afrinic.tal/2024/01/01/output.json.xz
Downloading: https://ftp.ripe.net/rpki/apnic.tal/2024/01/01/output.json.xz
Downloading: https://ftp.ripe.net/rpki/arin.tal/2024/01/01/output.json.xz
Downloading: https://ftp.ripe.net/rpki/lacnic.tal/2024/01/01/output.json.xz
Downloading: https://ftp.ripe.net/rpki/ripencc.tal/2024/01/01/output.json.xz
Loading: C:\Users\RISHI\AppData\Local\IHR\rov\Cache/db/delegated\nro-extended-stats
Loading: C:\Users\RISHI\AppData\Local\IHR\rov\Cache/db/irr\+lacnic.db.gz
Loading: C:\Users\RISHI\AppData\Local\IHR\rov\Cache/db/irr\lacnic.db.gz
Loading: C:\Users\RISHI\AppData\Local\IHR\rov\Cache/db/rpki//2024/01/01\afrinic.csv
Loading: C:\Users\RISHI\AppData\Local\IHR\rov\Cache/db/rpki//2024/01/01\afrinic.json
Loading: C:\Users\RISHI\AppData\Local\IHR\rov\Cache/db/rpki//2024/01/01\apnic.csv
Loading: C:\Users\RISHI\AppData\Local\IHR\rov\Cache/db/rpki//2024/01/01\apnic.json
Loading: C:\Users\RISHI\AppData\Local\IHR\rov\Cache/db/rpki//2024/01/01\arin.csv
Loading: C:\Users\RISHI\AppData\Local\IHR\rov\Cache/db/rpki//2024/01/01\arin.json
Loading: C:\Users\RISHI\AppData\Local\IHR\rov\Cache/db/rpki//2024/01/01\lacnic.csv
Loading: C:\Users\RISHI\AppData\Local\IHR\rov\Cache/db/rpki//2024/01/01\lacnic.json
Loading: C:\Users\RISHI\AppData\Local\IHR\rov\Cache/db/rpki//2024/01/01\ripencc.csv
Loading: C:\Users\RISHI\AppData\Local\IHR\rov\Cache/db/rpki//2024/01/01\ripencc.json
{
    "query": {
        "prefix": "8.8.8.0/24",
        "asn": 15169
    },
    "irr": {
        "status": "NotFound"
    },
    "rpki": {
        "status": "Valid",
        "prefix": "8.8.8.0/24",
        "maxLength": 24,
        "ta": "unknown",
        "startTime": "2023-12-29 17:14:18",
        "endTime": "2024-03-28 16:14:18",
        "uri": "rsync://rpki.arin.net/repository/arin-rpki-ta/5e4a23ea-e80a-403e-b08c-2171da2157d3/f60c9f32-a87c-4339-a2f3-6299a3b02e29/5e9328a9-e1d2-45d8-bdb5-eefe152994f9/d74ad38d-11d3-3c79-a22a-29626dd55bea.roa"
    },
    "delegated": {
        "prefix": {
            "status": "assigned",
            "prefix": "8.8.8.0/24",
            "date": "20231228",
            "registry": "arin",
            "country": "US"
        },
        "asn": {
            "status": "assigned",
            "registry": "arin"
        }
    }
}

I can forward with the pull request after the review of #17

@romain-fontugne @mohamedawnallah your views on this :-)?

@MAVRICK-1
Copy link
Contributor Author

@romain-fontugne sir your views on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant