Git Product home page Git Product logo

adcs's Introduction

ADCS

A library and command line interface for scraping Active Directory Certificate Services Web enrollment Service web interface.

While attempting to automate public key infrastrucutre in an enterprise environment it quickly became apparent that the common approaches such as ACME and SCEP are inadequate when dealing with devices that do not support such prototols. An example of this is a Cisco network device I was configuring. All this device is able to do is generate CSR's. SCEP/NDES - specifically the renewal part requires access to the private key in order to renew the certificate, ACME, while cool is unsuitable for use within an enterprise network.

So we are left with either interfacing with ADCS directly through the MMC or the Web Enrolment serivice. When you have a thousand devices to deploy, doing stuff manually isn't very appealing. Here is where adcscli is born. adcscli is a scraper for microsofts web enrollment services. Given a CSR and a few other pieces of information the software will interact with Active Directory Certificate Services Web Enrollment Services and hopefully retrieve a signed certificate.

Here Be Dragons

adcs is a scraper. Because Web Enrollment Services does not have an API it instead relies on regular expressions. The patterns being matched may change and this software may stop working at any time.

Installation

Head to https://github.com/jimmypw/adcs/releases for binaries for your favourite operating system.

Usage

There are two modes of operation, the first is submitting a csr. The second is checking the status of the csr.

To submit a new csr:

adcscli -new -csr csr.csr -out crt.crt -password 'supersecurepassword' -username auser -url http://192.168.252.140/certsrv/ -template webtemplate

The CSR will be submitted to the web enrollment service and will produce one of two responses.

The certificate request requires admin approval

In this case a command will be returned to the user to check the status of the request.

for example adcscli -pend -url http://192.168.252.140/certsrv/ -username 'username' -password 'password' -requestid 3395

The command will emit the exit status of 1 to indicate a pending request.

Notice that this command does not return the username and password. These are required to submit the pending request.

The certificate request was successful

In this case a certificate will be returned to the user. The certficicate can be saved to the filesystem by using the -out command line switch. If -out is not supplied the certificate will be printed to stdout.

To check the status of an existing request

The responses are the same as submitting a new CSR.

adcs's People

Contributors

edanko avatar jimmypw avatar rpromyshlennikov avatar xorcare avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

adcs's Issues

Update Releases

The releases are non-existant. Providing binaries makes this project more attractive to people who are not familiar with go.

It would be great to write some automation to automatically build each OS / ARCH combination.

Pending requests broken

I removed the requirement for submitting the cookie as part of retrieving the status of a pending request. This was an error and the cookie is infact required. I'll put it back.

Unable issue certificate over SSL/https

Hi, i am trying to signing csr's all paramaters are OK -password 'ourpass' -username 'ourusername' for -url we are trying https:// (certificate is self-signed by out CA) which we have on windows CA server we still become error message:
"access is denied due to invalid credentials"

our password have generated special characters like "!"
credentials are correct over webbrowser it's possible to login with same cred.

Would appreciate any help here
Regards,
Anton

Better Documentation

The README file is a mess and large chunks of it need to be re-written.

The README does a really bad job at describing what this application does and how it works.

It would be great if I could get some documentation hints for ADCS in here also.

Generate CSR inside application

I'd like to be able to generate the CSR internally to the application. In such a way so that given some necessary information a key and a certificate are returned.

panic: The request failed and i do not know why: response.status = 3

The application drops a kind of unusable general error message:
"panic: The request failed and i do not know why: response.status = 3"

It is quite hard to troubleshoot.

Command ran:
~/go/bin/adcscli -csr '/tmp/certs/cert.csr' -out '/tmp/certs/cert.crt' -username 'domain\user' -password 'securepassword' -template 'Web Server key' -url 'https://ca.domain.local/certsrv'

Full error message:
panic: The request failed and i do not know why: response.status = 3

goroutine 1 [running]:
github.com/jimmypw/adcs.(*WebEnrollmentNewRequest).Submit(0xc00008ecc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc0000d6000)
/home/user/go/src/github.com/jimmypw/adcs/webenrollmentnewrequest.go:54 +0x597 github.com/jimmypw/adcs.(*WebEnrollmentServer).SubmitNewRequest(0xc00008ec90, 0xc0000d6000, 0x74e, 0x94e, 0x7ffff7966999, 0xe, 0x0, 0x0, 0x0, 0x0, ...)
/home/user/go/src/github.com/jimmypw/adcs/webenrollmentserver.go:28 +0xfe main.main()
/home/user/go/src/github.com/jimmypw/adcs/cli/adcscli/main.go:88 +0x437

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.