SSRS vs SCVMM – The Kerberos token dispute
Join the DZone community and get the full member experience.Join For Free
i have been working with one of my colleagues, bryon, over the holidays in order to install both tfs and lab management at a customer. now that customer has some awesome hardware, but insisted on a physical tfs server. the dl320 with 18 cores, 42gb ram and 2tb of storage make a pretty fast tfs server, but we did run into a couple of problems. the solution to the first problem caused the second problem.
conclusion: never put the scvmm server on the same box as rs if you are using domain accounts
we initially configured tfs in a single server configuration as well as the two lab management servers for hyper-v. the hyper-v boxes were so big (2* 24 cores, 98gb ram and 6tb) that we stole a little from the first one to run 5 extra computers.
- tfs build agents – 2 servers running tfb configured to run two agents each
- tfs build controller – single server configured as a build controller only
- tfs test controller – single server configured as a test controller and joined to tfs
- tfs client – single client running vs2010 ultimate for config and testing
figure: what is installed where
we had the svcvmm server installed on the tfs box a this was thought to be a good place to stick it as out tfs server is enormously over muscled. so we have the scvmm server on the tfs server and a single host configured and all is well. we dutifully follow the instructions to configure lab management and have it talk to our single host and we had everything up and running.
the first problem – reporting services authentication issues
if you have ever setup rs you will know that the best way to run it is either under network service, or (as in our case) if security concerns dictate then under active directory credentials. there is however a requirement for those ad credentials to have certain abilities that are documented in the how to: register a service principal name (spn) for a report server document and a quick read usually gets your service account endowed with domain admin as very few small infrastructure teams have the skills necessary to really grok the subtle nuances of active directory.
in this case, the tfsservice account that we are using was not allowed to be domain admin (unsurprisingly as this a little bit of a dumb idea), but it was chosen over the defined sql server service account as, rightly, the organisation did not want to give us the password: now, if you are installing tfs you will know that it is important for you to install sql according to the documentation for tfs as 90% of failed installs are due to sql configuration, however i have never been given the sql password on any network and always have relied on an over-the-shoulder-typer to enter it. i digress, but the result is that both ssde, ssas and ssrs all run under the tfsservice account. this being the case we ran into the aforementioned age old “reporting services needs an spn” error.
this error manifests as users always being asked for credentials when logging in from a server other than the local rs box, and no matter how slowly they type them in or what privileges they have on the server or rs they always get a denied. this is due to that pesky “spn” part, and i often hear “what the hell is that spn thing anyway?”.
spn’s are an integral part of active directory and allows things to be authenticated by kerberos. kerberos is ad’s secure token exchange protocol that is the bedrock of secure networks. they a re kind of like “allowed permissions” for communication. you have to say that a server is allows to respond securely on a particular url\protocal.
figure: spn for reporting services under network service
so if you use “network service” or “local service” then an spn must be added with the name of the computer to its own domain account (yes, computers have domain accounts too) and this is set up by default so that a serve can authenticate under its own account. if you have a sql service account with the proper permission in ad then sql server will add its owe spn’s automatically as part of the installation and you don’t need to worry about it. however if you are running under for example “domain\tfsservice” that does not have this permission then you will need to add custom spn’s manually.
setspn -a http/tfs01.domain.com domain\tfsservice
setspn -a http/tfs01 domain\tfsservice
figure: spn for reporting services under domain account
now you have this added (and yes, you have to do this if you are running on a custom domain as well) your users will almost be able to authenticate
they will still need to follow “ always prompted for credentials in tfs 2010? ” to make sure that your users can get their kerberos ticket now that the server will allow them.
the second problem – system centre virtual machine manager stops working
then, after solving the ssrs issue we went to add the second hyper-v host to scvmm and the job erred out. i looked at the error and as usual it was no help, so after a few tries i rebooted all of the servers and tried again. this time i got a nasty kerberos error that there were duplicate entries competing for tokens.
the kerberos client received a krb_ap_err_modified error from the server tfs01. the target name used was http/tfs01. this indicates that the target server failed to decrypt the ticket provided by the client. this can occur when the target server principal name (spn) is registered on an account other than the account the target service is using. please ensure that the target spn is registered on, and only registered on, the account used by the server. this error can also happen when the target service is using a different password for the target service account than what the kerberos key distribution center (kdc) has for the target service account. please ensure that the service on the server and the kdc are both updated to use the current password. if the server name is not fully qualified, and the target domain (domain.com) is different from the client domain (domain.com), check if there are identically named server accounts in these two domains, or use the fully-qualified name to identify the server.
when you have duplicated kerberos effectively throws in the towel until it is resolved to prevent security breaches and, more specifically to prevent consultants keeping their hair.
i ran the spnquery.vbs tool to output the tokens for both the tfs server and the tfs service account and could not find any duplicates. after quite some amount of frustration and hair pulling i realised that scvmm was trying to communicate with itself (the tfs server) with an http connection. so i investigated all of the services and the accounts that they were running under in order to identify the issue. while the reporting services service was running under tfsservice the virtual machine manager service was running under the tfshypervmanager (don’t ask) service account.
did your light bulb go on?
let me explain.
- scvmm : the scvmm was trying to communicate with itself and its hosts were trying to communicate with it using the http protocol to a service running within the tfshypervmanager security context.
- ssrs : the users were trying to communicate with the rs server using the http protocol to a service running with the tfsservice security context
- ad spn : we have an spn set for the http protocol to the server name with the tfsservice security context
ko for ssrs! kerberos flakes out and will not decrypt tokens for scvmm where it would before because the tfshypervmanager had permission to set spn’s. sigh… i hate infrastructure work.
there is no way that you can have scvmm and rs running under ad credentials to coexist unless they are running under the same account and this was explicitly denied by the installer as the tfsservice is used as part of the vm setups for lab management.
as my mother used to do with my brother and i: i separated them.
Published at DZone with permission of Martin Hinshelwood, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Build a Simple Chat Server With gRPC in .Net Core
How To Scan and Validate Image Uploads in Java
Does the OCP Exam Still Make Sense?
How Agile Works at Tesla [Video]