Skip to content

Commit ff8b003

Browse files
committed
ssl validation handling
1 parent 278e3f0 commit ff8b003

4 files changed

Lines changed: 15 additions & 6 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Flags: (See run command, in this document, for syntax of flags)
1616
--cloudfoundry-password= Cloud Foundry Password
1717
--events="LogMessage" Comma separated list of events you would like. Valid options are ContainerMetric, CounterEvent, Error, HttpStart, HttpStartStop,
1818
HttpStop, LogMessage, ValueMetric
19+
--skip-ssl-validation Skip SSL validation (to allow things like self-signed certs). Do not set to true in production
1920
--nozzle-polling-period=15s How frequently this Nozzle polls the CF Firehose for data
2021
--log-events-batch-size=500 When number of messages in the buffer is equal to this flag, send those to Sumo Logic
2122
--sumo-post-minimum-delay=2000ms Minimum time between HTTP POST to Sumo Logic
@@ -76,7 +77,7 @@ If an event **share both filters** (contains a _Include-Only filter_ field and a
7677
The correct way of using those flags will be something like this:
7778

7879
```
79-
godep go run main.go --sumo-endpoint=https://sumo-endpoint --api-endpoint=https://api.endpoint --cloudfoundry-user=some_user --cloudfoundry-password=some_password --sumo-post-minimum-delay=200ms --log-events-batch-size=200 --events=LogMessage, ValueMetric --include-only-matching-filter=job:diego_cell,source_type:app --exclude-always-matching-filter=source_type:other,unit:count
80+
godep go run main.go --sumo-endpoint=https://sumo-endpoint --api-endpoint=https://api.endpoint --skip-ssl-validation --cloudfoundry-user=some_user --cloudfoundry-password=some_password --sumo-post-minimum-delay=200ms --log-events-batch-size=200 --events=LogMessage, ValueMetric --include-only-matching-filter=job:diego_cell,source_type:app --exclude-always-matching-filter=source_type:other,unit:count
8081
```
8182

8283

main.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ var (
2727
keepAlive, errK = time.ParseDuration("25s") //default Error,ContainerMetric,HttpStart,HttpStop,HttpStartStop,LogMessage,ValueMetric,CounterEvent
2828
wantedEvents = kingpin.Flag("events", fmt.Sprintf("Comma separated list of events you would like. Valid options are %s", eventRouting.GetListAuthorizedEventEvents())).Default("LogMessage").OverrideDefaultFromEnvar("EVENTS").String()
2929
boltDatabasePath = "event.db"
30+
skipSSLValidation = kingpin.Flag("skip-ssl-validation", "Skip SSL validation (to allow things like self-signed certs). Do not set to true in production").Default("false").OverrideDefaultFromEnvar("SKIP_SSL_VALIDATION").Bool()
3031
tickerTime = kingpin.Flag("nozzle-polling-period", "How frequently this Nozzle polls the CF Firehose for data").Default("15s").OverrideDefaultFromEnvar("NOZZLE_POLLING_PERIOD").Duration()
3132
eventsBatchSize = kingpin.Flag("log-events-batch-size", "When number of messages in the buffer is equal to this flag, send those to Sumo Logic").Default("500").OverrideDefaultFromEnvar("LOG_EVENTS_BATCH_SIZE").Int()
3233
sumoPostMinimumDelay = kingpin.Flag("sumo-post-minimum-delay", "Minimum time between HTTP POST to Sumo Logic").Default("2000ms").OverrideDefaultFromEnvar("SUMO_POST_MINIMUM_DELAY").Duration()
@@ -51,15 +52,16 @@ func main() {
5152
kingpin.Parse()
5253

5354
logging.Info.Println("Set Configurations:")
54-
logging.Info.Println("CF API Endpoint: t" + *apiEndpoint)
55+
logging.Info.Println("CF API Endpoint: " + *apiEndpoint)
5556
logging.Info.Println("Sumo Logic Endpoint: " + *sumoEndpoint)
5657
//logging.Info.Println("Cloud foundry Doppler Endpoint: " + *dopplerEndpoint) //TODO
5758
logging.Info.Println("Cloud Foundry Nozzle Subscription ID: " + *subscriptionId)
5859
logging.Info.Println("Cloud Foundry User: " + *user)
5960
logging.Info.Println("Events Selected: " + *wantedEvents)
60-
logging.Info.Printf("Nozzle Polling Period: %v\n", *tickerTime)
61-
logging.Info.Printf("Log Events Batch Size: [%d]\n", *eventsBatchSize)
62-
logging.Info.Printf("Sumo Logic HTTP Post Minimum Delay: %v\n", *sumoPostMinimumDelay)
61+
logging.Info.Printf("Skip SSL Validation: %v", *skipSSLValidation)
62+
logging.Info.Printf("Nozzle Polling Period: %v", *tickerTime)
63+
logging.Info.Printf("Log Events Batch Size: [%d]", *eventsBatchSize)
64+
logging.Info.Printf("Sumo Logic HTTP Post Minimum Delay: %v", *sumoPostMinimumDelay)
6365
if *sumoName != "" {
6466
logging.Info.Println("Sumo Logic Name: " + *sumoName)
6567
}
@@ -118,7 +120,7 @@ func main() {
118120

119121
firehoseConfig := &firehoseclient.FirehoseConfig{
120122
TrafficControllerURL: cfClient.Endpoint.DopplerEndpoint,
121-
InsecureSSLSkipVerify: true,
123+
InsecureSSLSkipVerify: *skipSSLValidation,
122124
IdleTimeoutSeconds: keepAlive,
123125
FirehoseSubscriptionID: *subscriptionId,
124126
}

manifest.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ env:
77
CLOUDFOUNDRY_USER: firehose_user_authorized
88
CLOUDFOUNDRY_PASSWORD: password_firehose_user_authorized
99
EVENTS: LogMessage
10+
SKIP_SSL_VALIDATION: false
1011
NOZZLE_POLLING_PERIOD: 15s
1112
LOG_EVENTS_BATCHSIZE: 200
1213
SUMO_POST_MINIMUM_DELAY: 200ms

tile.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ forms:
110110
label: Comma separated list of events you would like (Default is "LogMessage")
111111
default: LogMessage
112112
description: Valid options are Error,ContainerMetric,HttpStart,HttpStop,HttpStartStop,LogMessage,ValueMetric,CounterEvent
113+
- name: skip-ssl-validation
114+
type: boolean
115+
label: Skip SSL validation
116+
default: false
117+
description: Skip SSL validation (to allow things like self-signed certs). Do not set to true in production
113118
- name: verbose-log-messages
114119
type: boolean
115120
label: Verbose in 'LogMessage' event

0 commit comments

Comments
 (0)