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

--asn in bgpsec add #1192

Open
randyqx opened this issue Apr 2, 2024 · 7 comments
Open

--asn in bgpsec add #1192

randyqx opened this issue Apr 2, 2024 · 7 comments

Comments

@randyqx
Copy link

randyqx commented Apr 2, 2024

krillc bgpsec add --asn AS65000 --csr ./router-csr.der has the AS in the command. but the relevant AS(s), yes there may be more than one, are in the CSR; see RFC 8209 §3.1.1 and the router certificate does have the AS(s), §3.1.3.5.

Hmmm. OTOH, RFC 8635 says

NOTE: The PKCS#10 certification request does not include the AS
number or the BGP Identifier for the router certificate. Therefore,
the operator transmits the AS it has chosen on the router as well as
the BGP Identifier when it sends the CSR to the CA.

@randyqx randyqx changed the title --asn in bgpsrc add --asn in bgpsec add Apr 2, 2024
@timbru
Copy link
Contributor

timbru commented Apr 3, 2024

Indeed. This is counter intuitive, but the AS is not included in the CSR (see 3.2 of 8209). So it needs to be supplied explicitly.

@randyqx
Copy link
Author

randyqx commented Apr 3, 2024

more confusing than counter intuitive :)

which AS? there may be multiple, as seems pretty clear. yes, §3.2 does not mention the AS being in the CSR. but it is, well, they are, in the enclosed cert to be signed.

( gotta love the marketing department closing tickets :)

@russhousley
Copy link

RFC 8209 specifies the profile for end entity certificates specified issued to routers within an AS. I am guessing that the --asn argument contains that AS number, even though the router may be able to speak for multiple AS numbers.

@randyqx
Copy link
Author

randyqx commented Apr 3, 2024

and those AS numbers may, or may not, all be from the same CA chain.

i actually have a router which has two ASs, one from RIPE and one from APNIC. so the router config has to know the CA chain diversity and issue separate CSRs for the separate chains and sign appropriately?

[ email to ticket seems not to work since marketing censored the discussion ]

@timbru
Copy link
Contributor

timbru commented Apr 4, 2024

@russhousley Indeed, the --asn argument carries the ASN for the router certificate. It's not expected on the CSR, but it's included in the JSON that CLI sends to the server.

@randyqx I do not fully trust my memory on this at this point, but I have some vague recollection about first being surprised that the ASN/ASNs were not on the CSR, and then deciding to go the best practice way for ROAs and only support creating single ASN BGPSec Router Certificates. Similar to ROAs with fate sharing prefixes, this may help to avoid certain issues with resource shrinkage in the chain. It will also make it easier to deal with situations where a (logical) CA is a child under multiple parents and/or has ASN entitlements spread out over multiple resource classes.

In principle it should be possible to create multiple BGPSec certificates using the same CSR for different ASNs. But, @AlexanderBand I realise now (looking at the code) that there is a bug. The router certificate file is named after its public key identifier, so this would result in a name collision. So, this code would need to be changed to make this work.

@AlexanderBand AlexanderBand reopened this Apr 4, 2024
@AlexanderBand
Copy link
Member

( gotta love the marketing department closing tickets :)

Regarding my closing the issue: Tim told me that the problem was dealt with and asked me to close it because he no longer can.

Regarding your “marketing department” snark: I provide job security and a safe place for sixteen full-time developers who maintain free, open-source and liberally licensed DNS and routing software you use. Sadly, your lack of respect and knowledge about our foundation is predictable.

We have a code of conduct; please adhere to it. This is your only warning.

@partim
Copy link
Member

partim commented Jun 11, 2024

But, @AlexanderBand I realise now (looking at the code) that there is a bug. The router certificate file is named after its public key identifier, so this would result in a name collision. So, this code would need to be changed to make this work.

That name already consists of the ASN and the key identifier. Presumably you wouldn’t have the two router keys with the same ASN and key under a single CA? Or do I misunderstand something here?

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

5 participants