Improve Mac OS Certificate Parsing to import PEM directly
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
Research direction
Start in Lib/Collectors/CertificateCollector.cs around line 104 and trace the existing security call that generates PEM output. Check how the stored string is currently written and parsed, then compare the proposed flow with X509Certificate2.CreateFromPem. Done means Mac OS certificate PEM data is imported directly and each certificate is reported without writing an intermediate file.
Written by the indexing model from the issue text.
Description
The PEM exported by the Mac OS Keychain is all of the certificates base64 encoded and then stitched together with --- BEGIN CERTIFICATE --- and --- END CERTIFICATE --- blocks. After .NET 5 its possible to load a certificate from base64 encoded text with X509Certificate2.CreateFromPem
Proposed solution:
- Use existing
securitycall to generate PEM. - The result is already stored in a string - instead of writing out to a file, just split that string into chunks of base64 data, stripping out the headers.
- With each chunk call X509Certificate2.CreateFromPem
- Report the certificate
Code point to modify:
https://github.com/microsoft/AttackSurfaceAnalyzer/blob/6cc160f5d43165fdc298c51efa41239afd554a9a/Lib/Collectors/CertificateCollector.cs#L104
- Dominant language
- C#
- Stars
- 3k
- Forks
- 294
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/AttackSurfaceAnalyzer
-
bug documentation
Difficulty 4/5 3-5 days Newbie friendliness 48/100
microsoft/AttackSurfaceAnalyzer#767 · 1 comment ·
-
bug
microsoft/AttackSurfaceAnalyzer#765 · 1 reaction · 2 assignees ·
-
GUI does not work Openbug
Difficulty 5/5 Over a week Newbie friendliness 15/100
microsoft/AttackSurfaceAnalyzer#764 · 1 comment ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
All issues in microsoft/AttackSurfaceAnalyzer
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
-
agentic-workflows untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100