Skip to content

Commit 28e7ba0

Browse files
authored
Merge pull request #324 from cloudfoundry-community/resolve-semgrep-failures
Resolve semgrep failures
2 parents d0c8838 + 22d036c commit 28e7ba0

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

.semgrepignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
tile/build.sh
2+
.github/pre-req.sh
3+
testing/

cache/boltdb.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ func (c *Boltdb) createBucket() error {
318318
// invalidateMissingAppCache perodically cleanup inmemory house keeping for
319319
// not found apps. When the this cache is cleaned up, end clients have chance
320320
// to retry missing apps
321-
func (c *Boltdb) invalidateMissingAppCache() {
321+
func (c *Boltdb) invalidateMissingAppCache() { // nosemgrep false-positive : Execution of ticker `ticker` more times than desired will not be causing any issues for function "invalidateMissingAppCache".
322322
ticker := time.NewTicker(c.config.MissingAppCacheTTL)
323323

324324
c.wg.Add(1)
@@ -340,7 +340,7 @@ func (c *Boltdb) invalidateMissingAppCache() {
340340

341341
// invalidateCache perodically fetches a full copy apps info from remote
342342
// and update boltdb and in-memory cache
343-
func (c *Boltdb) invalidateCache() {
343+
func (c *Boltdb) invalidateCache() { // nosemgrep false-positive : Execution of ticker `ticker` and `orgSpaceTicker` more times than desired will not be causing any issues for function "invalidateCache".
344344
ticker := time.NewTicker(c.config.AppCacheTTL)
345345
orgSpaceTicker := time.NewTicker(c.config.OrgSpaceCacheTTL)
346346

events/events.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ func IsAuthorizedEvent(wantedEvent string) bool {
271271
return ok
272272
}
273273

274-
func AuthorizedEvents() string {
274+
func AuthorizedEvents() string { // nosemgrep false-positive : `Envelope_EventType_name` is not pointer.
275275
arrEvents := []string{}
276276
for _, listEvent := range events.Envelope_EventType_name {
277277
arrEvents = append(arrEvents, listEvent)

eventsource/firehose.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type Firehose struct {
2727
}
2828

2929
func NewFirehose(tokenClient TokenClient, config *FirehoseConfig) *Firehose {
30-
c := consumer.New(config.Endpoint, &tls.Config{InsecureSkipVerify: config.SkipSSL}, nil)
30+
c := consumer.New(config.Endpoint, &tls.Config{InsecureSkipVerify: config.SkipSSL, MinVersion: tls.VersionTLS12}, nil)
3131
c.SetIdleTimeout(config.KeepAlive)
3232

3333
f := &Firehose{

eventwriter/splunk.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type splunkClient struct {
3434
func NewSplunk(config *SplunkConfig) Writer {
3535
httpClient := cfhttp.NewClient()
3636
tr := &http.Transport{
37-
TLSClientConfig: &tls.Config{InsecureSkipVerify: config.SkipSSL},
37+
TLSClientConfig: &tls.Config{InsecureSkipVerify: config.SkipSSL, MinVersion: tls.VersionTLS12},
3838
}
3939
httpClient.Transport = tr
4040

0 commit comments

Comments
 (0)