Skip to content

Commit

Permalink
use Fleet instead of FleetDM in certificates
Browse files Browse the repository at this point in the history
for #18427
  • Loading branch information
roperzh committed Jun 13, 2024
1 parent 60b233e commit a29b962
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions changes/18427-cert-names
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Use Fleet instead of FleetDM in MDM certificates
2 changes: 1 addition & 1 deletion server/datastore/mysql/mdm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6122,7 +6122,7 @@ func testSCEPRenewalHelpers(t *testing.T, ds *Datastore) {
cert := &x509.Certificate{
SerialNumber: serial,
Subject: pkix.Name{
CommonName: "FleetDM Identity",
CommonName: "Fleet Identity",
},
NotAfter: notAfter,
// use a random value, just to make sure they're
Expand Down
2 changes: 1 addition & 1 deletion server/datastore/mysql/scep_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestAppleMDMSCEPSerial(t *testing.T) {
func TestAppleMDMPutAndHasCN(t *testing.T) {
depot := setup(t)

name := "FleetDM Identity"
name := "Fleet Identity"
serial, err := depot.Serial()
require.NoError(t, err)
cert := x509.Certificate{
Expand Down
6 changes: 3 additions & 3 deletions server/mdm/apple/apple_mdm.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ type DEPService struct {
// getDefaultProfile returns a godep.Profile with default values set.
func (d *DEPService) getDefaultProfile() *godep.Profile {
return &godep.Profile{
ProfileName: "FleetDM default enrollment profile",
ProfileName: "Fleet default enrollment profile",
AllowPairing: true,
AutoAdvanceSetup: false,
IsSupervised: false,
Expand Down Expand Up @@ -688,8 +688,8 @@ var enrollmentProfileMobileconfigTemplate = template.Must(template.New("").Parse
<string>{{ .SCEPURL }}</string>
<key>Subject</key>
<array>
<array><array><string>O</string><string>FleetDM</string></array></array>
<array><array><string>CN</string><string>FleetDM Identity</string></array></array>
<array><array><string>O</string><string>Fleet</string></array></array>
<array><array><string>CN</string><string>Fleet Identity</string></array></array>
</array>
</dict>
<key>PayloadIdentifier</key>
Expand Down
4 changes: 2 additions & 2 deletions server/mdm/apple/cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
const (
defaultFleetDMAPIURL = "https://fleetdm.com"
getSignedAPNSCSRPath = "/api/v1/deliver-apple-csr"
depCertificateCommonName = "FleetDM"
depCertificateCommonName = "Fleet"
depCertificateExpiryDays = 30
)

Expand Down Expand Up @@ -208,7 +208,7 @@ func NewSCEPCACertKey() (*x509.Certificate, *rsa.PrivateKey, error) {

caCert := depot.NewCACert(
depot.WithYears(10),
depot.WithCommonName("FleetDM"),
depot.WithCommonName("Fleet"),
)

crtBytes, err := caCert.SelfSign(rand.Reader, key.Public(), key)
Expand Down
6 changes: 3 additions & 3 deletions server/service/integration_mdm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -531,9 +531,9 @@ func (s *integrationMDMTestSuite) TestAppleGetAppleMDM() {
var mdmResp getAppleMDMResponse
s.DoJSON("GET", "/api/latest/fleet/apns", nil, http.StatusOK, &mdmResp)
// returned values are dummy, this is a test certificate
require.Equal(t, "FleetDM", mdmResp.Issuer)
require.Equal(t, "Fleet", mdmResp.Issuer)
require.NotZero(t, mdmResp.SerialNumber)
require.Equal(t, "FleetDM", mdmResp.CommonName)
require.Equal(t, "Fleet", mdmResp.CommonName)
require.NotZero(t, mdmResp.RenewDate)

s.mockDEPResponse(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
Expand Down Expand Up @@ -8834,7 +8834,7 @@ func (s *integrationMDMTestSuite) appleCoreCertsSetup() {
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
BasicConstraintsValid: true,
Subject: pkix.Name{
CommonName: "FleetDM",
CommonName: "Fleet",
ExtraNames: []pkix.AttributeTypeAndValue{
{
Type: asn1.ObjectIdentifier{0, 9, 2342, 19200300, 100, 1, 1},
Expand Down
2 changes: 1 addition & 1 deletion server/worker/macos_setup_assistant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func TestMacosSetupAssistant(t *testing.T) {
DEPClient: apple_mdm.NewDEPClient(depStorage, ds, logger),
}

const defaultProfileName = "FleetDM default enrollment profile"
const defaultProfileName = "Fleet default enrollment profile"

// track the profile assigned to each device
serialsToProfile := map[string]string{
Expand Down

0 comments on commit a29b962

Please sign in to comment.