cloudflare / gortr

The RPKI-to-Router server used at Cloudflare
https://rpki.cloudflare.com
BSD 3-Clause "New" or "Revised" License
309 stars 39 forks source link

when slurm file is provided, server values are not considered. #53

Open Avinash825 opened 4 years ago

Avinash825 commented 4 years ago

Hi,

When we pass slurm file as an argument, Global repository values are not considered. Only the locally defined addresses in slurm file are considered. is this expected ?

thanks, Avinash C

lspgn commented 4 years ago

Hello, What do you mean by "global repository values"? Can you provide a CLI example.

Avinash825 commented 4 years ago

i mean, the values it fetches from web without any slurm file.... i have defined few ROA's in slurm file... { "slurmVersion": 1, "validationOutputFilters": { "prefixFilters": [ ], "bgpsecFilters": [ ] }, "locallyAddedAssertions": { "prefixAssertions": [

  {
    "asn": 13336,
    "prefix": "1.1.1.0/24",
    "maxPrefixLength": 30
  },

  {
    "asn": 13336,
    "prefix": "1.1.1.0/24",
    "maxPrefixLength": 30
  }

} }

lspgn commented 4 years ago

Do you mean the values fetched from rpki.cloudflare.com/rpki.json? Are the asserted ROAs not added?

Avinash825 commented 4 years ago

Yes they are not added ... only locally defined values in slurm file are added..

lspgn commented 4 years ago

I ran the following

$ go run gortr.go -slurm ./myslurm.json

using the SLURM you posted (it had a JSON formatting issue):

{
  "slurmVersion": 1,
  "validationOutputFilters": {
    "prefixFilters": [],
    "bgpsecFilters": []
  },
  "locallyAddedAssertions": {
    "prefixAssertions": [
      {
        "asn": 13336,
        "prefix": "1.1.1.0/24",
        "maxPrefixLength": 30
      },
      {
        "asn": 13336,
        "prefix": "1.1.1.0/24",
        "maxPrefixLength": 30
      }
    ]
  }
}

Which returned me:

$ curl --silent 127.0.0.1:8080/rpki.json | jq '.roas[] | select(.prefix=="1.1.1.0/24")'
{
  "prefix": "1.1.1.0/24",
  "maxLength": 24,
  "asn": "AS13335",
  "ta": "Cloudflare - APNIC"
}
{
  "prefix": "1.1.1.0/24",
  "maxLength": 30,
  "asn": "AS13336"
}
{
  "prefix": "1.1.1.0/24",
  "maxLength": 30,
  "asn": "AS13336"
}

This should be the expected behavior? I'm not sure what you mean.