Giter Club home page Giter Club logo

le_ios's People

Contributors

adamac avatar candotti avatar coryallegory avatar dodikk avatar hughescr avatar jeffaburt avatar joelrfcosta avatar johnlemberger avatar kieranobrien-r7 avatar omgapuppy avatar rsheng-r7 avatar udangel-r7 avatar vilda-r7 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  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

le_ios's Issues

Deadlock issue

We have noticed that every once in a while, le_poke() will deadlock. Are there any gremlins we should be working around, or is this a known issue?

Thanks!

SSL

Does the library use port 20000 when LOGENTRIES_USE_TLS is set to true?

It looks like it isn't, judging by the source code, unless I'm missing something as I can't test it

Security threat due to insecure functions "malloc" used in lecore.m file.

Hi,

I am getting security threat in below code for lecore.m class https://github.com/LogentriesCommunity/le_ios/blob/master/lelib/lecore.m

occurrences of "malloc()" method which is an insecure function acc to security tool.

char local_buffer = malloc(length + 1);*

Below is the issue description and reference links from security team.

Issue description : Use of insecure functions/potential dangerous functions
Reference link: https://cwe.mitre.org/data/definitions/676.html
This would explain why SECURITY TEAM is recommending the change of these functions.

Please provide solution for this as soon as possible as it is very urgent.

Security threat in LogFile

Hi,

I am getting security threat in below code for LogFile.m class

  • (void)markPosition:(NSInteger)position
    {
    NSString* markString = [NSString stringWithFormat:@"%ld", (long)position];
    NSString* markPath = [self markPath];
    NSError* error = nil;
    BOOL r = [markString writeToFile:markPath atomically:YES encoding:NSASCIIStringEncoding error:&error];
    if (!r) {
    LE_DEBUG(@"Error marking read position to file '%@'", error);
    }
    self.bytesProcessed = position;
    }

Below is the issue description and some suggestions from security tool.

Issue : The call to writeToFile:atomically:encoding:error:() at LogFile.m line 229 uses methods which write to temporary files before writing to the targeted file.

Recommendations- To avoid this problem, work with file descriptors instead of file paths. Initialize an NSFileHandle object with the file descriptor and use NSFileHandle methods to write to the file.

Thanks and Regards,
Usman Ansari

Allow JSON logging

I would like to be able to log a message with attached context. I don't see a way to do that right now. It seems like I can only log a string without any JSON context.

Swift Demo

Hello,

Could you please provide a demo app in Swift that handles crashes. I couldn't figure it out. There is no main() in swift. I tried le_handle_crashes() with no luck. Any quick help would be appreciated.

Security threat due to insecure function "fopen" in LEBackgroundThread.m class

Hi,

I am getting security threat in below code for lecore.m class
https://github.com/LogentriesCommunity/le_ios/blob/master/lelib/LEBackgroundThread.m

There are 1 occurrences of "fopen()" method which is an insecure function acc to security tool.
self.inputFile = fopen([path cStringUsingEncoding:NSUTF8StringEncoding], "r");

Below is the issue description and reference links from security team.

Issue description : Use of insecure functions/potential dangerous functions
Reference link: https://cwe.mitre.org/data/definitions/676.html
This would explain why SECURITY TEAM is recommending the change of these functions.

Please provide solution for this as soon as possible as it is very urgent.

Thanks and Regards

This tool is not reporting fatal error of my application

Hi Team,

I would like to draw your attention towards a very serious issue of this library. My project is in objective-c/Swift and I got to know that this library is not reporting fatal error issues. I raised this issue in logentries website as well and based on their response, I am reporting this here. Please look into this and let me know if you guys have also experienced the same issue.

Socket cannot open while using a proxy internet connection

When setting a proxy (either on device or simulator via Mac) the stream does not open, trying to reopen after the retry timeout.

Neither

CFDictionaryRef proxySettings = CFNetworkCopySystemProxySettings();
CFWriteStreamSetProperty(writeStream, kCFStreamPropertyHTTPProxy, proxySettings);

nor

[self.outputSocketStream setProperty:(__bridge id)proxySettings forKey:(__bridge id)kCFStreamPropertyHTTPProxy];

in LELog.m:52 initNetworkCommunication help

Security threat due to insecure function "memcpy" in lecore.m class

Hi,

I am getting security threat in below code for lecore.m class https://github.com/LogentriesCommunity/le_ios/blob/master/lelib/lecore.m

There are 3 occurrences of "memcpy()" method which is an insecure function acc to security tool.

In void le_log(const char message)* method, there are 2 occurences-

  1. memcpy(buffer, le_token, token_length);
  2. memcpy(buffer + token_length + 1, message, length);

In void le_write_string(NSString string)* method , there is a line
3. memcpy(buffer, le_token, token_length);

Below is the issue description and reference links from security team.

Issue description : Use of insecure functions/potential dangerous functions
Reference link: https://cwe.mitre.org/data/definitions/676.html
This would explain why SECURITY TEAM is recommending the change of these functions.

Please provide solution for this as soon as possible as it is very urgent.

Thanks and Regards,
Priya Mehndiratta

BSD license

Hi,

just to clarify, since you use the BSD license which says that reproductions in binary form must include the author's copyright info in the documentation - I'm assuming you don't actually require any such attribution in apps? (You might consider switching to MIT which only requires keeping the copyright info with the code.)

Batching and Context

Does the library do batching of log messages before sending to the cloud? Also can we add our own context to each logs, like user information, some ids?

Allow Users to turn off Verbose logging via configuration

Currently users must change the library code to turn off Verbose logging.

@jlnbuiles suggests the following

The easiest way (IMO) would probably be to allow developers to set the variable outside of the library’s code base (maybe in the <app name>-prefix.h file?). This prevents developers from having to modify your libraries after updates.

This is how CocoaLumberjack (a logging library) accomplishes it.

ex: 
#if DEBUG 
static const int logLevel = LOG_LEVEL_VERBOSE; 
#else 
static const int logLevel = LOG_LEVEL_WARNING; 
#endif

Support for ipv6

In LeNetworkStatus

---- addr.sin_family = AF_INET; // addr.sin_family = AF_INET6; <- to support IPV6.
Apple rejects app for not enabling IPV6

cocoapods support?

Is there cocoapods support for this? I tried the name specified in the podspec ('le') and it fails. Maybe the name is too short?

Allow to turn off exception handler

Currently LogEntries handles crashes by default:

lecore.m file

int le_init()
{
    ...        
    NSSetUncaughtExceptionHandler(&le_exception_handler);
    ...
}

this is very inconvenient when you use another crash handler, like Crashlytics. Because it leads to kind of race -- only the one, who sets exception handler last, will handle crashes.

I suggest to disable exception handling by default, remove setting handler from init method and to add additional method for enabling, like this

void le_handle_crashes() {
    NSSetUncaughtExceptionHandler(&le_exception_handler);
}

OR to add define macro and check it in le_init

#define LE_HANDLE_CRASHES 1

then le_init could look like

int le_init()
{
    ...     
#if  LE_HANDLE_CRASHES
    NSSetUncaughtExceptionHandler(&le_exception_handler);
#endif
    ...
}

Logger initialization for those who use another crash reporting tool, will look like this:

#define LE_HANDLE_CRASHES 0
le_init();
le_set_token("..");

new version for cocoaPods

Hi,

Is it possible to release a 1.2 release with the last patchs, including the one which hide SDK logs ?
Moreover, it will be better to rename your pod, « le » is too short and not very descriptive.
Thank you

Fatal errors not reported

Hi,

All the fatal errors are not reported. For example:
fatal error: unexpectedly found nil while unwrapping an Optional value

Old redundant logs on Logentries

Hi Team,

We are getting old redundant logs on Logentries when session starts from iOS App. Every time I launch iOS App there is increment old logs observed on Logentries. which is causing redundancy for any event. Old event is being logged on every App launch(every session start). Due to this issue we are unable to track any event's exact frequency in the system. Could you please let us know what could be the best way to encounter this problem. Is this something cache issue?

1.When iOS App is relaunched, logs from previous session(previous launch) that are already being sent are being logged again. I tries relaunching my App many time and every time it is sending old logs due to this there is lots of logs duplicity.

2.On production We saw with new App update that there is lots of logs spike in single go having since 6 months logs. Due to this there is 20 times more huge spike in logs in production with in two days.

I have attached screen shot and log file for the reference.

IkeaAlphaIos_2020-01-30_183000_2020-01-31_104537.log

ScreenshotLog

Broken link, ZIP file missing.

The following screen for setting up an iOS project has a broken link to a ZIP file on github (see screenshot attached):

screen shot 2014-08-06 at 10 41 10 am

(I didn't include the URL bar because it seemed to have information private to my account encoded in the query string.)

The commit 4fb38f1 breaks the link on the above screen.

I realize this is probably not the best place to put this feedback, but it's quick and easy for me and will probably end up on the right desk.

Stream not open yet

I have tried the following ways to add logs from my Objective C application.
[self.logger log:@"Testing using instance"];
or
[LELog log:@"Testing using class"];

But both didn't made any logs in the logentries.com account.

Reference Logs:
Testing using instance
Checking status
Retry timer active

Retry timer fired
Checking status
Stream not open yet
Socket event NSStreamEventErrorOccurred, scheduling retry timer

Warning: LogFiles.m:128:102: Initialization of pointer of type 'NSDictionary *' to null from a constant boolean expression

fileManager createDirectoryAtPath:::: takes a dictionary containing the attributes, LogeFiles.m passes in NO.
Fix is to change LogFiles.m:128 from:

BOOL created = [fileManager createDirectoryAtPath:path withIntermediateDirectories:NO attributes:NO error:&error];

to

BOOL created = [fileManager createDirectoryAtPath:path withIntermediateDirectories:NO attributes:nil error:&error];

Let me know if you'd prefer this as a PR.

Security threat due to insecure functions used in lecore.m file.

Hi,

I am getting security threat in below code for lecore.m class https://github.com/LogentriesCommunity/le_ios/blob/master/lelib/lecore.m

There are 2 occurrences of "strlen()" method which is an insecure function acc to security tool.

In void le_log(const char message)* method, there is a line -
size_t length = strlen(message);

In bool is_valid_token(const char * token,size_t token_length)* method , there is a line
length = strlen(token);

Below is the issue description and reference links from security team.

Issue description : Use of insecure functions/potential dangerous functions
Reference link: https://cwe.mitre.org/data/definitions/676.html
This would explain why SECURITY TEAM is recommending the change of these functions.

Please provide solution for this as soon as possible as it is very urgent.

Thanks and Regards,
Priya Mehndiratta

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.